![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Three Dashboxes in three different buildings. One has a single GEM, one has two GEMs, and one has two ECM-1240. I wanted to hook everything up so I could use btmon to bring everything to a single instance of Emoncms on a Raspberry Pi.
The confusion came with the port numbers. The Dashbox ports are defaulted to 8001 and 8002 for RS-232#1 and RS-232#2. The instructions for btmon also use 8001 and 8002 as default ports. I was totally confused and couldn't see how these were related. Ben would send me instructions that just didn't make any sense. Until I realized...
Dashbox 8001/8002 ports have nothing to do with btmon 8001/8002 ports.
Once I figured that out, I changed the btmon ports to 8003/8004. You can use 8001/8002 on btmon, since they are in a different address space, but changing them to anything else leads to less confusion. My layout is shown in the attachment.
The trick is the packet forwarding. Port 8003 is used to forward to the btmon instance decoding GEM, and 8004 is used to forward to the btmon instance decoding ECM-1240 packets. On the Pi, I have two configuration files, and so run two instances of btmon. I add these two lines to /etc/rc.local so they run at startup:
Code: Select all
python /home/pi/btmon.py -c /home/pi/btmon-gem.cfg --verbose>>/home/pi/btmon-gem.log&
python /home/pi/btmon.py -c /home/pi/btmon-ecm1240.cfg --verbose>>/home/pi/btmon-ecm1240.log&
Code: Select all
tail -f btmon-gem.log
Here are the two btmon configuration files:
btmon-gem.cfg
Code: Select all
[source]
device_type = gem
ip_read = true
ip_port = 8003
ip_mode = server
[oem]
oem_out = true
oem_token = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxabb3
oem_url = http://localhost/emoncms/input/post.json
oem_node = GEM
Code: Select all
[source]
device_type = ecm1240
ip_read = true
ip_port = 8004
ip_mode = server
[oem]
oem_out = true
oem_token = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxabb3
oem_url = http://localhost/emoncms/input/post.json
oem_node = ECM-1240