GEM + BTMON + Ethernet - data stops transmitting after 2 packets

Post any 3rd party software here.
Post Reply
MrEmbedded
Posts: 17
Joined: Thu Nov 14, 2013 9:38 am

GEM + BTMON + Ethernet - data stops transmitting after 2 packets

Post by MrEmbedded » Tue Nov 16, 2021 11:16 am

Hi All,

I am not understanding what my issue is. I can't seem to get BTMON to work reliably. In either client or server mode it will hang on the 2nd packet. This an older unit. The actual channel data is coming for those 2 packets as I see it being ingested (using VictoriaMetrics) but I am trying to debug just the source bits. I have tried a bunch of things with Idle Time, Real Time vs Polling, Packet Send Intervals, etc. Live data seems to work in both the integrated web page and the GEM Network utilities app (running via wine).

If anyone has suggestions I am all ears. Right now this isn't usable. I have had this setup for many years but stopped using it and decided to re-activate it again and ran into these hiccups.

GEM configuration

Code: Select all

COM firmware ver: 5.13
ENG firmware ver: 1.49
RealTime Status: ON
Packet Send Interval: 8
Pri. Packet Format: 4
Sec. Packet Format: 0
Sys Status: OK	
Wifi/Ethernet Module: Enabled
GEM Ver: Single or Polyphase
PCB Ver: 2
BootLoader Ver: 1
COM1 Flow: OFF
COM2 Flow: OFF
Current Constant: 222
Sys Info: 00100001 OK
Sys Flags: 00000000 OK	
Keep Alive String:""
COM1 Baud: 115200
COM2 Baud: 115200
Phase Setting: Single Phase
Freq: 60Hz
Hardware Configuration: 136

    Ethernet with connector board

BTMON config as server

Code: Select all

$ cat btmon.cfg 
[source]
ip_read = true
device_type = gem
ip_port = 7000
ip_mode = server
include_current = true
reverse_polarity = true
db_schema = ecmreadext
packet_format = gem48ptbin

BTMON output as server

Code: Select all

$ python btmon.py -c btmon.cfg --debug --verbose --skip-upload
2021/11/16 15:40:25 btmon: 3.3.1
2021/11/16 15:40:25 python: 2.7.18 (default, Mar  8 2021, 13:02:45) 
[GCC 9.3.0]
2021/11/16 15:40:25 platform: linux2
2021/11/16 15:40:25 polarity is reversed
2021/11/16 15:40:25 device type: gem
2021/11/16 15:40:25 device list: ['']
2021/11/16 15:40:25 packet format: gem48ptbin
2021/11/16 15:40:25 schema: ecmreadext
2021/11/16 15:40:25 buffer size: 120
2021/11/16 15:40:25 SOCKET: bind host: 
2021/11/16 15:40:25 SOCKET: bind port: 7000
2021/11/16 15:40:25 InfluxDB: upload period: 10
2021/11/16 15:40:25 InfluxDB: host: 127.0.0.1
2021/11/16 15:40:25 InfluxDB: port: 8089
2021/11/16 15:40:25 InfluxDB: username: 
2021/11/16 15:40:25 InfluxDB: map: 
2021/11/16 15:40:25 InfluxDB: schema: ecmreadext
2021/11/16 15:40:25 packet format is GEM48PTBinaryPacket
2021/11/16 15:40:25 using collector SocketServerCollector
2021/11/16 15:40:25 using 1 processors:
2021/11/16 15:40:25   InfluxDBProcessor
2021/11/16 15:40:25 setup SocketServerCollector
2021/11/16 15:40:25 SOCKET: binding to :7000
2021/11/16 15:40:25 setup InfluxDBProcessor
2021/11/16 15:40:25 SOCKET: waiting for connection
2021/11/16 15:40:32 waiting for data from device
2021/11/16 15:40:32 reading 1 of 1 packets
2021/11/16 15:40:32 SOCKET: read 1 of 1 bytes from socket: fe
2021/11/16 15:40:32 SOCKET: read 1 of 1 bytes from socket: ff
2021/11/16 15:40:32 SOCKET: read 1 of 1 bytes from socket: 05
2021/11/16 15:40:32 SOCKET: read 14 of 619 bytes from socket: 04 b5 61 c5 99 06 00 11 ab 0c 00 00 00 00
2021/11/16 15:40:32 SOCKET: read 605 of 605 bytes from socket: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 68 00 00 00 00 15 1e 04 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 00 17 00 00 00 00 76 78 00 00 00 e2 23 08 00 00 00 00 00 00 00 db 01 01 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 bb 84 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 96 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d9 04 00 00 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 0f 0e 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 01 39 00 0a 46 06 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 04 00 04 00 04 00 0e 02 00 00 00 00 04 00 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5a 00 80 74 04 00 0b 01 80 d7 00 00 00 61 47 04 1e 00 00 05 00 00 6c b3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 15 0b 0f 16 08 1f
2021/11/16 15:40:32 SOCKET: read 1 of 1 bytes from socket: ff
2021/11/16 15:40:32 SOCKET: read 1 of 1 bytes from socket: fe
2021/11/16 15:40:32 SOCKET: read 1 of 1 bytes from socket: fa
2021/11/16 15:40:32 adding buffer for 01000313
2021/11/16 15:40:32 buffering packet ts:1637077232 sn:01000313
2021/11/16 15:40:32 SOCKET: closing connection
2021/11/16 15:40:32 buffer info:
2021/11/16 15:40:32   01000313:   1 of 120 (1637077232)
2021/11/16 15:40:32 processing with InfluxDBProcessor
2021/11/16 15:40:32 not enough data for 01000313
2021/11/16 15:40:32 SOCKET: waiting for connection
2021/11/16 15:40:40 waiting for data from device
2021/11/16 15:40:40 reading 1 of 1 packets
2021/11/16 15:40:40 SOCKET: read 1 of 1 bytes from socket: fe
2021/11/16 15:40:40 SOCKET: read 1 of 1 bytes from socket: ff
2021/11/16 15:40:40 SOCKET: read 1 of 1 bytes from socket: 05
2021/11/16 15:40:40 SOCKET: read 619 of 619 bytes from socket: 04 bd b7 25 9a 06 00 11 ab 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 68 00 00 00 00 15 1e 04 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 00 17 00 00 00 00 7a 78 00 00 00 46 37 08 00 00 00 00 00 00 00 e5 01 01 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 cc 84 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 a4 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 0f 0e 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 01 39 00 0a 3b 04 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 04 00 04 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5a 00 80 74 04 00 0b 01 80 d7 00 00 00 20 d4 02 91 01 00 12 00 00 74 b3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 15 0b 0f 16 08 27
2021/11/16 15:40:40 SOCKET: read 1 of 1 bytes from socket: ff
2021/11/16 15:40:40 SOCKET: read 1 of 1 bytes from socket: fe
2021/11/16 15:40:40 SOCKET: read 1 of 1 bytes from socket: 39
2021/11/16 15:40:40 buffering packet ts:1637077240 sn:01000313
2021/11/16 15:40:40 SOCKET: closing connection
2021/11/16 15:40:40 buffer info:
2021/11/16 15:40:40   01000313:   2 of 120 (1637077240)
2021/11/16 15:40:40 processing with InfluxDBProcessor
2021/11/16 15:40:40 2 buffered packets sn:01000313
2021/11/16 15:40:40 1 calculated packets sn:01000313
^C
^C2021/11/16 15:51:10 cleanup InfluxDBProcessor
2021/11/16 15:51:10 cleanup SocketServerCollector
2021/11/16 15:51:10 SOCKET: closing socket


BTMON config as client

Code: Select all

$ cat btmon.cfg 
[source]
ip_read = true
device_type = gem
ip_host = 192.168.2.6
ip_port = 80
ip_mode = client
include_current = true
reverse_polarity = true
db_schema = ecmreadext
packet_format = gem48ptbin
BTMON output as client

Code: Select all

$ python btmon.py -c btmon.cfg --debug --verbose --skip-upload
2021/11/16 16:04:17 btmon: 3.3.1
2021/11/16 16:04:17 python: 2.7.18 (default, Mar  8 2021, 13:02:45) 
[GCC 9.3.0]
2021/11/16 16:04:17 platform: linux2
2021/11/16 16:04:17 polarity is reversed
2021/11/16 16:04:17 device type: gem
2021/11/16 16:04:17 device list: ['']
2021/11/16 16:04:17 packet format: gem48ptbin
2021/11/16 16:04:17 schema: ecmreadext
2021/11/16 16:04:17 buffer size: 120
2021/11/16 16:04:17 SOCKET: timeout: 60
2021/11/16 16:04:17 SOCKET: server host: 192.168.2.6
2021/11/16 16:04:17 SOCKET: server port: 80
2021/11/16 16:04:17 InfluxDB: upload period: 10
2021/11/16 16:04:17 InfluxDB: host: 127.0.0.1
2021/11/16 16:04:17 InfluxDB: port: 8089
2021/11/16 16:04:17 InfluxDB: username: 
2021/11/16 16:04:17 InfluxDB: map: 
2021/11/16 16:04:17 InfluxDB: schema: ecmreadext
2021/11/16 16:04:17 packet format is GEM48PTBinaryPacket
2021/11/16 16:04:17 using collector BlockingSocketClientCollector
2021/11/16 16:04:17 using 1 processors:
2021/11/16 16:04:17   InfluxDBProcessor
2021/11/16 16:04:17 setup BlockingSocketClientCollector
2021/11/16 16:04:17 setup InfluxDBProcessor
2021/11/16 16:04:17 waiting for data from device
2021/11/16 16:04:17 opening socket connection to 192.168.2.6:80
2021/11/16 16:04:17 reading 1 of 1 packets
2021/11/16 16:04:22 adding buffer for 01000313
2021/11/16 16:04:22 buffering packet ts:1637078662 sn:01000313
2021/11/16 16:04:22 buffer info:
2021/11/16 16:04:22   01000313:   1 of 120 (1637078662)
2021/11/16 16:04:22 processing with InfluxDBProcessor
2021/11/16 16:04:22 not enough data for 01000313
2021/11/16 16:04:22 waiting for data from device
2021/11/16 16:04:22 reading 1 of 1 packets
2021/11/16 16:04:30 buffering packet ts:1637078670 sn:01000313
2021/11/16 16:04:30 buffer info:
2021/11/16 16:04:30   01000313:   2 of 120 (1637078670)
2021/11/16 16:04:30 processing with InfluxDBProcessor
2021/11/16 16:04:30 2 buffered packets sn:01000313
2021/11/16 16:04:30 1 calculated packets sn:01000313
^C^C2021/11/16 16:05:59 cleanup InfluxDBProcessor
2021/11/16 16:05:59 cleanup BlockingSocketClientCollector

MrEmbedded
Posts: 17
Joined: Thu Nov 14, 2013 9:38 am

Re: GEM + BTMON + Ethernet - data stops transmitting after 2 packets

Post by MrEmbedded » Tue Nov 16, 2021 11:54 am

Something else I have noticed is I am able to run a telnet test to the IP plus port of the GEM that is set in the TCP client fields of the GEM Network Utility. However it isn't possible to telnet to the TCP server port when set.
MrEmbedded
Posts: 17
Joined: Thu Nov 14, 2013 9:38 am

Re: GEM + BTMON + Ethernet - data stops transmitting after 2 packets

Post by MrEmbedded » Tue Nov 16, 2021 1:34 pm

Ok I'm getting somewhere!

- Running btmon in client mode pointing to port 80
- Removed the influx output from the cfg to test
- Tested with --print

So the issue is actually the influx output part. Ill need to review this further.

Code: Select all

$ python btmon.py -c btmon.cfg --debug --verbose --skip-upload  --print
2021/11/16 18:28:54 btmon: 3.3.1
2021/11/16 18:28:54 python: 2.7.18 (default, Mar  8 2021, 13:02:45) 
[GCC 9.3.0]
2021/11/16 18:28:54 platform: linux2
2021/11/16 18:28:54 polarity is reversed
2021/11/16 18:28:54 device type: gem
2021/11/16 18:28:54 device list: ['']
2021/11/16 18:28:54 packet format: gem48ptbin
2021/11/16 18:28:54 schema: ecmreadext
2021/11/16 18:28:54 buffer size: 120
2021/11/16 18:28:54 SOCKET: timeout: 60
2021/11/16 18:28:54 SOCKET: server host: 192.168.2.6
2021/11/16 18:28:54 SOCKET: server port: 80
2021/11/16 18:28:54 packet format is GEM48PTBinaryPacket
2021/11/16 18:28:54 using collector BlockingSocketClientCollector
2021/11/16 18:28:54 using 1 processors:
2021/11/16 18:28:54   PrintProcessor
2021/11/16 18:28:54 setup BlockingSocketClientCollector
2021/11/16 18:28:54 setup PrintProcessor
2021/11/16 18:28:54 waiting for data from device
2021/11/16 18:28:54 opening socket connection to 192.168.2.6:80
2021/11/16 18:28:54 reading 1 of 1 packets
2021/11/16 18:28:56 adding buffer for 01000313
2021/11/16 18:28:56 buffering packet ts:1637087336 sn:01000313
2021/11/16 18:28:56 buffer info:
2021/11/16 18:28:56   01000313:   1 of 120 (1637087336)
2021/11/16 18:28:56 processing with PrintProcessor
2021/11/16 18:28:56 not enough data for 01000313
2021/11/16 18:28:56 waiting for data from device
2021/11/16 18:28:56 reading 1 of 1 packets
2021/11/16 18:29:00 buffering packet ts:1637087340 sn:01000313
2021/11/16 18:29:00 buffer info:
2021/11/16 18:29:00   01000313:   2 of 120 (1637087340)
2021/11/16 18:29:00 processing with PrintProcessor
2021/11/16 18:29:00 2 buffered packets sn:01000313
2021/11/16 18:29:00 1 calculated packets sn:01000313

2021/11/16 18:29:00: Serial: 01000313
2021/11/16 18:29:00: Voltage:  121.00V
2021/11/16 18:29:00: Ch01:     36.557181KWh ( 2138W) (  19.10A)
2021/11/16 18:29:00: Ch02:      0.230743KWh (    0W) (   0.12A)
2021/11/16 18:29:00: Ch03:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch04:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch05:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch06:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch07:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch08:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch09:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch10:      0.000036KWh (    0W) (   0.12A)
2021/11/16 18:29:00: Ch11:      0.074957KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch12:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch13:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch14:      0.000002KWh (    0W) (   0.08A)
2021/11/16 18:29:00: Ch15:      0.000009KWh (    0W) (   0.08A)
2021/11/16 18:29:00: Ch16:      0.010422KWh (    0W) (   0.08A)
2021/11/16 18:29:00: Ch17:      0.290714KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch18:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch19:      0.022366KWh (    1W) (   0.00A)
2021/11/16 18:29:00: Ch20:      0.000002KWh (    0W) (   0.08A)
2021/11/16 18:29:00: Ch21:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch22:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch23:      0.033563KWh (    2W) (   0.08A)
2021/11/16 18:29:00: Ch24:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch25:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch26:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch27:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch28:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch29:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch30:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch31:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: Ch32:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:00: p1:               0
2021/11/16 18:29:00: p2:               0
2021/11/16 18:29:00: p3:               0
2021/11/16 18:29:00: p4:               0
2021/11/16 18:29:00: t1:        0.000000
2021/11/16 18:29:00: t2:        0.000000
2021/11/16 18:29:00: t3:        0.000000
2021/11/16 18:29:00: t4:        1.000000
2021/11/16 18:29:00: t5:        0.000000
2021/11/16 18:29:00: t6:        0.000000
2021/11/16 18:29:00: t7:        0.000000
2021/11/16 18:29:00: t8:        0.000000
2021/11/16 18:29:00 waiting for data from device
2021/11/16 18:29:00 reading 1 of 1 packets
2021/11/16 18:29:04 buffering packet ts:1637087344 sn:01000313
2021/11/16 18:29:04 buffer info:
2021/11/16 18:29:04   01000313:   3 of 120 (1637087344)
2021/11/16 18:29:04 processing with PrintProcessor
2021/11/16 18:29:04 2 buffered packets sn:01000313
2021/11/16 18:29:04 1 calculated packets sn:01000313

2021/11/16 18:29:04: Serial: 01000313
2021/11/16 18:29:04: Voltage:  120.80V
2021/11/16 18:29:04: Ch01:     36.559577KWh ( 2156W) (  19.26A)
2021/11/16 18:29:04: Ch02:      0.230743KWh (    0W) (   0.12A)
2021/11/16 18:29:04: Ch03:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch04:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch05:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch06:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch07:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch08:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch09:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch10:      0.000036KWh (    0W) (   0.10A)
2021/11/16 18:29:04: Ch11:      0.074957KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch12:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch13:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch14:      0.000002KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch15:      0.000009KWh (    0W) (   0.08A)
2021/11/16 18:29:04: Ch16:      0.010422KWh (    0W) (   0.08A)
2021/11/16 18:29:04: Ch17:      0.290714KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch18:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch19:      0.022368KWh (    1W) (   0.00A)
2021/11/16 18:29:04: Ch20:      0.000002KWh (    0W) (   0.08A)
2021/11/16 18:29:04: Ch21:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch22:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch23:      0.033566KWh (    2W) (   0.08A)
2021/11/16 18:29:04: Ch24:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch25:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch26:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch27:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch28:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch29:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch30:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch31:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: Ch32:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:04: p1:               0
2021/11/16 18:29:04: p2:               0
2021/11/16 18:29:04: p3:               0
2021/11/16 18:29:04: p4:               0
2021/11/16 18:29:04: t1:        0.000000
2021/11/16 18:29:04: t2:        0.000000
2021/11/16 18:29:04: t3:        0.000000
2021/11/16 18:29:04: t4:        1.000000
2021/11/16 18:29:04: t5:        0.000000
2021/11/16 18:29:04: t6:        0.000000
2021/11/16 18:29:04: t7:        0.000000
2021/11/16 18:29:04: t8:        0.000000
2021/11/16 18:29:04 waiting for data from device
2021/11/16 18:29:04 reading 1 of 1 packets
2021/11/16 18:29:08 buffering packet ts:1637087348 sn:01000313
2021/11/16 18:29:08 buffer info:
2021/11/16 18:29:08   01000313:   4 of 120 (1637087348)
2021/11/16 18:29:08 processing with PrintProcessor
2021/11/16 18:29:08 2 buffered packets sn:01000313
2021/11/16 18:29:08 1 calculated packets sn:01000313

2021/11/16 18:29:08: Serial: 01000313
2021/11/16 18:29:08: Voltage:  120.80V
2021/11/16 18:29:08: Ch01:     36.561972KWh ( 2155W) (  19.34A)
2021/11/16 18:29:08: Ch02:      0.230743KWh (    0W) (   0.10A)
2021/11/16 18:29:08: Ch03:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch04:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch05:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch06:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch07:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch08:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch09:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch10:      0.000036KWh (    0W) (   0.12A)
2021/11/16 18:29:08: Ch11:      0.074957KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch12:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch13:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch14:      0.000002KWh (    0W) (   0.08A)
2021/11/16 18:29:08: Ch15:      0.000009KWh (    0W) (   0.08A)
2021/11/16 18:29:08: Ch16:      0.010422KWh (    0W) (   0.08A)
2021/11/16 18:29:08: Ch17:      0.290714KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch18:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch19:      0.022370KWh (    1W) (   0.00A)
2021/11/16 18:29:08: Ch20:      0.000002KWh (    0W) (   0.08A)
2021/11/16 18:29:08: Ch21:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch22:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch23:      0.033568KWh (    2W) (   0.08A)
2021/11/16 18:29:08: Ch24:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch25:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch26:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch27:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch28:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch29:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch30:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch31:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: Ch32:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:08: p1:               0
2021/11/16 18:29:08: p2:               0
2021/11/16 18:29:08: p3:               0
2021/11/16 18:29:08: p4:               0
2021/11/16 18:29:08: t1:        0.000000
2021/11/16 18:29:08: t2:        0.000000
2021/11/16 18:29:08: t3:        0.000000
2021/11/16 18:29:08: t4:        1.000000
2021/11/16 18:29:08: t5:        0.000000
2021/11/16 18:29:08: t6:        0.000000
2021/11/16 18:29:08: t7:        0.000000
2021/11/16 18:29:08: t8:        0.000000
2021/11/16 18:29:08 waiting for data from device
2021/11/16 18:29:08 reading 1 of 1 packets
2021/11/16 18:29:12 buffering packet ts:1637087352 sn:01000313
2021/11/16 18:29:12 buffer info:
2021/11/16 18:29:12   01000313:   5 of 120 (1637087352)
2021/11/16 18:29:12 processing with PrintProcessor
2021/11/16 18:29:12 2 buffered packets sn:01000313
2021/11/16 18:29:12 1 calculated packets sn:01000313

2021/11/16 18:29:12: Serial: 01000313
2021/11/16 18:29:12: Voltage:  121.10V
2021/11/16 18:29:12: Ch01:     36.564388KWh ( 2175W) (  19.50A)
2021/11/16 18:29:12: Ch02:      0.230743KWh (    0W) (   0.12A)
2021/11/16 18:29:12: Ch03:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch04:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch05:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch06:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch07:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch08:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch09:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch10:      0.000036KWh (    0W) (   0.12A)
2021/11/16 18:29:12: Ch11:      0.074957KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch12:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch13:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch14:      0.000002KWh (    0W) (   0.08A)
2021/11/16 18:29:12: Ch15:      0.000009KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch16:      0.010424KWh (    1W) (   0.08A)
2021/11/16 18:29:12: Ch17:      0.290714KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch18:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch19:      0.022371KWh (    1W) (   0.00A)
2021/11/16 18:29:12: Ch20:      0.000002KWh (    0W) (   0.08A)
2021/11/16 18:29:12: Ch21:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch22:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch23:      0.033571KWh (    2W) (   0.08A)
2021/11/16 18:29:12: Ch24:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch25:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch26:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch27:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch28:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch29:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch30:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch31:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: Ch32:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:12: p1:               0
2021/11/16 18:29:12: p2:               0
2021/11/16 18:29:12: p3:               0
2021/11/16 18:29:12: p4:               0
2021/11/16 18:29:12: t1:        0.000000
2021/11/16 18:29:12: t2:        0.000000
2021/11/16 18:29:12: t3:        0.000000
2021/11/16 18:29:12: t4:        1.000000
2021/11/16 18:29:12: t5:        0.000000
2021/11/16 18:29:12: t6:        0.000000
2021/11/16 18:29:12: t7:        0.000000
2021/11/16 18:29:12: t8:        0.000000
2021/11/16 18:29:12 waiting for data from device
2021/11/16 18:29:12 reading 1 of 1 packets
2021/11/16 18:29:16 buffering packet ts:1637087356 sn:01000313
2021/11/16 18:29:16 buffer info:
2021/11/16 18:29:16   01000313:   6 of 120 (1637087356)
2021/11/16 18:29:16 processing with PrintProcessor
2021/11/16 18:29:16 2 buffered packets sn:01000313
2021/11/16 18:29:16 1 calculated packets sn:01000313

2021/11/16 18:29:16: Serial: 01000313
2021/11/16 18:29:16: Voltage:  121.40V
2021/11/16 18:29:16: Ch01:     36.566791KWh ( 2162W) (  19.14A)
2021/11/16 18:29:16: Ch02:      0.230743KWh (    0W) (   0.14A)
2021/11/16 18:29:16: Ch03:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch04:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch05:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch06:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch07:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch08:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch09:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch10:      0.000036KWh (    0W) (   0.10A)
2021/11/16 18:29:16: Ch11:      0.074957KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch12:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch13:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch14:      0.000002KWh (    0W) (   0.08A)
2021/11/16 18:29:16: Ch15:      0.000009KWh (    0W) (   0.08A)
2021/11/16 18:29:16: Ch16:      0.010424KWh (    0W) (   0.08A)
2021/11/16 18:29:16: Ch17:      0.290714KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch18:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch19:      0.022373KWh (    1W) (   0.08A)
2021/11/16 18:29:16: Ch20:      0.000002KWh (    0W) (   0.08A)
2021/11/16 18:29:16: Ch21:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch22:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch23:      0.033573KWh (    2W) (   0.08A)
2021/11/16 18:29:16: Ch24:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch25:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch26:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch27:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch28:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch29:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch30:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch31:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: Ch32:      0.000000KWh (    0W) (   0.00A)
2021/11/16 18:29:16: p1:               0
2021/11/16 18:29:16: p2:               0
2021/11/16 18:29:16: p3:               0
2021/11/16 18:29:16: p4:               0
2021/11/16 18:29:16: t1:        0.000000
2021/11/16 18:29:16: t2:        0.000000
2021/11/16 18:29:16: t3:        0.000000
2021/11/16 18:29:16: t4:        1.000000
2021/11/16 18:29:16: t5:        0.000000
2021/11/16 18:29:16: t6:        0.000000
2021/11/16 18:29:16: t7:        0.000000
2021/11/16 18:29:16: t8:        0.000000
2021/11/16 18:29:16 waiting for data from device
2021/11/16 18:29:16 reading 1 of 1 packets

MrEmbedded
Posts: 17
Joined: Thu Nov 14, 2013 9:38 am

Re: GEM + BTMON + Ethernet - data stops transmitting after 2 packets

Post by MrEmbedded » Tue Nov 16, 2021 3:06 pm

All solved. Issue ended up being stupid with Influx ports being incorrect. The default docker install just works: https://github.com/VictoriaMetrics/VictoriaMetrics. The moral of the story is to make sure and remove the destination when troubleshooting BTMON and also ensure that you use --print and --debug to assist.


2021-11-16_15-03.png
2021-11-16_15-03.png (114.64 KiB) Viewed 11278 times
ben
Site Admin
Posts: 4262
Joined: Fri Jun 04, 2010 9:39 am

Re: GEM + BTMON + Ethernet - data stops transmitting after 2 packets

Post by ben » Wed Nov 17, 2021 10:36 am

MrEmbedded wrote:
Tue Nov 16, 2021 3:06 pm
All solved. Issue ended up being stupid with Influx ports being incorrect. The default docker install just works: https://github.com/VictoriaMetrics/VictoriaMetrics. The moral of the story is to make sure and remove the destination when troubleshooting BTMON and also ensure that you use --print and --debug to assist.
Good to hear you got it installed. There's also a bunch of different forks of btmon.py with different integrations (python 3, influxdb, influxdb2, etc).
Ben
Brultech Research Inc.
E: ben(at)brultech.com
MrEmbedded
Posts: 17
Joined: Thu Nov 14, 2013 9:38 am

Re: GEM + BTMON + Ethernet - data stops transmitting after 2 packets

Post by MrEmbedded » Thu Nov 18, 2021 11:02 am

I am working on better defining the tagging for the data and will post the configuration when done as well as some dynamic Grafana dashboards to go with it.
MrEmbedded
Posts: 17
Joined: Thu Nov 14, 2013 9:38 am

Re: GEM + BTMON + Ethernet - data stops transmitting after 2 packets

Post by MrEmbedded » Sat Nov 20, 2021 1:08 pm

I have some updates. I decided to change the influxdb_mode = col in btmon.cfg and shipped things to a fresh database (changed the influxdb_database value) and wanted to share some detail about this.

First off note how you can cleanly see the detail in columns when you examine it in Grafana. I had to change the circled values to a table view to see it that way. This is what you need to see to query it properly. The Metrics browser query is simple PromQL based language which is not difficult to learn if you have been operating in this space. That query basically takes all values from the database that have an id like '_w' to get all the watt related values but also ignores channel 1 which is the mains in my case. The name energy_value is coming from the influxdb_measurement value
2021-11-20_12-52.png
2021-11-20_12-52.png (136.63 KiB) Viewed 11263 times
The resulting graph is shown below. You can see how the channels are named when columns are used.
2021-11-20_12-53.png
2021-11-20_12-53.png (60.5 KiB) Viewed 11263 times
To change those channel names to something more meaningful you can edit the graph and use overrides in the manner shown
2021-11-20_13-01.png
2021-11-20_13-01.png (47.32 KiB) Viewed 11263 times
Ultimately BTMON needs some more work to be able to do this at the time of ingestion but it does work in use cases where you only need to set it up once and then it will stay the same after vs something where the channels are dynamically populated.


Hope someone finds this useful. If I have the time/ability to improve btmon I will report back.
Post Reply