Updates:
2016-06-24: created initial guide.
This guide assumes a Raspberry Pi or other system is already setup and running EmonCMS. If you haven't previously setup a system, please start with the guide below.
viewtopic.php?f=40&t=1567
Required downloads
- PuTTy or equivalent SSH program http://www.chiark.greenend.org.uk/~sgtatham/putty/.
Installing BTMon
Steps:
NOTE: You may copy and paste the command line information from this guide into PuTTy.
1. Go to your home folder.
Code: Select all
cd /home/pi
Code: Select all
sudo wget https://raw.githubusercontent.com/matthewwall/mtools/master/bin/btmon.py
Energy Monitor running as TCP Client
a. Copy/paste the following code. Change ip_port to whatever port the GEM is configured to send to.
Code: Select all
printf "[source]\ndevice_type = gem\nip_read = true\nip_port = 8000\nip_mode = server\n[oem]\noem_out = true\noem_token = TOKEN\noem_url = http://localhost/emoncms/input/post.json\noem_node = NODE_NAME" > btmon.cfg
a. Download and install PySerial (this link may change, if below doesn't work check https://pypi.python.org/pypi/pyserial for a new link and replace the string following wget).
Code: Select all
wget https://pypi.python.org/packages/3c/d8/a9fa247ca60b02b3bebbd61766b4f321393b57b13c53b18f6f62cf172c08/pyserial-3.1.1.tar.gz#md5=2f72100de3e410b36d575e12e82e9d27
sudo tar xvf pyserial-3.1.1.tar.gz
cd pyserial-3.1.1
sudo python setup.py install
cd ..
sudo rm -R pyserial*
Code: Select all
dmesg | grep -Eio "ttyUSB[0-9]+"
Code: Select all
printf "[source]\ndevice_type = gem\nserial_read = true\nserial_port = /dev/ttyUSB#\nserial_baud = 115200\n[oem]\noem_out = true\noem_token = TOKEN\noem_url = http://localhost/emoncms/input/post.json\noem_node = NODE_NAME" > btmon.cfg
Code: Select all
sudo python btmon.py -c btmon.cfg --debug
Steps
1. Run the following command.
Code: Select all
sudo sed -i 's:exit 0:python /home/pi/btmon\.py -c /home/pi/btmon\.cfg \&\nexit 0:' /etc/rc.local