nmakel / solaredge_meterproxy

Modbus proxy for SolarEdge inverters and unsupported kWh meters
MIT License
29 stars 20 forks source link

semp-tcp.py integer error for port number #5

Closed Maikel-K closed 3 years ago

Maikel-K commented 3 years ago

Hi Niels,

I know you made this semp-tcp version for my request and couldnt test it yourself. I recieved the gateways and am testing it now.

The Meter is working via ModbusTCP, i have run the script with semp.rtu.py fine for the last couple of days.

I get this error with the script:

pi@raspberrypi4:~/eastronsolaredgetcp $ python3 semp-tcp.py 2020-12-14 14:43:59 INFO: Created <Thread(t_update_2, initial)>: meter1 sdm630 SDM630(192.168.1.108:8899, connectionType.TCP: timeout=1, retries=3, unit=0x1) 2020-12-14 14:44:00 INFO: Starting <Thread(t_update_2, started 3053270112)> Traceback (most recent call last): File "semp-tcp.py", line 251, in confparser["server"].get("port", fallback=default_config["server"]["port"]) File "/home/pi/.local/lib/python3.7/site-packages/pymodbus/server/sync.py", line 616, in StartTcpServer server = ModbusTcpServer(context, framer, identity, address, **kwargs) File "/home/pi/.local/lib/python3.7/site-packages/pymodbus/server/sync.py", line 339, in init self.handler) File "/usr/lib/python3.7/socketserver.py", line 452, in init self.server_bind() File "/usr/lib/python3.7/socketserver.py", line 466, in server_bind self.socket.bind(self.server_address) TypeError: an integer is required (got type str)

Maikel-K commented 3 years ago

Oh, BTW this is my config

[server] address = 192.168.1.115 port = 8898 meters = meter1 log_level = INFO

[meter1] dst_address = 2 src_address = 1 type = sdm630 host = 192.168.1.108 port = 8899

nmakel commented 3 years ago

Great to hear you're trying it out. The TCP port is now explicitly cast to integer. Give it another try.

Maikel-K commented 3 years ago

python3 semp-tcp.py 2020-12-14 15:37:18 INFO: Created <Thread(t_update_2, initial)>: meter1 sdm630 SDM630(192.168.1.108:8899, connectionType.TCP: timeout=1, retries=3, unit=0x1) 2020-12-14 15:37:19 INFO: Starting <Thread(t_update_2, started 3053585504)> Traceback (most recent call last): File "semp-tcp.py", line 251, in confparser["server"].getint("port", fallback=default_config["server"]["port"]) File "/home/pi/.local/lib/python3.7/site-packages/pymodbus/server/sync.py", line 616, in StartTcpServer server = ModbusTcpServer(context, framer, identity, address, **kwargs) File "/home/pi/.local/lib/python3.7/site-packages/pymodbus/server/sync.py", line 339, in init self.handler) File "/usr/lib/python3.7/socketserver.py", line 452, in init self.server_bind() File "/usr/lib/python3.7/socketserver.py", line 466, in server_bind self.socket.bind(self.server_address) OSError: [Errno 99] Cannot assign requested address

nmakel commented 3 years ago

Is 192.168.1.115 the IP of your Pi, and is it assigned to an interface? Can you ping the address?

Maikel-K commented 3 years ago

192.168.1.115 is ip of the gateway connected to the solaredge.

nmakel commented 3 years ago

In that case you need to use the IP adress of the Pi, not the gateway. In turn you will need to tell the gateway to be a TCP client and provide it with the IP of the Pi.

Maikel-K commented 3 years ago

So my config is now: address = 192.168.1.104 port = 5502

i should tell my gateway to: server: 192.168.1.104 port: 5502

nmakel commented 3 years ago

Correct. If you then also set log_level to debug, hopefully you will see the SolarEdge talking to your Pi.

Maikel-K commented 3 years ago

python3 semp-tcp.py 2020-12-14 16:35:53 DEBUG: [1234, 0, 5, 5, 5, 5, 0, 0, 0, 15, 1, 10000, 10000, 10000, 64536, 64536, 64536, 1500, 120, 0, 0, 20000, 0] 2020-12-14 16:35:53 DEBUG: setValues[3] 1601:23 2020-12-14 16:35:53 DEBUG: [0, 2, 4, 0, 0, 5] 2020-12-14 16:35:53 DEBUG: setValues[3] 1651:6 2020-12-14 16:35:53 DEBUG: [4614, 15, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 2020-12-14 16:35:53 DEBUG: setValues[3] 1701:23 2020-12-14 16:35:53 INFO: Created <Thread(t_update_2, initial)>: meter1 sdm630 SDM630(192.168.1.108:8899, connectionType.TCP: timeout=1, retries=3, unit=0x1) 2020-12-14 16:35:54 INFO: Starting <Thread(t_update_2, started 3052926048)> 2020-12-14 16:35:54 DEBUG: Current transaction state - IDLE 2020-12-14 16:35:54 DEBUG: Running transaction 1 2020-12-14 16:35:54 DEBUG: SEND: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x0 0x0 0x50 2020-12-14 16:35:54 DEBUG: New Transaction state 'SENDING' 2020-12-14 16:35:54 DEBUG: Changing transaction state from 'SENDING' to 'WAITING FOR REPLY' 2020-12-14 16:35:55 DEBUG: Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY' 2020-12-14 16:35:55 DEBUG: RECV: 0x0 0x1 0x0 0x0 0x0 0xa3 0x1 0x4 0xa0 0x43 0x63 0xf8 0x39 0x43 0x66 0x23 0x5 0x43 0x67 0xd1 0x39 0x3f 0x78 0xe1 0xf0 0x3f 0x88 0x82 0xdb 0x3f 0x3e 0x47 0x97 0x43 0x57 0x24 0xee 0x43 0x5c 0x92 0x76 0x43 0x5 0x3b 0x6e 0x43 0x5d 0xc4 0xa0 0x43 0x75 0x6d 0x23 0x43 0x2c 0x4a 0x28 0x42 0x57 0x2f 0x4f 0xc2 0xd7 0x3d 0x5a 0x42 0xda 0x79 0xd6 0x3f 0x78 0x5a 0x8d 0x3f 0x66 0x13 0x32 0x3f 0x45 0xf7 0x30 0x41 0x60 0xa3 0x24 0xc1 0xd0 0x14 0xf5 0x42 0x1d 0x67 0xe6 0x43 0x65 0xf8 0x63 0x0 0x0 0x0 0x0 0x3f 0x6d 0x70 0x4c 0x40 0x32 0x14 0x39 0x0 0x0 0x0 0x0 0x44 0xe 0x3c 0xb4 0x0 0x0 0x0 0x0 0x44 0xe 0xe9 0x1 0x0 0x0 0x0 0x0 0x42 0x5d 0xa8 0x47 0x3f 0x7e 0xcb 0x58 0x0 0x0 0x0 0x0 0x40 0xb2 0x7 0x1c 0x0 0x0 0x0 0x0 0x42 0x47 0x9e 0xd8 0x43 0xfe 0x66 0xc8 0x42 0x7b 0xb8 0x51 0x42 0x90 0x11 0x68 0x42 0xfa 0xd7 0x8d 2020-12-14 16:35:55 DEBUG: Processing: 0x0 0x1 0x0 0x0 0x0 0xa3 0x1 0x4 0xa0 0x43 0x63 0xf8 0x39 0x43 0x66 0x23 0x5 0x43 0x67 0xd1 0x39 0x3f 0x78 0xe1 0xf0 0x3f 0x88 0x82 0xdb 0x3f 0x3e 0x47 0x97 0x43 0x57 0x24 0xee 0x43 0x5c 0x92 0x76 0x43 0x5 0x3b 0x6e 0x43 0x5d 0xc4 0xa0 0x43 0x75 0x6d 0x23 0x43 0x2c 0x4a 0x28 0x42 0x57 0x2f 0x4f 0xc2 0xd7 0x3d 0x5a 0x42 0xda 0x79 0xd6 0x3f 0x78 0x5a 0x8d 0x3f 0x66 0x13 0x32 0x3f 0x45 0xf7 0x30 0x41 0x60 0xa3 0x24 0xc1 0xd0 0x14 0xf5 0x42 0x1d 0x67 0xe6 0x43 0x65 0xf8 0x63 0x0 0x0 0x0 0x0 0x3f 0x6d 0x70 0x4c 0x40 0x32 0x14 0x39 0x0 0x0 0x0 0x0 0x44 0xe 0x3c 0xb4 0x0 0x0 0x0 0x0 0x44 0xe 0xe9 0x1 0x0 0x0 0x0 0x0 0x42 0x5d 0xa8 0x47 0x3f 0x7e 0xcb 0x58 0x0 0x0 0x0 0x0 0x40 0xb2 0x7 0x1c 0x0 0x0 0x0 0x0 0x42 0x47 0x9e 0xd8 0x43 0xfe 0x66 0xc8 0x42 0x7b 0xb8 0x51 0x42 0x90 0x11 0x68 0x42 0xfa 0xd7 0x8d 2020-12-14 16:35:55 DEBUG: Factory Response[ReadInputRegistersResponse: 4] 2020-12-14 16:35:55 DEBUG: Adding transaction 1 2020-12-14 16:35:55 DEBUG: Getting transaction 1 2020-12-14 16:35:55 DEBUG: Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE' 2020-12-14 16:35:55 DEBUG: [17251, 63545, 17254, 8965, 17255, 53561, 16248, 57840, 16264, 33499, 16190, 18327, 17239, 9454, 17244, 37494, 17157, 15214, 17245, 50336, 17269, 27939, 17196, 18984, 16983, 12111, 49879, 15706, 17114, 31190, 16248, 23181, 16230, 4914, 16197, 63280, 16736, 41764, 49616, 5365, 16925, 26598, 17253, 63587, 0, 0, 16237, 28748, 16434, 5177, 0, 0, 17422, 15540, 0, 0, 17422, 59649, 0, 0, 16989, 43079, 16254, 52056, 0, 0, 16562, 1820, 0, 0, 16967, 40664, 17406, 26312, 17019, 47185, 17040, 4456, 17146, 55181] 2020-12-14 16:35:55 DEBUG: [b'Cc', b'\xf89'] 2020-12-14 16:35:55 DEBUG: [b'Cf', b'#\x05'] 2020-12-14 16:35:55 DEBUG: [b'Cg', b'\xd19'] 2020-12-14 16:35:55 DEBUG: [b'?x', b'\xe1\xf0'] 2020-12-14 16:35:55 DEBUG: [b'?\x88', b'\x82\xdb'] 2020-12-14 16:35:55 DEBUG: [b'?>', b'G\x97'] 2020-12-14 16:35:55 DEBUG: [b'CW', b'$\xee'] 2020-12-14 16:35:55 DEBUG: [b'C\', b'\x92v'] 2020-12-14 16:35:55 DEBUG: [b'C\x05', b';n'] 2020-12-14 16:35:55 DEBUG: [b'C]', b'\xc4\xa0'] 2020-12-14 16:35:55 DEBUG: [b'Cu', b'm#'] 2020-12-14 16:35:55 DEBUG: [b'C,', b'J('] 2020-12-14 16:35:55 DEBUG: [b'BW', b'/O'] 2020-12-14 16:35:55 DEBUG: [b'\xc2\xd7', b'=Z'] 2020-12-14 16:35:55 DEBUG: [b'B\xda', b'y\xd6'] 2020-12-14 16:35:55 DEBUG: [b'?x', b'Z\x8d'] 2020-12-14 16:35:55 DEBUG: [b'?f', b'\x132'] 2020-12-14 16:35:55 DEBUG: [b'?E', b'\xf70'] 2020-12-14 16:35:55 DEBUG: [b'A`', b'\xa3$'] 2020-12-14 16:35:55 DEBUG: [b'\xc1\xd0', b'\x14\xf5'] 2020-12-14 16:35:55 DEBUG: [b'B\x1d', b'g\xe6'] 2020-12-14 16:35:55 DEBUG: [b'Ce', b'\xf8c'] 2020-12-14 16:35:55 DEBUG: [b'?m', b'pL'] 2020-12-14 16:35:55 DEBUG: [b'@2', b'\x149'] 2020-12-14 16:35:55 DEBUG: [b'D\x0e', b'<\xb4'] 2020-12-14 16:35:55 DEBUG: [b'D\x0e', b'\xe9\x01'] 2020-12-14 16:35:55 DEBUG: [b'B]', b'\xa8G'] 2020-12-14 16:35:55 DEBUG: [b'?~', b'\xcbX'] 2020-12-14 16:35:55 DEBUG: [b'@\xb2', b'\x07\x1c'] 2020-12-14 16:35:55 DEBUG: [b'BG', b'\x9e\xd8'] 2020-12-14 16:35:55 DEBUG: [b'C\xfe', b'f\xc8'] 2020-12-14 16:35:55 DEBUG: [b'B{', b'\xb8Q'] 2020-12-14 16:35:55 DEBUG: [b'B\x90', b'\x11h'] 2020-12-14 16:35:55 DEBUG: [b'B\xfa', b'\xd7\x8d'] 2020-12-14 16:35:55 DEBUG: Current transaction state - TRANSACTION_COMPLETE 2020-12-14 16:35:55 DEBUG: Running transaction 2 2020-12-14 16:35:55 DEBUG: SEND: 0x0 0x2 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x50 0x0 0x1c 2020-12-14 16:35:55 DEBUG: New Transaction state 'SENDING' 2020-12-14 16:35:55 DEBUG: Changing transaction state from 'SENDING' to 'WAITING FOR REPLY' 2020-12-14 16:35:55 DEBUG: Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY' 2020-12-14 16:35:55 DEBUG: RECV: 0x0 0x2 0x0 0x0 0x0 0x3b 0x1 0x4 0x38 0x44 0x17 0x37 0xa4 0x45 0x3f 0xa 0x5e 0x43 0xa5 0xbb 0x21 0x45 0x73 0x93 0xc2 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x43 0xc3 0xe9 0x5 0x45 0x73 0xd8 0x2b 0x3f 0x20 0x7f 0xd4 0x41 0x1c 0xbf 0x47 2020-12-14 16:35:55 DEBUG: Processing: 0x0 0x2 0x0 0x0 0x0 0x3b 0x1 0x4 0x38 0x44 0x17 0x37 0xa4 0x45 0x3f 0xa 0x5e 0x43 0xa5 0xbb 0x21 0x45 0x73 0x93 0xc2 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x43 0xc3 0xe9 0x5 0x45 0x73 0xd8 0x2b 0x3f 0x20 0x7f 0xd4 0x41 0x1c 0xbf 0x47 2020-12-14 16:35:55 DEBUG: Factory Response[ReadInputRegistersResponse: 4] 2020-12-14 16:35:55 DEBUG: Adding transaction 2 2020-12-14 16:35:55 DEBUG: Getting transaction 2 2020-12-14 16:35:55 DEBUG: Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE' 2020-12-14 16:35:55 DEBUG: [17431, 14244, 17727, 2654, 17317, 47905, 17779, 37826, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17347, 59653, 17779, 55339, 16160, 32724, 16668, 48967] 2020-12-14 16:35:55 DEBUG: [b'D\x17', b'7\xa4'] 2020-12-14 16:35:55 DEBUG: [b'E?', b'\n^'] 2020-12-14 16:35:55 DEBUG: [b'C\xa5', b'\xbb!'] 2020-12-14 16:35:55 DEBUG: [b'Es', b'\x93\xc2'] 2020-12-14 16:35:55 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-14 16:35:55 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-14 16:35:55 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-14 16:35:55 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-14 16:35:55 DEBUG: [b'C\xc3', b'\xe9\x05'] 2020-12-14 16:35:55 DEBUG: [b'Es', b'\xd8+'] 2020-12-14 16:35:55 DEBUG: [b'? ', b'\x7f\xd4'] 2020-12-14 16:35:55 DEBUG: [b'A\x1c', b'\xbfG'] 2020-12-14 16:35:55 DEBUG: Current transaction state - TRANSACTION_COMPLETE 2020-12-14 16:35:55 DEBUG: Running transaction 3 2020-12-14 16:35:55 DEBUG: SEND: 0x0 0x3 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0xc8 0x0 0x46 2020-12-14 16:35:55 DEBUG: New Transaction state 'SENDING' 2020-12-14 16:35:55 DEBUG: Changing transaction state from 'SENDING' to 'WAITING FOR REPLY' 2020-12-14 16:35:55 DEBUG: Started thread to serve client at ('192.168.1.115', 7506) 2020-12-14 16:35:55 DEBUG: Client Connected [192.168.1.115:7506] 2020-12-14 16:35:55 DEBUG: Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY' 2020-12-14 16:35:55 DEBUG: RECV: 0x0 0x3 0x0 0x0 0x0 0x8f 0x1 0x4 0x8c 0x43 0xc6 0x3b 0xd4 0x43 0xc7 0xde 0x11 0x43 0xc6 0xf4 0xd6 0x43 0xc7 0x4 0xe9 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x3e 0x92 0xd5 0x17 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x40 0xa6 0xa8 0xbf 0x40 0x9e 0xfb 0xb9 0x40 0x9e 0x96 0x5 0x42 0x4b 0x48 0x18 0x41 0xfa 0x92 0xce 0x41 0xea 0x9 0x5d 0x0 0x0 0x0 0x0 0x40 0xa1 0x68 0xd4 0x42 0x14 0x87 0x64 0x0 0x0 0x0 0x0 0x40 0xb3 0x52 0x1c 0x0 0x0 0x0 0x0 0x3e 0xea 0xa9 0xe 0x3f 0x80 0xf5 0x6a 0x3e 0xd3 0x1a 0x13 0x40 0xe3 0x6 0x14 0x40 0xc1 0xb6 0x94 0x41 0x2a 0x37 0x25 2020-12-14 16:35:55 DEBUG: Processing: 0x0 0x3 0x0 0x0 0x0 0x8f 0x1 0x4 0x8c 0x43 0xc6 0x3b 0xd4 0x43 0xc7 0xde 0x11 0x43 0xc6 0xf4 0xd6 0x43 0xc7 0x4 0xe9 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x3e 0x92 0xd5 0x17 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x40 0xa6 0xa8 0xbf 0x40 0x9e 0xfb 0xb9 0x40 0x9e 0x96 0x5 0x42 0x4b 0x48 0x18 0x41 0xfa 0x92 0xce 0x41 0xea 0x9 0x5d 0x0 0x0 0x0 0x0 0x40 0xa1 0x68 0xd4 0x42 0x14 0x87 0x64 0x0 0x0 0x0 0x0 0x40 0xb3 0x52 0x1c 0x0 0x0 0x0 0x0 0x3e 0xea 0xa9 0xe 0x3f 0x80 0xf5 0x6a 0x3e 0xd3 0x1a 0x13 0x40 0xe3 0x6 0x14 0x40 0xc1 0xb6 0x94 0x41 0x2a 0x37 0x25 2020-12-14 16:35:55 DEBUG: Factory Response[ReadInputRegistersResponse: 4] 2020-12-14 16:35:55 DEBUG: Adding transaction 3 2020-12-14 16:35:55 DEBUG: Getting transaction 3 2020-12-14 16:35:55 DEBUG: Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE' 2020-12-14 16:35:55 DEBUG: [17350, 15316, 17351, 56849, 17350, 62678, 17351, 1257, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16018, 54551, 0, 0, 0, 0, 0, 0, 0, 0, 16550, 43199, 16542, 64441, 16542, 38405, 16971, 18456, 16890, 37582, 16874, 2397, 0, 0, 16545, 26836, 16916, 34660, 0, 0, 16563, 21020, 0, 0, 16106, 43278, 16256, 62826, 16083, 6675, 16611, 1556, 16577, 46740, 16682, 14117] 2020-12-14 16:35:55 DEBUG: [b'C\xc6', b';\xd4'] 2020-12-14 16:35:55 DEBUG: [b'C\xc7', b'\xde\x11'] 2020-12-14 16:35:55 DEBUG: [b'C\xc6', b'\xf4\xd6'] 2020-12-14 16:35:55 DEBUG: [b'C\xc7', b'\x04\xe9'] 2020-12-14 16:35:55 DEBUG: [b'>\x92', b'\xd5\x17'] 2020-12-14 16:35:55 DEBUG: [b'@\xa6', b'\xa8\xbf'] 2020-12-14 16:35:55 DEBUG: [b'@\x9e', b'\xfb\xb9'] 2020-12-14 16:35:55 DEBUG: [b'@\x9e', b'\x96\x05'] 2020-12-14 16:35:55 DEBUG: [b'BK', b'H\x18'] 2020-12-14 16:35:55 DEBUG: [b'A\xfa', b'\x92\xce'] 2020-12-14 16:35:55 DEBUG: [b'A\xea', b'\t]'] 2020-12-14 16:35:55 DEBUG: [b'@\xa1', b'h\xd4'] 2020-12-14 16:35:55 DEBUG: [b'B\x14', b'\x87d'] 2020-12-14 16:35:55 DEBUG: [b'>\xea', b'\xa9\x0e'] 2020-12-14 16:35:55 DEBUG: [b'?\x80', b'\xf5j'] 2020-12-14 16:35:55 DEBUG: [b'>\xd3', b'\x1a\x13'] 2020-12-14 16:35:55 DEBUG: [b'@\xe3', b'\x06\x14'] 2020-12-14 16:35:55 DEBUG: [b'@\xc1', b'\xb6\x94'] 2020-12-14 16:35:55 DEBUG: [b'A*', b'7%'] 2020-12-14 16:35:55 DEBUG: Current transaction state - TRANSACTION_COMPLETE 2020-12-14 16:35:55 DEBUG: Running transaction 4 2020-12-14 16:35:55 DEBUG: SEND: 0x0 0x4 0x0 0x0 0x0 0x6 0x1 0x4 0x1 0x4e 0x0 0xc 2020-12-14 16:35:55 DEBUG: New Transaction state 'SENDING' 2020-12-14 16:35:55 DEBUG: Changing transaction state from 'SENDING' to 'WAITING FOR REPLY' 2020-12-14 16:35:55 DEBUG: Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY' 2020-12-14 16:35:55 DEBUG: RECV: 0x0 0x4 0x0 0x0 0x0 0x1b 0x1 0x4 0x18 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x44 0xe 0xee 0xe9 0x43 0x45 0x74 0x7a 2020-12-14 16:35:55 DEBUG: Processing: 0x0 0x4 0x0 0x0 0x0 0x1b 0x1 0x4 0x18 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x44 0xe 0xee 0xe9 0x43 0x45 0x74 0x7a 2020-12-14 16:35:55 DEBUG: Factory Response[ReadInputRegistersResponse: 4] 2020-12-14 16:35:55 DEBUG: Adding transaction 4 2020-12-14 16:35:55 DEBUG: Getting transaction 4 2020-12-14 16:35:55 DEBUG: Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE' 2020-12-14 16:35:55 DEBUG: [0, 0, 0, 0, 0, 0, 0, 0, 17422, 61161, 17221, 29818] 2020-12-14 16:35:55 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-14 16:35:55 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-14 16:35:55 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-14 16:35:55 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-14 16:35:55 DEBUG: [b'D\x0e', b'\xee\xe9'] 2020-12-14 16:35:55 DEBUG: [b'CE', b'tz'] 2020-12-14 16:35:55 DEBUG: [61161, 17422, 26312, 17406, 61161, 17422, 26312, 17406, 15540, 17422, 9454, 17239, 37494, 17244, 15214, 17157, 63587, 17253, 63545, 17251, 8965, 17254, 53561, 17255, 1257, 17351, 15316, 17350, 56849, 17351, 62678, 17350, 40664, 16967] 2020-12-14 16:35:55 DEBUG: setValues[3] 1001:34 2020-12-14 16:35:55 DEBUG: [61161, 17422, 0, 0, 0, 0, 26312, 17406, 0, 0, 0, 0, 47185, 17019, 47185, 17019, 47185, 17019, 0, 0, 0, 0, 29818, 17221, 29818, 17221, 0, 0, 0, 0, 14244, 17431, 14244, 17431, 0, 0, 0, 0, 52056, 16254, 23181, 16248, 4914, 16230, 63280, 16197, 43079, 16989, 12111, 16983, 15706, 49879, 31190, 17114, 59649, 17422, 50336, 17245, 27939, 17269, 18984, 17196, 57840, 16248, 33499, 16264, 18327, 16190, 47905, 17317, 0, 0, 0, 0, 59653, 17347, 63343, 17104, 56387, 17255, 10510, 17087] 2020-12-14 16:35:55 DEBUG: setValues[3] 1101:82 2020-12-14 16:36:00 DEBUG: Current transaction state - TRANSACTION_COMPLETE 2020-12-14 16:36:00 DEBUG: Running transaction 5 2020-12-14 16:36:00 DEBUG: SEND: 0x0 0x5 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x0 0x0 0x50 2020-12-14 16:36:00 DEBUG: New Transaction state 'SENDING' 2020-12-14 16:36:00 DEBUG: Changing transaction state from 'SENDING' to 'WAITING FOR REPLY' 2020-12-14 16:36:01 DEBUG: Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY' 2020-12-14 16:36:01 DEBUG: RECV: 0x0 0x5 0x0 0x0 0x0 0xa3 0x1 0x4 0xa0 0x43 0x63 0xc2 0x0 0x43 0x66 0x47 0xb1 0x43 0x67 0xac 0xd0 0x3f 0x79 0x86 0x84 0x3f 0x88 0x70 0xa3 0x3f 0x3e 0xde 0x67 0x43 0x57 0x55 0x2f 0x43 0x5c 0xc7 0xf5 0x43 0x5 0x74 0xc6 0x43 0x5d 0xff 0x5f 0x43 0x75 0x76 0xd1 0x43 0x2c 0xbb 0x87 0x42 0x57 0xf3 0xe6 0xc2 0xd6 0x8d 0xd3 0x42 0xdb 0x53 0x7e 0x3f 0x78 0x50 0x7a 0x3f 0x66 0x41 0xeb 0x3f 0x45 0xca 0x3e 0x41 0x61 0x37 0xae 0xc1 0xcf 0xb6 0xb0 0x42 0x1d 0x75 0x4d 0x43 0x65 0xed 0x28 0x0 0x0 0x0 0x0 0x3f 0x6d 0xb2 0xd3 0x40 0x32 0x46 0x1e 0x0 0x0 0x0 0x0 0x44 0xe 0x63 0xf4 0x0 0x0 0x0 0x0 0x44 0xf 0x11 0x59 0x0 0x0 0x0 0x0 0x42 0x5e 0x7a 0xe9 0x3f 0x7e 0xc9 0xbb 0x0 0x0 0x0 0x0 0x40 0xb2 0x7e 0x27 0x0 0x0 0x0 0x0 0x42 0x47 0xc9 0xbc 0x43 0xfe 0x66 0xc8 0x42 0x7b 0xb8 0x51 0x42 0x90 0x11 0x68 0x42 0xfa 0xd7 0x8d 2020-12-14 16:36:01 DEBUG: Processing: 0x0 0x5 0x0 0x0 0x0 0xa3 0x1 0x4 0xa0 0x43 0x63 0xc2 0x0 0x43 0x66 0x47 0xb1 0x43 0x67 0xac 0xd0 0x3f 0x79 0x86 0x84 0x3f 0x88 0x70 0xa3 0x3f 0x3e 0xde 0x67 0x43 0x57 0x55 0x2f 0x43 0x5c 0xc7 0xf5 0x43 0x5 0x74 0xc6 0x43 0x5d 0xff 0x5f 0x43 0x75 0x76 0xd1 0x43 0x2c 0xbb 0x87 0x42 0x57 0xf3 0xe6 0xc2 0xd6 0x8d 0xd3 0x42 0xdb 0x53 0x7e 0x3f 0x78 0x50 0x7a 0x3f 0x66 0x41 0xeb 0x3f 0x45 0xca 0x3e 0x41 0x61 0x37 0xae 0xc1 0xcf 0xb6 0xb0 0x42 0x1d 0x75 0x4d 0x43 0x65 0xed 0x28 0x0 0x0 0x0 0x0 0x3f 0x6d 0xb2 0xd3 0x40 0x32 0x46 0x1e 0x0 0x0 0x0 0x0 0x44 0xe 0x63 0xf4 0x0 0x0 0x0 0x0 0x44 0xf 0x11 0x59 0x0 0x0 0x0 0x0 0x42 0x5e 0x7a 0xe9 0x3f 0x7e 0xc9 0xbb 0x0 0x0 0x0 0x0 0x40 0xb2 0x7e 0x27 0x0 0x0 0x0 0x0 0x42 0x47 0xc9 0xbc 0x43 0xfe 0x66 0xc8 0x42 0x7b 0xb8 0x51 0x42 0x90 0x11 0x68 0x42 0xfa 0xd7 0x8d 2020-12-14 16:36:01 DEBUG: Factory Response[ReadInputRegistersResponse: 4] 2020-12-14 16:36:01 DEBUG: Adding transaction 5 2020-12-14 16:36:01 DEBUG: Getting transaction 5 2020-12-14 16:36:01 DEBUG: Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTIONCOMPLETE' 2020-12-14 16:36:01 DEBUG: [17251, 49664, 17254, 18353, 17255, 44240, 16249, 34436, 16264, 28835, 16190, 56935, 17239, 21807, 17244, 51189, 17157, 29894, 17245, 65375, 17269, 30417, 17196, 48007, 16983, 62438, 49878, 36307, 17115, 21374, 16248, 20602, 16230, 16875, 16197, 51774, 16737, 14254, 49615, 46768, 16925, 30029, 17253, 60712, 0, 0, 16237, 45779, 16434, 17950, 0, 0, 17422, 25588, 0, 0, 17423, 4441, 0, 0, 16990, 31465, 16254, 51643, 0, 0, 16562, 32295, 0, 0, 16967, 51644, 17406, 26312, 17019, 47185, 17040, 4456, 17146, 55181] 2020-12-14 16:36:01 DEBUG: [b'Cc', b'\xc2\x00'] 2020-12-14 16:36:01 DEBUG: [b'Cf', b'G\xb1'] 2020-12-14 16:36:01 DEBUG: [b'Cg', b'\xac\xd0'] 2020-12-14 16:36:01 DEBUG: [b'?y', b'\x86\x84'] 2020-12-14 16:36:01 DEBUG: [b'?\x88', b'p\xa3'] 2020-12-14 16:36:01 DEBUG: [b'?>', b'\xdeg'] 2020-12-14 16:36:01 DEBUG: [b'CW', b'U/'] 2020-12-14 16:36:01 DEBUG: [b'C\', b'\xc7\xf5'] 2020-12-14 16:36:01 DEBUG: [b'C\x05', b't\xc6'] 2020-12-14 16:36:01 DEBUG: [b'C]', b'\xff'] 2020-12-14 16:36:01 DEBUG: [b'Cu', b'v\xd1'] 2020-12-14 16:36:01 DEBUG: [b'C,', b'\xbb\x87'] 2020-12-14 16:36:01 DEBUG: [b'BW', b'\xf3\xe6'] 2020-12-14 16:36:01 DEBUG: [b'\xc2\xd6', b'\x8d\xd3'] 2020-12-14 16:36:01 DEBUG: [b'B\xdb', b'S~'] 2020-12-14 16:36:01 DEBUG: [b'?x', b'Pz'] 2020-12-14 16:36:01 DEBUG: [b'?f', b'A\xeb'] 2020-12-14 16:36:01 DEBUG: [b'?E', b'\xca>'] 2020-12-14 16:36:01 DEBUG: [b'Aa', b'7\xae'] 2020-12-14 16:36:01 DEBUG: [b'\xc1\xcf', b'\xb6\xb0'] 2020-12-14 16:36:01 DEBUG: [b'B\x1d', b'uM'] 2020-12-14 16:36:01 DEBUG: [b'Ce', b'\xed('] 2020-12-14 16:36:01 DEBUG: [b'?m', b'\xb2\xd3'] 2020-12-14 16:36:01 DEBUG: [b'@2', b'F\x1e'] 2020-12-14 16:36:01 DEBUG: [b'D\x0e', b'c\xf4'] 2020-12-14 16:36:01 DEBUG: [b'D\x0f', b'\x11Y'] 2020-12-14 16:36:01 DEBUG: [b'B^', b'z\xe9'] 2020-12-14 16:36:01 DEBUG: [b'?~', b'\xc9\xbb'] 2020-12-14 16:36:01 DEBUG: [b'@\xb2', b"~'"] 2020-12-14 16:36:01 DEBUG: [b'BG', b'\xc9\xbc'] 2020-12-14 16:36:01 DEBUG: [b'C\xfe', b'f\xc8'] 2020-12-14 16:36:01 DEBUG: [b'B{', b'\xb8Q'] 2020-12-14 16:36:01 DEBUG: [b'B\x90', b'\x11h'] 2020-12-14 16:36:01 DEBUG: [b'B\xfa', b'\xd7\x8d'] 2020-12-14 16:36:01 DEBUG: Current transaction state - TRANSACTION_COMPLETE

Maikel-K commented 3 years ago

So it seems to run, but no data in the solaredge app? Any clues?

Maikel-K commented 3 years ago

I see this coming buy: 2020-12-14 16:35:55 DEBUG: Started thread to serve client at ('192.168.1.115', 7506) 2020-12-14 16:35:55 DEBUG: Client Connected [192.168.1.115:7506]

With, what it looks like, a changing port all the time?

Maikel-K commented 3 years ago

I checked on the inverter itself. It says com error, missing meter.

So it doesn't seem to work? What could be wrong?

nmakel commented 3 years ago

Could you provide a screenshot of the gateway setup screen, specifically where you set the server IP, port, and maybe some other options? As far as I can see you are receiving requests from the inverter, Factory Response[ReadInputRegistersResponse: 4] for example.

Maikel-K commented 3 years ago

image image

Maikel-K commented 3 years ago

i did once again checked if the connection between PI-->Gateway-->inverter is working with switchting back to non-solaredge-logger and using the solaredge-modbus script. The connection is working, so the gateway working as SERVER works okay!

nmakel commented 3 years ago

Turns out the modbus messages you're seeing are caused by the meter updating values in semp-tcp.py, not the inverter sending requests. I will need to look into the documentation of your gateway a bit more to see what settings are required.

Maikel-K commented 3 years ago

Hi Niels,

Im using this unit: EE11

http://www.hi-flying.com/elfin-ee10-elfin-ee11

nmakel commented 3 years ago

The documentation is frustratingly incoherent. Would you mind setting the gateway back to tcp client, with all the settings back to how you had them, and then post as many screenshots of the system, serial port, and socket settings pages as possible. Perhaps it's as simple as a single option set incorrectly.

Maikel-K commented 3 years ago

Hi Niels,

These are the settings for the serial port. Not much more to be set actually... image image

nmakel commented 3 years ago

Could you set the baud rate to 9600?

Also, what options are available in the Protocol dropdown?

Maikel-K commented 3 years ago

Like i write before, the serial to tcp server part works as I can retrieve inverter data with your Solaredge-modbus scripts.

Maikel-K commented 3 years ago

Our messages crossed each other. These are the protocol options.

Maybe it should be None

image

nmakel commented 3 years ago

No, if I understand the documentation correctly the Modbus protocol setting enables Modbus RTU to TCP translation.

I understand the Inverter acting as server works (gateway is client to the inverter modbus rtu server). But in this case the inverter must act as client, and it may be more particular regarding serial settings.

Maikel-K commented 3 years ago

Would it be possible to write a simple script to see if the inverter is sending/requesting data only and no info of the meter?

This way we can debug the connection to the meter?

nmakel commented 3 years ago

Would it be possible to write a simple script to see if the inverter is sending/requesting data only and no info of the meter?

This way we can debug the connection to the meter?

Sure. Have you tried a baud rate of 9600 already?

Maikel-K commented 3 years ago

Yes i tried. No difference as in I don't see any data appearing in SolarEdge.

I put my laptop away and copying data from the tool on my iPhone is very messy....

nmakel commented 3 years ago

Try the following script. It creates a simple Modbus TCP server, and has logging set to debug.

#!/usr/bin/env python3

import logging
import sys

from pymodbus.server.sync import StartTcpServer
from pymodbus.constants import Endian
from pymodbus.device import ModbusDeviceIdentification
from pymodbus.transaction import ModbusRtuFramer
from pymodbus.datastore import ModbusSlaveContext
from pymodbus.datastore import ModbusServerContext
from pymodbus.payload import BinaryPayloadBuilder

log_handler = logging.StreamHandler(sys.stdout)
log_handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)s: %(message)s", datefmt="%Y-%m-%d %H:%M:%S"))

logger = logging.getLogger()
logger.addHandler(log_handler)
logger.setLevel(logging.DEBUG)

slave = ModbusSlaveContext()
block_1601 = BinaryPayloadBuilder(byteorder=Endian.Big, wordorder=Endian.Little)
block_1601.add_32bit_int(1234) # config passcode
slave.setValues(3, 1600, block_1601.to_registers())

identity = ModbusDeviceIdentification()
server_ctx = ModbusServerContext(slaves={"2": slave}, single=False)

StartTcpServer(
    server_ctx,
    identity=identity,
    address=("192.168.1.104", 5502)
)
Maikel-K commented 3 years ago

How fast should i start to see data coming in Putty?

pi@raspberrypi4:~/eastronsolaredgetcp $ python3 test.py 2020-12-15 13:47:32 DEBUG: [1234, 0] 2020-12-15 13:47:32 DEBUG: setValues[3] 1601:2 2020-12-15 13:47:34 DEBUG: Started thread to serve client at ('192.168.1.115', 3561) 2020-12-15 13:47:34 DEBUG: Client Connected [192.168.1.115:3561]

In the gateway at communication settings i can also set the local port. If i set it to 5502 this port is also shown in putty.

Maikel-K commented 3 years ago

Hi, so the output now is:

pi@raspberrypi4:~/eastronsolaredgetcp $ python3 test.py 2020-12-15 13:47:32 DEBUG: [1234, 0] 2020-12-15 13:47:32 DEBUG: setValues[3] 1601:2 2020-12-15 13:47:34 DEBUG: Started thread to serve client at ('192.168.1.115', 3 561) 2020-12-15 13:47:34 DEBUG: Client Connected [192.168.1.115:3561]

Maikel-K commented 3 years ago

i changed at Serial port settings Protocol to NONE and this immediatly happened. I also saw data the data counter started to increase on the TCP-client part of the status page

2020-12-15 14:26:31 DEBUG: Frame check failed, ignoring!! 2020-12-15 14:26:33 DEBUG: Handling data: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 2020-12-15 14:26:33 DEBUG: Processing: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 2020-12-15 14:26:33 DEBUG: Frame check failed, ignoring!! 2020-12-15 14:26:35 DEBUG: Handling data: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 2020-12-15 14:26:35 DEBUG: Processing: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 2020-12-15 14:26:35 DEBUG: Frame check failed, ignoring!! 2020-12-15 14:26:37 DEBUG: Handling data: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 2020-12-15 14:26:37 DEBUG: Processing: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 2020-12-15 14:26:37 DEBUG: Frame check failed, ignoring!!

nmakel commented 3 years ago

2020-12-15 13:47:32 DEBUG: [1234, 0] 2020-12-15 13:47:32 DEBUG: setValues[3] 1601:2

This is a part of the script, one of the registers is being filled with dummy data.

2020-12-15 13:47:34 DEBUG: Started thread to serve client at ('192.168.1.115', 3 561) 2020-12-15 13:47:34 DEBUG: Client Connected [192.168.1.115:3561]

This is your gateway connecting with the Pi. Immediately after this message you should be seeing a large number of requests every second. They look like this:

2020-12-14 17:00:28 DEBUG: Getting Frame - 0x3 0x3 0xf2 0x0 0x6 2020-12-14 17:00:28 DEBUG: Factory Request[ReadHoldingRegistersRequest: 3] 2020-12-14 17:00:28 DEBUG: Frame advanced, resetting header!! 2020-12-14 17:00:28 DEBUG: validate: fc-[3] address-1011: count-6 2020-12-14 17:00:28 DEBUG: getValues fc-[3] address-1011: count-6 2020-12-14 17:00:28 DEBUG: send: [ReadRegisterResponse (6)]- b'02030c999a439000000000000000008deb'

You're not, so either the gateway is not forwarding messages from your inverter, or the inverter is not sending the messages. Both could be a configuration issue in the gateway or inverter.

Remove the gateway and connect the Pi to your inverter directly using the RS485 to USB adapter and run semp-rtu.py. This way you can rule out the inverter being the problem.

Maikel-K commented 3 years ago

Immediately the proxy is running again.

nmakel commented 3 years ago

Immediately the proxy is running again.

Ok, great. Then we can ignore the inverter.

To rule out a networking issue, are you blocking traffic with a firewall on your Pi? If so, be sure to turn it off.

I am also curious what the test script shows when you choose frame as protocol.

Maikel-K commented 3 years ago

I didn't install a firewall myself on the pin so I don't think so

Do you have a clue what we need to set here then, I can switch tag to off too. image

nmakel commented 3 years ago

I didn't install a firewall myself on the pin so I don't think so

Run sudo iptables -L to check.

Do you have a clue what we need to set here then, I can switch tag to off too.

No clue, might only be useful if the data is known beforehand. Try turning it off?

Maikel-K commented 3 years ago

pi@raspberrypi4:~$ sudo iptables -LChain INPUT (policy ACCEPT)target prot opt source destination Chain FORWARD (policy ACCEPT)target prot opt source destination Chain OUTPUT (policy ACCEPT)target prot opt source destination

Maikel-K commented 3 years ago

Dont pay attention to the black question marks...... those are spaces

nmakel commented 3 years ago

Firewall is fine, not blocking anything. I guess it's just a matter of finding the correct configuration on your gateway.

You should be able to see things are working right away using the test script. It may also be useful to use the acompanying desktop utility to check whether the gateway is actually receiving messages. Remember that the inverter might need different serial settings depending on whether it is set to non-solaredge logger (inverter as server) or modbus multi-devices (inverter as client). In my experience it will use baud 9600 when it is a modbus client.

Maikel-K commented 3 years ago

its now showing this:

2020-12-16 08:50:21 DEBUG: Handling data: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 08:50:21 DEBUG: Processing: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 08:50:21 DEBUG: Frame check failed, ignoring!! 2020-12-16 08:50:23 DEBUG: Handling data: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 08:50:23 DEBUG: Processing: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 08:50:23 DEBUG: Frame check failed, ignoring!! 2020-12-16 08:50:25 DEBUG: Handling data: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 08:50:25 DEBUG: Processing: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 08:50:25 DEBUG: Frame check failed, ignoring!!

nmakel commented 3 years ago

its now showing this:

2020-12-16 08:50:21 DEBUG: Handling data: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 08:50:21 DEBUG: Processing: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 08:50:21 DEBUG: Frame check failed, ignoring!! 2020-12-16 08:50:23 DEBUG: Handling data: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 08:50:23 DEBUG: Processing: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 08:50:23 DEBUG: Frame check failed, ignoring!! 2020-12-16 08:50:25 DEBUG: Handling data: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 08:50:25 DEBUG: Processing: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 08:50:25 DEBUG: Frame check failed, ignoring!!

Excellent, this is progress. I see similar messages. Have you tried the original semp-tcp.py?

Maikel-K commented 3 years ago

Hi Niels,

i checked it, following is coming by. I checked the solaredge app, and i have seen that there where values above the house icon and the grid was showing 0 0,39 kw production, 0.39 kw load(house) 0.0kw export.

So i think the script is running, but now the app isnt updating anymore but the website isnt updating too so maybe something is going on at the SolarEdge server at the moment.

pi@raspberrypi4:~/eastronsolaredgetcp $ python3 semp-tcp.py 2020-12-16 13:47:30 DEBUG: [1234, 0, 5, 5, 5, 5, 0, 0, 0, 15, 1, 10000, 10000, 10000, 64536, 64536, 64536, 1500, 120, 0, 0, 20000, 0] 2020-12-16 13:47:30 DEBUG: setValues[3] 1601:23 2020-12-16 13:47:30 DEBUG: [0, 2, 4, 0, 0, 5] 2020-12-16 13:47:30 DEBUG: setValues[3] 1651:6 2020-12-16 13:47:30 DEBUG: [4614, 15, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 2020-12-16 13:47:30 DEBUG: setValues[3] 1701:23 2020-12-16 13:47:30 INFO: Created <Thread(t_update_2, initial)>: meter1 sdm630 SDM630(192.168.1.108:8899, connectionType.TCP: timeout=1, retries=3, unit=0x1) 2020-12-16 13:47:31 INFO: Starting <Thread(t_update_2, started 3053786208)> 2020-12-16 13:47:31 DEBUG: Current transaction state - IDLE 2020-12-16 13:47:31 DEBUG: Running transaction 1 2020-12-16 13:47:31 DEBUG: SEND: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x0 0x0 0x50 2020-12-16 13:47:31 DEBUG: New Transaction state 'SENDING' 2020-12-16 13:47:31 DEBUG: Changing transaction state from 'SENDING' to 'WAITING FOR REPLY' 2020-12-16 13:47:31 DEBUG: Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY' 2020-12-16 13:47:31 DEBUG: RECV: 0x0 0x1 0x0 0x0 0x0 0xa3 0x1 0x4 0xa0 0x43 0x6a 0x81 0x69 0x43 0x6a 0x7c 0x13 0x43 0x68 0x9a 0x3f 0x3f 0x11 0x67 0x50 0x3f 0x87 0x5e 0x4c 0x3e 0x7c 0xc 0x2d 0x43 0x2 0x73 0x89 0xc3 0x6e 0xa2 0xff 0x42 0x5e 0x53 0x6b 0x43 0x5 0xa1 0x6c 0x43 0x77 0x59 0x41 0x42 0x63 0xcc 0xe7 0x41 0xe7 0xce 0x14 0xc2 0x82 0x22 0xf9 0xc1 0x46 0x90 0x8a 0x3f 0x79 0xe8 0xce 0xbf 0x76 0xfb 0xbc 0x3f 0x79 0xd9 0x6 0x41 0x48 0x62 0x80 0x43 0x43 0x40 0xc5 0xc1 0x49 0x66 0x7f 0x43 0x69 0xf0 0x50 0x0 0x0 0x0 0x0 0x3f 0x1f 0x7c 0x1f 0x3f 0xef 0x3a 0x2f 0x0 0x0 0x0 0x0 0xc2 0x52 0x6a 0x6d 0x0 0x0 0x0 0x0 0x42 0x8f 0x1a 0xb4 0x0 0x0 0x0 0x0 0xc2 0x42 0x3 0xa 0xbf 0x3c 0x34 0xf4 0x0 0x0 0x0 0x0 0x43 0x5e 0xae 0x33 0x0 0x0 0x0 0x0 0x42 0x47 0xc8 0x86 0x44 0x5 0xf7 0x5c 0x42 0x7f 0xe3 0x53 0x42 0x96 0xdd 0x2f 0x43 0x3 0x96 0x45 2020-12-16 13:47:31 DEBUG: Processing: 0x0 0x1 0x0 0x0 0x0 0xa3 0x1 0x4 0xa0 0x43 0x6a 0x81 0x69 0x43 0x6a 0x7c 0x13 0x43 0x68 0x9a 0x3f 0x3f 0x11 0x67 0x50 0x3f 0x87 0x5e 0x4c 0x3e 0x7c 0xc 0x2d 0x43 0x2 0x73 0x89 0xc3 0x6e 0xa2 0xff 0x42 0x5e 0x53 0x6b 0x43 0x5 0xa1 0x6c 0x43 0x77 0x59 0x41 0x42 0x63 0xcc 0xe7 0x41 0xe7 0xce 0x14 0xc2 0x82 0x22 0xf9 0xc1 0x46 0x90 0x8a 0x3f 0x79 0xe8 0xce 0xbf 0x76 0xfb 0xbc 0x3f 0x79 0xd9 0x6 0x41 0x48 0x62 0x80 0x43 0x43 0x40 0xc5 0xc1 0x49 0x66 0x7f 0x43 0x69 0xf0 0x50 0x0 0x0 0x0 0x0 0x3f 0x1f 0x7c 0x1f 0x3f 0xef 0x3a 0x2f 0x0 0x0 0x0 0x0 0xc2 0x52 0x6a 0x6d 0x0 0x0 0x0 0x0 0x42 0x8f 0x1a 0xb4 0x0 0x0 0x0 0x0 0xc2 0x42 0x3 0xa 0xbf 0x3c 0x34 0xf4 0x0 0x0 0x0 0x0 0x43 0x5e 0xae 0x33 0x0 0x0 0x0 0x0 0x42 0x47 0xc8 0x86 0x44 0x5 0xf7 0x5c 0x42 0x7f 0xe3 0x53 0x42 0x96 0xdd 0x2f 0x43 0x3 0x96 0x45 2020-12-16 13:47:31 DEBUG: Factory Response[ReadInputRegistersResponse: 4] 2020-12-16 13:47:31 DEBUG: Adding transaction 1 2020-12-16 13:47:31 DEBUG: Getting transaction 1 2020-12-16 13:47:31 DEBUG: Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE' 2020-12-16 13:47:31 DEBUG: [17258, 33129, 17258, 31763, 17256, 39487, 16145, 26448, 16263, 24140, 15996, 3117, 17154, 29577, 50030, 41727, 16990, 21355, 17157, 41324, 17271, 22849, 16995, 52455, 16871, 52756, 49794, 8953, 49478, 37002, 16249, 59598, 49014, 64444, 16249, 55558, 16712, 25216, 17219, 16581, 49481, 26239, 17257, 61520, 0, 0, 16159, 31775, 16367, 14895, 0, 0, 49746, 27245, 0, 0, 17039, 6836, 0, 0, 49730, 778, 48956, 13556, 0, 0, 17246, 44595, 0, 0, 16967, 51334, 17413, 63324, 17023, 58195, 17046, 56623, 17155, 38469] 2020-12-16 13:47:31 DEBUG: [b'Cj', b'\x81i'] 2020-12-16 13:47:31 DEBUG: [b'Cj', b'|\x13'] 2020-12-16 13:47:31 DEBUG: [b'Ch', b'\x9a?'] 2020-12-16 13:47:31 DEBUG: [b'?\x11', b'gP'] 2020-12-16 13:47:31 DEBUG: [b'?\x87', b'^L'] 2020-12-16 13:47:31 DEBUG: [b'>|', b'\x0c-'] 2020-12-16 13:47:31 DEBUG: [b'C\x02', b's\x89'] 2020-12-16 13:47:31 DEBUG: [b'\xc3n', b'\xa2\xff'] 2020-12-16 13:47:31 DEBUG: [b'B^', b'Sk'] 2020-12-16 13:47:31 DEBUG: [b'C\x05', b'\xa1l'] 2020-12-16 13:47:31 DEBUG: [b'Cw', b'YA'] 2020-12-16 13:47:31 DEBUG: [b'Bc', b'\xcc\xe7'] 2020-12-16 13:47:31 DEBUG: [b'A\xe7', b'\xce\x14'] 2020-12-16 13:47:31 DEBUG: [b'\xc2\x82', b'"\xf9'] 2020-12-16 13:47:31 DEBUG: [b'\xc1F', b'\x90\x8a'] 2020-12-16 13:47:31 DEBUG: [b'?y', b'\xe8\xce'] 2020-12-16 13:47:31 DEBUG: [b'\xbfv', b'\xfb\xbc'] 2020-12-16 13:47:31 DEBUG: [b'?y', b'\xd9\x06'] 2020-12-16 13:47:31 DEBUG: [b'AH', b'b\x80'] 2020-12-16 13:47:31 DEBUG: [b'CC', b'@\xc5'] 2020-12-16 13:47:31 DEBUG: [b'\xc1I', b'f\x7f'] 2020-12-16 13:47:31 DEBUG: [b'Ci', b'\xf0P'] 2020-12-16 13:47:31 DEBUG: [b'?\x1f', b'|\x1f'] 2020-12-16 13:47:31 DEBUG: [b'?\xef', b':/'] 2020-12-16 13:47:31 DEBUG: [b'\xc2R', b'jm'] 2020-12-16 13:47:31 DEBUG: [b'B\x8f', b'\x1a\xb4'] 2020-12-16 13:47:31 DEBUG: [b'\xc2B', b'\x03\n'] 2020-12-16 13:47:31 DEBUG: [b'\xbf<', b'4\xf4'] 2020-12-16 13:47:31 DEBUG: [b'C^', b'\xae3'] 2020-12-16 13:47:31 DEBUG: [b'BG', b'\xc8\x86'] 2020-12-16 13:47:31 DEBUG: [b'D\x05', b'\xf7\'] 2020-12-16 13:47:31 DEBUG: [b'B\x7f', b'\xe3S'] 2020-12-16 13:47:31 DEBUG: [b'B\x96', b'\xdd/'] 2020-12-16 13:47:31 DEBUG: [b'C\x03', b'\x96E'] 2020-12-16 13:47:31 DEBUG: Current transaction state - TRANSACTION_COMPLETE 2020-12-16 13:47:31 DEBUG: Running transaction 2 2020-12-16 13:47:31 DEBUG: SEND: 0x0 0x2 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x50 0x0 0x1c 2020-12-16 13:47:31 DEBUG: New Transaction state 'SENDING' 2020-12-16 13:47:31 DEBUG: Changing transaction state from 'SENDING' to 'WAITING FOR REPLY' 2020-12-16 13:47:32 DEBUG: Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY' 2020-12-16 13:47:32 DEBUG: RECV: 0x0 0x2 0x0 0x0 0x0 0x3b 0x1 0x4 0x38 0x44 0x1e 0xa3 0x94 0x45 0x48 0x5a 0xc8 0xc2 0x97 0xc 0xfe 0x45 0x73 0x93 0xc2 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x43 0x51 0xd0 0xde 0x45 0x73 0xd8 0x2b 0x3f 0x93 0x54 0x2 0x41 0x1c 0xbf 0x47 2020-12-16 13:47:32 DEBUG: Processing: 0x0 0x2 0x0 0x0 0x0 0x3b 0x1 0x4 0x38 0x44 0x1e 0xa3 0x94 0x45 0x48 0x5a 0xc8 0xc2 0x97 0xc 0xfe 0x45 0x73 0x93 0xc2 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x43 0x51 0xd0 0xde 0x45 0x73 0xd8 0x2b 0x3f 0x93 0x54 0x2 0x41 0x1c 0xbf 0x47 2020-12-16 13:47:32 DEBUG: Factory Response[ReadInputRegistersResponse: 4] 2020-12-16 13:47:32 DEBUG: Adding transaction 2 2020-12-16 13:47:32 DEBUG: Getting transaction 2 2020-12-16 13:47:32 DEBUG: Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE' 2020-12-16 13:47:32 DEBUG: [17438, 41876, 17736, 23240, 49815, 3326, 17779, 37826, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17233, 53470, 17779, 55339, 16275, 21506, 16668, 48967] 2020-12-16 13:47:32 DEBUG: [b'D\x1e', b'\xa3\x94'] 2020-12-16 13:47:32 DEBUG: [b'EH', b'Z\xc8'] 2020-12-16 13:47:32 DEBUG: [b'\xc2\x97', b'\x0c\xfe'] 2020-12-16 13:47:32 DEBUG: [b'Es', b'\x93\xc2'] 2020-12-16 13:47:32 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-16 13:47:32 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-16 13:47:32 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-16 13:47:32 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-16 13:47:32 DEBUG: [b'CQ', b'\xd0\xde'] 2020-12-16 13:47:32 DEBUG: [b'Es', b'\xd8+'] 2020-12-16 13:47:32 DEBUG: [b'?\x93', b'T\x02'] 2020-12-16 13:47:32 DEBUG: [b'A\x1c', b'\xbfG'] 2020-12-16 13:47:32 DEBUG: Current transaction state - TRANSACTION_COMPLETE 2020-12-16 13:47:32 DEBUG: Running transaction 3 2020-12-16 13:47:32 DEBUG: SEND: 0x0 0x3 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0xc8 0x0 0x46 2020-12-16 13:47:32 DEBUG: New Transaction state 'SENDING' 2020-12-16 13:47:32 DEBUG: Changing transaction state from 'SENDING' to 'WAITING FOR REPLY' 2020-12-16 13:47:32 DEBUG: Started thread to serve client at ('192.168.1.115', 2830) 2020-12-16 13:47:32 DEBUG: Client Connected [192.168.1.115:2830] 2020-12-16 13:47:32 DEBUG: Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY' 2020-12-16 13:47:32 DEBUG: RECV: 0x0 0x3 0x0 0x0 0x0 0x8f 0x1 0x4 0x8c 0x43 0xcb 0x31 0x6f 0x43 0xca 0x53 0xc5 0x43 0xca 0x63 0xac 0x43 0xca 0xa2 0xf5 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x3f 0x34 0x8b 0x78 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x40 0x7e 0x3 0x9d 0x40 0x7f 0x69 0x98 0x40 0x7f 0x97 0x63 0x42 0x29 0x14 0xb6 0x42 0x69 0xdc 0x92 0x42 0xac 0x27 0xa6 0x0 0x0 0x0 0x0 0x40 0x81 0x70 0x2e 0x42 0x77 0x6a 0xd6 0x0 0x0 0x0 0x0 0x43 0x5f 0xbd 0x99 0x0 0x0 0x0 0x0 0x3f 0x23 0x47 0x94 0x3f 0xb4 0xea 0xac 0x3f 0xd 0x35 0x9a 0x40 0xe3 0x6 0x14 0x40 0xc1 0xb6 0x94 0x41 0x2a 0x37 0x25 2020-12-16 13:47:32 DEBUG: Processing: 0x0 0x3 0x0 0x0 0x0 0x8f 0x1 0x4 0x8c 0x43 0xcb 0x31 0x6f 0x43 0xca 0x53 0xc5 0x43 0xca 0x63 0xac 0x43 0xca 0xa2 0xf5 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x3f 0x34 0x8b 0x78 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x40 0x7e 0x3 0x9d 0x40 0x7f 0x69 0x98 0x40 0x7f 0x97 0x63 0x42 0x29 0x14 0xb6 0x42 0x69 0xdc 0x92 0x42 0xac 0x27 0xa6 0x0 0x0 0x0 0x0 0x40 0x81 0x70 0x2e 0x42 0x77 0x6a 0xd6 0x0 0x0 0x0 0x0 0x43 0x5f 0xbd 0x99 0x0 0x0 0x0 0x0 0x3f 0x23 0x47 0x94 0x3f 0xb4 0xea 0xac 0x3f 0xd 0x35 0x9a 0x40 0xe3 0x6 0x14 0x40 0xc1 0xb6 0x94 0x41 0x2a 0x37 0x25 2020-12-16 13:47:32 DEBUG: Factory Response[ReadInputRegistersResponse: 4] 2020-12-16 13:47:32 DEBUG: Adding transaction 3 2020-12-16 13:47:32 DEBUG: Getting transaction 3 2020-12-16 13:47:32 DEBUG: Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE' 2020-12-16 13:47:32 DEBUG: [17355, 12655, 17354, 21445, 17354, 25516, 17354, 41717, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16180, 35704, 0, 0, 0, 0, 0, 0, 0, 0, 16510, 925, 16511, 27032, 16511, 38755, 16937, 5302, 17001, 56466, 17068, 10150, 0, 0, 16513, 28718, 17015, 27350, 0, 0, 17247, 48537, 0, 0, 16163, 18324, 16308, 60076, 16141, 13722, 16611, 1556, 16577, 46740, 16682, 14117] 2020-12-16 13:47:32 DEBUG: [b'C\xcb', b'1o'] 2020-12-16 13:47:32 DEBUG: [b'C\xca', b'S\xc5'] 2020-12-16 13:47:32 DEBUG: [b'C\xca', b'c\xac'] 2020-12-16 13:47:32 DEBUG: [b'C\xca', b'\xa2\xf5'] 2020-12-16 13:47:32 DEBUG: [b'?4', b'\x8bx'] 2020-12-16 13:47:32 DEBUG: [b'@~', b'\x03\x9d'] 2020-12-16 13:47:32 DEBUG: [b'@\x7f', b'i\x98'] 2020-12-16 13:47:32 DEBUG: [b'@\x7f', b'\x97c'] 2020-12-16 13:47:32 DEBUG: [b'B)', b'\x14\xb6'] 2020-12-16 13:47:32 DEBUG: [b'Bi', b'\xdc\x92'] 2020-12-16 13:47:32 DEBUG: [b'B\xac', b"'\xa6"] 2020-12-16 13:47:32 DEBUG: [b'@\x81', b'p.'] 2020-12-16 13:47:32 DEBUG: [b'Bw', b'j\xd6'] 2020-12-16 13:47:32 DEBUG: [b'?#', b'G\x94'] 2020-12-16 13:47:32 DEBUG: [b'?\xb4', b'\xea\xac'] 2020-12-16 13:47:32 DEBUG: [b'?\r', b'5\x9a'] 2020-12-16 13:47:32 DEBUG: [b'@\xe3', b'\x06\x14'] 2020-12-16 13:47:32 DEBUG: [b'@\xc1', b'\xb6\x94'] 2020-12-16 13:47:32 DEBUG: [b'A*', b'7%'] 2020-12-16 13:47:32 DEBUG: Current transaction state - TRANSACTION_COMPLETE 2020-12-16 13:47:32 DEBUG: Running transaction 4 2020-12-16 13:47:32 DEBUG: SEND: 0x0 0x4 0x0 0x0 0x0 0x6 0x1 0x4 0x1 0x4e 0x0 0xc 2020-12-16 13:47:32 DEBUG: New Transaction state 'SENDING' 2020-12-16 13:47:32 DEBUG: Changing transaction state from 'SENDING' to 'WAITING FOR REPLY' 2020-12-16 13:47:33 DEBUG: Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY' 2020-12-16 13:47:33 DEBUG: RECV: 0x0 0x4 0x0 0x0 0x0 0x1b 0x1 0x4 0x18 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x44 0x15 0xf5 0xa1 0x43 0x4f 0x4 0xdd 2020-12-16 13:47:33 DEBUG: Processing: 0x0 0x4 0x0 0x0 0x0 0x1b 0x1 0x4 0x18 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x44 0x15 0xf5 0xa1 0x43 0x4f 0x4 0xdd 2020-12-16 13:47:33 DEBUG: Factory Response[ReadInputRegistersResponse: 4] 2020-12-16 13:47:33 DEBUG: Adding transaction 4 2020-12-16 13:47:33 DEBUG: Getting transaction 4 2020-12-16 13:47:33 DEBUG: Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE' 2020-12-16 13:47:33 DEBUG: [0, 0, 0, 0, 0, 0, 0, 0, 17429, 62881, 17231, 1245] 2020-12-16 13:47:33 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-16 13:47:33 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-16 13:47:33 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-16 13:47:33 DEBUG: [b'\x00\x00', b'\x00\x00'] 2020-12-16 13:47:33 DEBUG: [b'D\x15', b'\xf5\xa1'] 2020-12-16 13:47:33 DEBUG: [b'CO', b'\x04\xdd'] 2020-12-16 13:47:33 DEBUG: [62881, 17429, 63324, 17413, 62881, 17429, 63324, 17413, 27245, 49746, 29577, 17154, 41727, 50030, 21355, 16990, 61520, 17257, 33129, 17258, 31763, 17258, 39487, 17256, 41717, 17354, 12655, 17355, 21445, 17354, 25516, 17354, 51334, 16967] 2020-12-16 13:47:33 DEBUG: setValues[3] 1001:34 2020-12-16 13:47:33 DEBUG: [62881, 17429, 0, 0, 0, 0, 63324, 17413, 0, 0, 0, 0, 58195, 17023, 58195, 17023, 58195, 17023, 0, 0, 0, 0, 1245, 17231, 1245, 17231, 0, 0, 0, 0, 41876, 17438, 41876, 17438, 0, 0, 0, 0, 13556, 48956, 59598, 16249, 64444, 49014, 55558, 16249, 778, 49730, 52756, 16871, 8953, 49794, 37002, 49478, 6836, 17039, 41324, 17157, 22849, 17271, 52455, 16995, 26448, 16145, 24140, 16263, 3117, 15996, 3326, 49815, 0, 0, 0, 0, 53470, 17233, 37367, 17173, 46640, 17317, 19881, 17152] 2020-12-16 13:47:33 DEBUG: setValues[3] 1101:82 2020-12-16 13:47:34 DEBUG: Handling data: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 13:47:34 DEBUG: Processing: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 13:47:34 DEBUG: Frame check failed, ignoring!! 2020-12-16 13:47:36 DEBUG: Handling data: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 13:47:36 DEBUG: Processing: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 13:47:36 DEBUG: Frame check failed, ignoring!! 2020-12-16 13:47:38 DEBUG: Current transaction state - TRANSACTION_COMPLETE 2020-12-16 13:47:38 DEBUG: Running transaction 5 2020-12-16 13:47:38 DEBUG: SEND: 0x0 0x5 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x0 0x0 0x50 2020-12-16 13:47:38 DEBUG: New Transaction state 'SENDING' 2020-12-16 13:47:38 DEBUG: Changing transaction state from 'SENDING' to 'WAITING FOR REPLY' 2020-12-16 13:47:38 DEBUG: Handling data: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 13:47:38 DEBUG: Processing: 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab 2020-12-16 13:47:38 DEBUG: Frame check failed, ignoring!! 2020-12-16 13:47:38 DEBUG: Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY' 2020-12-16 13:47:38 DEBUG: RECV: 0x0 0x5 0x0 0x0 0x0 0xa3 0x1 0x4 0xa0 0x43 0x6a 0xb0 0xae 0x43 0x6a 0xe8 0x75 0x43 0x69 0x45 0x8e 0x3f 0x11 0x11 0xce 0x3f 0x85 0xc9 0x5e 0x3e 0x7b 0x2d 0xa9 0x43 0x1 0xda 0x9 0xc3 0x6e 0xa2 0x4c 0x42 0x5f 0x7a 0x87 0x43 0x4 0xfe 0xa5 0x43 0x75 0x88 0xc3 0x42 0x64 0xe0 0xcd 0x41 0xe5 0xf0 0xa5 0xc2 0x67 0x33 0x9d 0xc1 0x45 0xaf 0xde 0x3f 0x79 0xf3 0x36 0xbf 0x78 0xce 0x3d 0x3f 0x79 0xf5 0xed 0x41 0x47 0xb6 0x58 0x43 0x41 0x9d 0xda 0xc1 0x47 0x89 0x57 0x43 0x6a 0x4a 0xe8 0x0 0x0 0x0 0x0 0x3f 0x1e 0x7a 0xa6 0x3f 0xed 0xb7 0xfa 0x0 0x0 0x0 0x0 0xc2 0x53 0xa6 0x85 0x0 0x0 0x0 0x0 0x42 0x86 0x62 0x78 0x0 0x0 0x0 0x0 0xc2 0x25 0xa7 0x42 0xbf 0x49 0x98 0x49 0x0 0x0 0x0 0x0 0x43 0x5e 0xc0 0xfc 0x0 0x0 0x0 0x0 0x42 0x47 0x9c 0xbc 0x44 0x5 0xf7 0x7c 0x42 0x7f 0xe4 0x5a 0x42 0x96 0xdd 0x2f 0x43 0x3 0x96 0x45 2020-12-16 13:47:38 DEBUG: Processing: 0x0 0x5 0x0 0x0 0x0 0xa3 0x1 0x4 0xa0 0x43 0x6a 0xb0 0xae 0x43 0x6a 0xe8 0x75 0x43 0x69 0x45 0x8e 0x3f 0x11 0x11 0xce 0x3f 0x85 0xc9 0x5e 0x3e 0x7b 0x2d 0xa9 0x43 0x1 0xda 0x9 0xc3 0x6e 0xa2 0x4c 0x42 0x5f 0x7a 0x87 0x43 0x4 0xfe 0xa5 0x43 0x75 0x88 0xc3 0x42 0x64 0xe0 0xcd 0x41 0xe5 0xf0 0xa5 0xc2 0x67 0x33 0x9d 0xc1 0x45 0xaf 0xde 0x3f 0x79 0xf3 0x36 0xbf 0x78 0xce 0x3d 0x3f 0x79 0xf5 0xed 0x41 0x47 0xb6 0x58 0x43 0x41 0x9d 0xda 0xc1 0x47 0x89 0x57 0x43 0x6a 0x4a 0xe8 0x0 0x0 0x0 0x0 0x3f 0x1e 0x7a 0xa6 0x3f 0xed 0xb7 0xfa 0x0 0x0 0x0 0x0 0xc2 0x53 0xa6 0x85 0x0 0x0 0x0 0x0 0x42 0x86 0x62 0x78 0x0 0x0 0x0 0x0 0xc2 0x25 0xa7 0x42 0xbf 0x49 0x98 0x49 0x0 0x0 0x0 0x0 0x43 0x5e 0xc0 0xfc 0x0 0x0 0x0 0x0 0x42 0x47 0x9c 0xbc 0x44 0x5 0xf7 0x7c 0x42 0x7f 0xe4 0x5a 0x42 0x96 0xdd 0x2f 0x43 0x3 0x96 0x45 2020-12-16 13:47:38 DEBUG: Factory Response[ReadInputRegistersResponse: 4] 2020-12-16 13:47:38 DEBUG: Adding transaction 5 2020-12-16 13:47:38 DEBUG: Getting transaction 5 2020-12-16 13:47:38 DEBUG: Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTIONCOMPLETE' 2020-12-16 13:47:38 DEBUG: [17258, 45230, 17258, 59509, 17257, 17806, 16145, 4558, 16261, 51550, 15995, 11689, 17153, 55817, 50030, 41548, 16991, 31367, 17156, 65189, 17269, 35011, 16996, 57549, 16869, 61605, 49767, 13213, 49477, 45022, 16249, 62262, 49016, 52797, 16249, 62957, 16711, 46680, 17217, 40410, 49479, 35159, 17258, 19176, 0, 0, 16158, 31398, 16365, 47098, 0, 0, 49747, 42629, 0, 0, 17030, 25208, 0, 0, 49701, 42818, 48969, 38985, 0, 0, 17246, 49404, 0, 0, 16967, 40124, 17413, 63356, 17023, 58458, 17046, 56623, 17155, 38469] 2020-12-16 13:47:38 DEBUG: [b'Cj', b'\xb0\xae'] 2020-12-16 13:47:38 DEBUG: [b'Cj', b'\xe8u'] 2020-12-16 13:47:38 DEBUG: [b'Ci', b'E\x8e'] 2020-12-16 13:47:38 DEBUG: [b'?\x11', b'\x11\xce'] 2020-12-16 13:47:38 DEBUG: [b'?\x85', b'\xc9^'] 2020-12-16 13:47:38 DEBUG: [b'>{', b'-\xa9'] 2020-12-16 13:47:38 DEBUG: [b'C\x01', b'\xda\t'] 2020-12-16 13:47:38 DEBUG: [b'\xc3n', b'\xa2L'] 2020-12-16 13:47:38 DEBUG: [b'B', b'z\x87'] 2020-12-16 13:47:38 DEBUG: [b'C\x04', b'\xfe\xa5'] 2020-12-16 13:47:38 DEBUG: [b'Cu', b'\x88\xc3'] 2020-12-16 13:47:38 DEBUG: [b'Bd', b'\xe0\xcd'] 2020-12-16 13:47:38 DEBUG: [b'A\xe5', b'\xf0\xa5'] 2020-12-16 13:47:38 DEBUG: [b'\xc2g', b'3\x9d'] 2020-12-16 13:47:38 DEBUG: [b'\xc1E', b'\xaf\xde'] 2020-12-16 13:47:38 DEBUG: [b'?y', b'\xf36'] 2020-12-16 13:47:38 DEBUG: [b'\xbfx', b'\xce='] 2020-12-16 13:47:38 DEBUG: [b'?y', b'\xf5\xed'] 2020-12-16 13:47:38 DEBUG: [b'AG', b'\xb6X'] 2020-12-16 13:47:38 DEBUG: [b'CA', b'\x9d\xda'] 2020-12-16 13:47:38 DEBUG: [b'\xc1G', b'\x89W'] 2020-12-16 13:47:38 DEBUG: [b'Cj', b'J\xe8'] 2020-12-16 13:47:38 DEBUG: [b'?\x1e', b'z\xa6'] 2020-12-16 13:47:38 DEBUG: [b'?\xed', b'\xb7\xfa'] 2020-12-16 13:47:38 DEBUG: [b'\xc2S', b'\xa6\x85'] 2020-12-16 13:47:38 DEBUG: [b'B\x86', b'bx'] 2020-12-16 13:47:38 DEBUG: [b'\xc2%', b'\xa7B'] 2020-12-16 13:47:38 DEBUG: [b'\xbfI', b'\x98I'] 2020-12-16 13:47:38 DEBUG: [b'C^', b'\xc0\xfc'] 2020-12-16 13:47:38 DEBUG: [b'BG', b'\x9c\xbc'] 2020-12-16 13:47:38 DEBUG: [b'D\x05', b'\xf7|'] 2020-12-16 13:47:38 DEBUG: [b'B\x7f', b'\xe4Z'] 2020-12-16 13:47:38 DEBUG: [b'B\x96', b'\xdd/'] 2020-12-16 13:47:38 DEBUG: [b'C\x03', b'\x96E'] 2020-12-16 13:47:38 DEBUG: Current transaction state - TRANSACTION_COMPLETE 2020-12-16 13:47:38 DEBUG: Running transaction 6

nmakel commented 3 years ago

You're still getting Frame check failed, ignoring!! errors. This means the inverter messages are corrupt or invalid and not being processed. The gateway is forwarding something, but not quite correctly. Are there any options set that add tags or something similar to the messages?

You're seeing 0x2 0x3 0x6 0x40 0x0 0x17 0x4 0xab, where 0x2 is the address, 0x3 is read holding registers, and so on. So it looks like a valid message, but there is stuff added to the end which doesn't make sense.

You will need to switch back to the test script and fiddle with the gateway options until you stop getting the error and requests more like this:

2020-12-14 17:00:28 DEBUG: Getting Frame - 0x3 0x3 0xf2 0x0 0x6
2020-12-14 17:00:28 DEBUG: Factory Request[ReadHoldingRegistersRequest: 3]
2020-12-14 17:00:28 DEBUG: Frame advanced, resetting header!!
Maikel-K commented 3 years ago

So seeing data with 0x2 0x3 is at least good, now we need to fine tune like you said.....

Mm wonder what to check. I hope I have some time tonight!

Maikel-K commented 3 years ago

I tried many different settings in the serial port part of the gateway but the only thing putting the data stream back to 0x0 data is the baud rate. changing data bits and stopbits are still giving 0x02 data etc.

nmakel commented 3 years ago

The serial settings of the gateway should be baud 9600, 8 data bits, 1 stop bit, no parity. These are the settings of the device we want to emulate, the wattnode meter, which is what the solaredge inverter expects and will use to connect.

The documentation of this rs485-wifi gateway is rubbish -- there literally isn't a complete or correct english sentence in any of the documents. Not much I can recommend other than that you experiment with the various protocol and buffer settings.

The test script will show you when you've found the right combination.

Maikel-K commented 3 years ago

would this make any sense? found it somewhere in a github post

from pymodbus.transaction import ModbusRtuFramer client = ModbusClient('192.168.0.7', port=8899, framer=ModbusRtuFramer)

nmakel commented 3 years ago

Give it a try, but as far as I know the framer property only works on serial clients and servers. You can try adding it to the StartTcpServer function in the test script.

Maikel-K commented 3 years ago

Hi Niels,

So i didnt had a lot of time the last days but i want to inform you about the following: If the RS485-Ethernet dongle is setup as server i can run the script to retrieve data from the inverter which in my opinion means the inverter is working and connected correctly. The issue is, as i can figure it out, the part when the inverter needs to be a client.

Is it possible to run the script below as "server" and then request the information again with the dongle as client?

python3 exampletcp.py 192.168.1.115 8899 Inverter(192.168.1.115:8899, connectionType.TCP: timeout=1, retries=3, unit=0x1):

Registers: Model: SE3500 Status: Sleeping Temperature: 20.69°C Voltage: 229.00V Power: 0.00W

With script:

!/usr/bin/env python3

import argparse import solaredge_modbus

if name == "main": argparser = argparse.ArgumentParser() argparser.add_argument("host", type=str, help="ModbusTCP address") argparser.add_argument("port", type=int, help="ModbusTCP port") argparser.add_argument("--timeout", type=int, default=1, help="Connection timeout") argparser.add_argument("--unit", type=int, default=1, help="Modbus unit") argparser.add_argument("--json", action="store_true", default=False, help="Output as JSON") args = argparser.parse_args()

inverter = solaredge_modbus.Inverter(
    host=args.host,
    port=args.port,
    timeout=args.timeout,
    unit=args.unit
)

values = {}
values = inverter.read_all()

if args.json:
    print(json.dumps(values, indent=4))
else:
    print(f"{inverter}:")
    print("\nRegisters:")

    print(f"\tModel: {values['c_model']}")
    print(f"\tStatus: {solaredge_modbus.INVERTER_STATUS_MAP[values['status']]}")
    print(f"\tTemperature: {(values['temperature'] * (10 ** values['temperature_scale'])):.2f}{inverter.registers['temperature'][6]}")

    if values['c_sunspec_did'] is solaredge_modbus.sunspecDID.THREE_PHASE_INVERTER:
        print(f"\tPhase 1 Current: {(values['p1_current'] * (10 ** values['current_scale'])):.2f}{inverter.registers['p1_current'][6]}")
    else:
        print(f"\tVoltage: {(values['p1_voltage'] * (10 ** values['voltage_scale'])):.2f}{inverter.registers['p1_voltage'][6]}")

    print(f"\tPower: {(values['power_ac'] * (10 ** values['power_ac_scale'])):.2f}{inverter.registers['power_ac'][6]}")
nmakel commented 3 years ago

Is it possible to run the script below as "server" and then request the information again with the dongle as client?

I'm not quite sure what you're suggesting. When the inverter RS485 port is configured for "Non-Solaredge Logger" it acts as a server, which means a client can get the values like those in the script you posted. When you set the inverter RS485 port to "Modbus multi-device" the inverter will try to connect to other modbus devices as a client. If you want the inverter to get information from a meter it needs to be in "Modbus multi-device" configuration, and will always be a client.

Maikel-K commented 3 years ago

Okay that's clear, in multi device mode it's a client not a server.

Mmm than I really need to find out WHY it's not working. I need to see if I can make some kind of test setup which will reply what I send to it.

Maybe any tips on that?