- copy fresh raspbian image (http://www.raspberrypi.org/downloads/) on to SD card, insert in pi and boot (use this tool to copy to SD card http://sourceforge.net/projects/win32diskimager/)
- connect with SSH (default username is pi and the password is raspberry
- run 'sudo raspi-config' and choose to expand file system
- run 'sudo reboot'
- log back in with SSH
- run 'sudo apt-get update' and then 'sudo apt-get upgrade'
- run 'sudo reboot'
- log back in with SSH
- python is installed by default - so need to worry about that
- run mkdir btmon
- copy over the btmon.py file into the btmon directory (download latest from http://lancet.mit.edu/mwall/projects/power/)
personally I use the bitvise SSH client on windows that comes with an easy to use SFTP GUI function that I use to make directories, copy files and rename them - rename file to btmon.version.py - mine is currently btmon.3.1.1.py
- CD into the directory where you copied the renamed btmon script and run 'nano config.cfg' this starts the text editor. Use the cursor keys and ctrl+ letter combinations to navigate
- the first section should look something like this:
[source]
device_type = gem
ip_read = true
ip_host = 192.168.1.100
ip_port = 8000
ip_mode = client
reverse_polarity = 1 - this connects to the ethernet adapter of a GEM that shared com1. the IP address is the the IP address the GEM got issued by your DHCP server, router, or that you manually assigned. The port of 8000 is the default, if you changed it you will need to change this, the reverse polarity was need in my system or some of the sites registered negative value YMMV.
- next you need to configure the services you want to connect to, you will need a variety of information to configure these, where to go and how to register is all covered in the btmon.py script up front, so read it. If you have question I will try and answer.
Anything in <> brackets is a parameter you get from registering on the service in question and is unique to you and your installation.
For the GEM you will see xx replacing my SN digits - use you right sn
[openenergymonitor]
oem_url = http://emoncms.org/input/post.json
oem_out = true
oem_token = <token>
oem_node = 1
[bidgely]
bidgely_out = true
by_url = https://api.bidgely.com/v1/users/<token ... s/1/upload
by_map = 010000xx_ch1,mains,0,
[plotwatt]
plotwatt_out = true
pw_house_id = <housed>
pw_api_key = <apikey>
pw_map=010000xx_ch1,<meterid1>,01000029_ch3,<meterid2>
[thingspeak]
thingspeak_out = true
ts_tokens = 010000xx,<token>
ts_fields = 010000xx_ch1,1
[wattvision]
wattvision_out = true
wv_api_id = <apid>
wv_api_key = <apikey>
wv_sensor_id = <sensorid>
wv_channel = 010000xx_ch1 - open energy monitor - this is the one that for me showed the negative values that caused me to reverse polarity so be warned, by default the configuration load all 32 channels
- bidgely - this is my favourite that I am using with btmon.py I am only loading my main channel. the main and 0 are to tell it this. I am waiting to see how well their API does disaggregation before I think about uploading the rest of my channels.
- plotwatt is hard to setup due to the need to use curl to create the meters, however curl is installed on pi by default so if you follow the instructions in the script notes you should have no issues. while I am uploading 2 channels as two meters (my main and a load, I am not sure there is any need to do more than just the main ch1 (or ch1 and ch2 if you are monitoring the different sides of your supply separately).
- thingspeak and wattvision I am still figuring out
- from within your btmon directory run 'python ./btmon.3.1.1.py -c config.cfg
this will let you see the console log output and you will get errors if you did something wrong
if you want this to run at startup then: - sudo nano /etc/rc.local
- in the file add this command anywhere above the exit 0 command
#run btmon.py to send data to services
python /home/pi/btmon/btmon.3.1.1.py -c /home/pi/btmon/config.cfg > /dev/null 2>&1 &
My system has been uploading data to all of these services ~24hours at this point.