Philipp's Computing Blog

Success is about speed and efficiency

Raspberry Pi Web Display for a Uni-T UT61E Multimeter

See my other post on the multimeter itself: True-RMS Digital Multimeter Uni-T UT61E

First, I set up my Raspberry Pi with Arch Linux ARM using my script arch-linux-to-sdcard.sh (which follows the instructions on http://archlinuxarm.org/platforms/armv6/raspberry-pi).

Then I log in via SSH and set up everything on the command line:

passwd

pacman -Syyu
pacman -S raspberrypi-firmware vim htop screen python python-pip cython base-devel git nodejs nmap cronie
hostnamectl set-hostname ut61epi
timedatectl set-timezone Europe/Berlin

# Not necessary:
#vim /etc/systemd/timesyncd.conf
#systemctl start systemd-timesyncd.service
#systemctl enable systemd-timesyncd.service

# Improve bash experience with
cat << "EOF" >> ~/.bashrc
export PATH=$PATH:/opt/vc/bin
export HISTSIZE=2000000
export HISTFILESIZE=50000000
EOF
echo 'if [ -f ~/.bashrc ]; then . ~/.bashrc; fi' > .bash_profile

pip install ut61e
#pip instal cython
pip install hidapi
he2325u_hidapi.py

systemctl enable cronie.service
systemctl start cronie.service

# udev:
cat << "EOF" > /etc/udev/rules.d/69-hidraw.rules
KERNEL=="hidraw*", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="e008", MODE="0666"
EOF
udevadm trigger

groupadd ut61e
useradd -m -g users -G ut61e -s /bin/bash ut61e

su ut61e
cd

git clone https://github.com/pklaus/ut61e-web.git
cd ~/ut61e-web
npm install socket.io
npm install express

script=./feed-ut61e.sh
cat << "EOF" > $script
#!/bin/bash
he2325u_hidapi.py | ~ut61e-web/es51922-to-lcd.py | while read x
do
  echo "$x" | ncat -4u localhost 5005
done
EOF
chmod +x $script

node es51922-node.js & disown
./feed-ut61e.sh & disown

exit

cat << "EOF" > /etc/cron.d/ut61epi
@reboot ut61e ~/ut61e-web/feed-ut61e.sh > /tmp/feed-ut61e.log &
@reboot ut61e cd ~/ut61e-web; node es51922-node.js > /tmp/es51922-node.log &
EOF

TODO:

  • Shutdown button connected to the RPi
  • Python script that can cope with the ut61e not being available and setting the display to (OFF) when disconnected.
  • More measurement systems connected to the Raspberry Pi
  • Create video

Post to http://www.eevblog.com/forum/projects/ut61e-serial-ports-and-diy-soft-for-plotting-u2f%28u1%29-%28how-to-transmit-data%29/

Resources

https://github.com/pklaus/ut61e-web/