jlama / powertagd

15 stars 7 forks source link

Powertag invert not working #12

Open Sany-IO opened 1 year ago

Sany-IO commented 1 year ago

Hello,

i tested your update, i uploaded the new firmware to the sonoff stick. [INFO] ash: connected to NCP [INFO] ezsp: EZSPv9, stack type 2 (mesh), version 7.1.3.0 [INFO] ezsp: xNCP manufacturer: 0xbaba, version: 0x1000 [INFO] ezsp: registering gateway endpoint [INFO] ezsp: registering Green Power endpoint [INFO] ezsp: initializing network... [INFO] ezsp: stack state changed to EMBER_NETWORK_UP [INFO] ezsp: network joined as coordinator node on channel 12 (PAN: 0xb24b, TX power: 0 dBm) [INFO] PowerTag 0xe201b4d1: changing flow direction to downstream pi@ubuntu:~/powertagd-master/src$ ./powertagd -d /dev/ttyACM0

it does not change the direction:

powertag,id=0xe201b4d1 power_factor=**-68**,energy_received=17115.28,0x4013=704000,energy_p1_rx=9925.86,0x410f=413499,energy_p2_rx=3627.00,0x420f=145711,energy_p3_rx=3562.41,0x430f=144790 1676805823 powertag,id=0xe201b4d1 **voltage_p1=225.60,voltage_p2=224.50,voltage_p3=222.50,voltage_phase_ab=389.60,voltage_phase_bc=388.20,voltage_phase_ac=387.20,current_p1=1.14,current_p2=0.22,current_p3=1.84,total_power_active=**-472**,power_p1_active=-128,power_p2_active=**-16**,power_p3_active=-327,total_power_apparent=718,** 1676805828

on all values are a minus... ?

jlama commented 1 year ago

Can you rerun the invert-flow command and try again?

Sany-IO commented 1 year ago

Yes, after 3 times it comes:

[INFO] ash: connected to NCP
[INFO] ezsp: EZSPv9, stack type 2 (mesh), version 7.1.3.0
[INFO] ezsp: xNCP manufacturer: 0xbaba, version: 0x1000
[INFO] ezsp: registering gateway endpoint
[INFO] ezsp: registering Green Power endpoint
[INFO] ezsp: initializing network...
[INFO] ezsp: stack state changed to EMBER_NETWORK_UP
[INFO] ezsp: network joined as coordinator node on channel 12 (PAN: 0xb24b, TX power: 0 dBm)
[INFO] PowerTag 0xe201b4d1: changing flow direction to downstream

pi@ubuntu:~/powertagd-master/src$ ./powertagctl -d /dev/ttyACM0 invert-flow 0xe201b4d1
[INFO] tty: opening '/dev/ttyACM0' at 115200 bauds
[INFO] ash: connected to NCP
[INFO] ezsp: EZSPv9, stack type 2 (mesh), version 7.1.3.0
[INFO] ezsp: xNCP manufacturer: 0xbaba, version: 0x1000
[INFO] ezsp: registering gateway endpoint
[INFO] ezsp: registering Green Power endpoint
[INFO] ezsp: initializing network...
[INFO] ezsp: stack state changed to EMBER_NETWORK_UP
[INFO] ezsp: network joined as coordinator node on channel 12 (PAN: 0xb24b, TX power: 0 dBm)
[ ERR] Could not find PowerTag 0xe201b4d1. Is it on and commissioned?

pi@ubuntu:~/powertagd-master/src$ ./powertagctl -d /dev/ttyACM0 invert-flow 0xe201b4d1
[INFO] ash: connected to NCP
[INFO] ezsp: EZSPv9, stack type 2 (mesh), version 7.1.3.0
[INFO] ezsp: xNCP manufacturer: 0xbaba, version: 0x1000
[INFO] ezsp: registering gateway endpoint
[INFO] ezsp: registering Green Power endpoint
[INFO] ezsp: initializing network...
[INFO] ezsp: stack state changed to EMBER_NETWORK_UP
[INFO] ezsp: network joined as coordinator node on channel 12 (PAN: 0xb24b, TX power: 0 dBm)
[ ERR] Could not find PowerTag 0xe201b4d1. Is it on and commissioned?

pi@ubuntu:~/powertagd-master/src$ ./powertagd -d /dev/ttyACM0 invert-flow 0xe201b4d1
[INFO] tty: opening '/dev/ttyACM0' at 115200 bauds
[INFO] ash: connected to NCP
[INFO] ezsp: EZSPv9, stack type 2 (mesh), version 7.1.3.0
[INFO] ezsp: xNCP manufacturer: 0xbaba, version: 0x1000
[INFO] ezsp: registering gateway endpoint
[INFO] ezsp: registering Green Power endpoint
[INFO] ezsp: initializing network...
[INFO] ezsp: stack state changed to EMBER_NETWORK_UP
[INFO] ezsp: network joined as coordinator node on channel 12 (PAN: 0xb24b, TX power: 0 dBm)
powertag,id=0xe201b4d1 voltage_p1=225.20,voltage_p2=224.60,voltage_p3=224.40,voltage_phase_ab=389.90,voltage_phase_bc=388.60,voltage_phase_ac=389.20,current_p1=2.14,current_p2=0.38,current_p3=1.51,total_power_active=-811,power_p1_active=-438,power_p2_active=-64,power_p3_active=-308,total_power_apparent=912, 1676812169

pi@ubuntu:~/powertagd-master/src$ ./powertagctl -d /dev/ttyACM0 invert-flow 0xe201b4d1
[INFO] tty: opening '/dev/ttyACM0' at 115200 bauds
[ ERR] ash: got corrupted frame: (expected CRC: 0x1c1e, got: 0x1953)
[ ERR] ash:   [ FD FD 61 1C 8B 35 2D 37 14 8C 5A CC A9 C1 4C 7C ]
[ ERR] ash:   [ 35 0F 6D C5 CD 35 88 F4 56 71 73 67 41 58 53 36 ]
[ ERR] ash:   [ DA 35 11 08 53 76 C2 4B 65 94 5D BC 08 43 35 76 ]
[ ERR] ash:   [ BD B1 AD 64 2A D1 18 D3 49 CA 86 D2 E6 A1 B4 6C ]
[ ERR] ash:   [ 8B 34 D1 78 CF E5 E7 14 92 EB B9 19 53 ]1 B4 6C ]
[WARN] ash: unexpected non-RSTACK frame after reset, aborting
[ ERR] ash: got corrupted frame: (expected CRC: 0x7e0a, got: 0xf674)
[ ERR] ash:   [ 46 7F B1 A9 91 2A 6A 63 47 32 8C DE D4 DB 2C D7 ]
[ ERR] ash:   [ 73 F6 74 ]9 91 2A 6A 63 47 32 8C DE D4 DB 2C D7 ]
[WARN] ash: unexpected non-RSTACK frame after reset, aborting
[INFO] ash: connected to NCP
[INFO] ezsp: EZSPv9, stack type 2 (mesh), version 7.1.3.0
[INFO] ezsp: xNCP manufacturer: 0xbaba, version: 0x1000
[INFO] ezsp: registering gateway endpoint
[INFO] ezsp: registering Green Power endpoint
[INFO] ezsp: initializing network...
[INFO] ezsp: stack state changed to EMBER_NETWORK_UP
[INFO] ezsp: network joined as coordinator node on channel 12 (PAN: 0xb24b, TX power: 0 dBm)
[INFO] PowerTag 0xe201b4d1: changing flow direction to downstream

pi@ubuntu:~/powertagd-master/src$ ./powertagctl -d /dev/ttyACM0 invert-flow 0xe201b4d1
[INFO] tty: opening '/dev/ttyACM0' at 115200 bauds
[ ERR] ash: got corrupted frame: (expected CRC: 0x8df8, got: 0xf58b)
[ ERR] ash:   [ 03 BC EC A6 05 37 FC B2 31 78 FD F5 8B ]
[WARN] ash: unexpected non-RSTACK frame after reset, aborting
[WARN] ash: unexpected non-RSTACK frame after reset, aborting
[WARN] ash: unexpected non-RSTACK frame after reset, aborting
[ ERR] ash: got corrupted frame: (expected CRC: 0xda0d, got: 0x0c2b)
[ ERR] ash:   [ 58 7D B1 A9 91 2A 6A 63 7B 94 EA C8 AB B7 32 A4 ]
[ ERR] ash:   [ 9D AC 27 A8 ED CE 64 E9 12 8F 61 B6 FA D0 94 E1 ]
[ ERR] ash:   [ 14 D7 78 D5 97 A7 7D A6 EB F9 0E 03 7C 35 DB 15 ]
[ ERR] ash:   [ C9 03 BC EC A6 05 37 FC B2 31 78 FD CC 25 7F 49 ]
[ ERR] ash:   [ 2F 99 DC F4 0C DF 72 40 B9 EB F3 24 96 4F C8 8B ]
[ ERR] ash:   [ 5B E1 20 CC B2 00 89 37 97 6A 0C 2B ]6 4F C8 8B ]
[WARN] ash: unexpected non-RSTACK frame after reset, aborting
[INFO] ash: connected to NCP
[INFO] ezsp: EZSPv9, stack type 2 (mesh), version 7.1.3.0
[INFO] ezsp: xNCP manufacturer: 0xbaba, version: 0x1000
[INFO] ezsp: registering gateway endpoint
[INFO] ezsp: registering Green Power endpoint
[INFO] ezsp: initializing network...
[INFO] ezsp: stack state changed to EMBER_NETWORK_UP
[INFO] ezsp: network joined as coordinator node on channel 12 (PAN: 0xb24b, TX power: 0 dBm)
[INFO] PowerTag 0xe201b4d1: changing flow direction to downstream
jlama commented 1 year ago

Not sure what is going on. Each invert-flow call should toggle between downstream and upstream, but in your case it always stays downstream. Maybe the 3 phase PowerTags behave differently, I'll have to check...

Sany-IO commented 1 year ago

Thanks.. i will debug the days. I reactivate my Gateway to figure it out, what the problem is...

i see your wireshark logs, now i sniffed with my stick an zboss firmware, but my logs are very different. how can i find the network key to decrypt the traffic between Tags and Gateway?

jlama commented 1 year ago
jlama commented 1 year ago

I tried pairing my 3P PowerTag with the Wiser gateway, and there is no setting to change the flow direction! So it looks like the 3P models simply do not support this.

Sany-IO commented 1 year ago

What do you have for a Model of 3P?Am 21.02.2023 um 16:06 schrieb jlama @.***>: I tried pairing my 3P PowerTag with the Wiser gateway, and there is no setting to change the flow direction! So it looks like the 3P models simply do not support this.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

jlama commented 1 year ago

R9M42, 3P+N

Sany-IO commented 1 year ago

Okay, I have a R9M41 3P and a R9M40 only this shows all values with a minus. I paired with my gateway again and it gives a option for tag mount position.I wonder, the any of my 1P Tags show me „energy_delivered“ and „energy_received“ how comes the delivered value? You know it?Am 21.02.2023 um 17:00 schrieb jlama @.***>: R9M42, 39+N

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

jlama commented 1 year ago

Not sure I understand your question, but energy_delivered is the energy you inject on the grid (think solar panels).

If you have an option to toggle the mount position, it might be useful to use your sniffer to capture the packets so I can try to figure it out.

Sany-IO commented 1 year ago

Okay, I have no solar panels, and I can’t inject to the grid.. i think, the direction of the tag is wrong...

jlama commented 1 year ago

I recently tested a new R9M40 which has a new firmware (v4.xxx). I was getting negative values so used the invert-flow command and it worked fine. The power values are now positive, however the energy_delivered and energy_received values are now reversed... not sure why. The PowerTag is incrementing the energy_delivered counter instead of energy_received.

jlama commented 7 months ago

After further investigation negative values for received power is correct. Consumed power is negative, produced power is positive.