Configuration of GEM and btmon.py for success

Working on a home project? Post it here.
Post Reply
Carl
Posts: 9
Joined: Fri Oct 21, 2011 12:45 pm

Configuration of GEM and btmon.py for success

Post by Carl » Sat Feb 10, 2018 9:21 am

First I want to say thanks to Ben and a long post by scyto which helped me out. Since they were so helpful, and this process was difficult for me, I figured I would post to help someone else.

I looked and could not find complete instructions for setting up the GEM to communicate with btmon.py. scyto has a great post on the btmon.py config side with lots of instructions and options on sending data to multiple hosting providers. A great read for more information.

This post contains the following main sections:
1. GEM Configuration for it to send the data to btmon.py
2. Configuration for btmon.py to accept the data and write it to standard output.
3. Next Steps
4. Two troubleshooting items I ran into
5. Sample results from a working confg of GEM and btmon.py


GEM Configuration
I did not have to make any changes in the GEM Network Utility. I did all the changes via the web connection on port 80 to the IP Address of the GEM. Example: http://192.168.35.2

The hard part was configuring the GEM. There did not seem to be enough documentation around how to set the GEM in Client or Server mode or determine what mode my GEM was in. But what I did seems to have worked.

In the Packent Send Tab
Real Time Status = off
Primary (Com1) Packet Format: 4: Bin48-Net-Time
Packet Send Interval: (Whatever you want) I have 30 seconds
Primary (Com2) Packet Format: 0: Disabled (It may be you will use this for some other target like DashBox, but I did not experiment with this.)
(Of course click Save)

In the "Data Post" screen:
I think none of the settings here apply. I think this because I have the Temperature and Pulse Counters disabled on this screen, but btmon.py results shows this data. So I think this screen is not used with btmon.py

On the "Network Tab" under "Remote Host"
The IP Address of my btmon.py device is 192.168.35.36
The port I have btmon.py configured to listen on is port 5000
Remote IP: 192.168.35.36
URL: 192.168.35.36:5000 (I was surprised that this was needed, but without this, it never sends the data to btmon.py)
Remote Port: 5000


BTMON.py Configuration

I have btmon.py with this configuration

C:\btmon>type config.cfg
[source]
device_type = gem
ip_read = true
ip_host = 192.168.35.36
ip_port = 5000
ip_mode = server

Also make sure the firewall on the btmon.py box is set to allow incoming connections on port 5000.

To execute btmon.py with writing data to standard out use the command below.
C:\btmon>btmon.py -c config.cfg -p

Next Steps
Now that I (or you) have verified that GEM to btmon.py communication is working you can follow scyto post to send the data to a cloud or local database.

sycto's post can be found here:
http://www.brultech.com/community/viewt ... 359#p12359

Good Luck

Troubleshooting:
I had an issue where btmon.py stopped seeing new data. I exited btmon.py and restarted it and the issue was resolved.

I was getting all negative numbers for the channel Polarity so on the "Channel Option" page I changed "Disable Toggle Polarity" from no to yes. (But that did not fix the negative channels) - The fix to this (Thanks sycto) was to add the line below to the btmon.py -- config.cfg file:
reverse_polarity = 1


btmon.py sample results

Below is the results from btmon.py
C:\btmon>btmon.py -c config.cfg -p
2018/02/10 08:27:35 btmon: 3.1.1
2018/02/10 08:27:35 python: 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)]
2018/02/10 08:27:35 platform: win32
2018/02/10 08:27:35 device type: gem
2018/02/10 08:27:35 device list: ['']
2018/02/10 08:27:35 packet format: gem48ptbin
2018/02/10 08:27:35 schema: counters
2018/02/10 08:27:35 SOCKET: bind host: 192.168.35.36
2018/02/10 08:27:35 SOCKET: bind port: 5000

Every 30 seconds it displays this information:

2018/02/10 08:28:05: Serial: 01000917
2018/02/10 08:28:05: Voltage: 123.60V
2018/02/10 08:28:05: Ch01: -65046.835692KWh (-7387W)
2018/02/10 08:28:05: Ch02: -6057.390306KWh ( 0W)
2018/02/10 08:28:05: Ch03: -460.495540KWh ( 0W)
2018/02/10 08:28:05: Ch04: -983.944335KWh ( -19W)
2018/02/10 08:28:05: Ch05: -482.857521KWh ( 0W)
2018/02/10 08:28:05: Ch06: -5486.679547KWh ( -42W)
2018/02/10 08:28:05: Ch07: -19.525796KWh ( 0W)
2018/02/10 08:28:05: Ch08: -1790.976746KWh ( 0W)
2018/02/10 08:28:05: Ch09: -31.260984KWh ( -1W)
2018/02/10 08:28:05: Ch10: -5541.655859KWh ( -379W)
2018/02/10 08:28:05: Ch11: -36.976110KWh ( 0W)
2018/02/10 08:28:05: Ch12: -2216.728150KWh ( -4W)
2018/02/10 08:28:05: Ch13: -1436.114948KWh ( 0W)
2018/02/10 08:28:05: Ch14: -2496.758364KWh ( -20W)
2018/02/10 08:28:05: Ch15: -395.123694KWh ( 0W)
2018/02/10 08:28:05: Ch16: -1149.980178KWh ( 0W)
2018/02/10 08:28:05: Ch17: -525.144111KWh ( 0W)
2018/02/10 08:28:05: Ch18: -922.814146KWh ( -5W)
2018/02/10 08:28:05: Ch19: -1639.873260KWh ( -12W)
2018/02/10 08:28:05: Ch20: -3018.462046KWh ( 0W)
2018/02/10 08:28:05: Ch21: -17811.715090KWh (-2231W)
2018/02/10 08:28:05: Ch22: -0.188743KWh ( 0W)
2018/02/10 08:28:05: Ch23: -0.283224KWh ( 0W)
2018/02/10 08:28:05: Ch24: -0.117406KWh ( 0W)
2018/02/10 08:28:05: Ch25: -0.418408KWh ( 0W)
2018/02/10 08:28:05: Ch26: -0.068954KWh ( 0W)
2018/02/10 08:28:05: Ch27: -0.351004KWh ( 0W)
2018/02/10 08:28:05: Ch28: -0.181398KWh ( 0W)
2018/02/10 08:28:05: Ch29: -0.416786KWh ( 0W)
2018/02/10 08:28:05: Ch30: -0.058344KWh ( 0W)
2018/02/10 08:28:05: Ch31: -0.332247KWh ( 0W)
2018/02/10 08:28:05: Ch32: -0.207438KWh ( 0W)
2018/02/10 08:28:05: p1: 1
2018/02/10 08:28:05: p2: 1
2018/02/10 08:28:05: p3: 1
2018/02/10 08:28:05: p4: 1
2018/02/10 08:28:05: t1: 0.000000
2018/02/10 08:28:05: t2: 0.000000
2018/02/10 08:28:05: t3: 0.000000
2018/02/10 08:28:05: t4: 0.000000
2018/02/10 08:28:05: t5: 0.000000
2018/02/10 08:28:05: t6: 0.000000
2018/02/10 08:28:05: t7: 0.000000
2018/02/10 08:28:05: t8: 0.000000
ben
Site Admin
Posts: 4262
Joined: Fri Jun 04, 2010 9:39 am

Re: Configuration of GEM and btmon.py for success

Post by ben » Mon Feb 12, 2018 11:59 am

Carl wrote: I was getting all negative numbers for the channel Polarity so on the "Channel Option" page I changed "Disable Toggle Polarity" from no to yes. (But that did not fix the negative channels) - The fix to this (Thanks sycto) was to add the line below to the btmon.py -- config.cfg file:
reverse_polarity = 1
Switching the direction of the GEM PT may also reverse the polarity. Just something to keep in mind when installing.
Ben
Brultech Research Inc.
E: ben(at)brultech.com
Post Reply