jbuehl / solaredge

SolarEdge inverter logging data capture
GNU General Public License v3.0
288 stars 60 forks source link

Remote serial converter #178

Closed eriksl closed 12 months ago

eriksl commented 1 year ago

Hi!

Not an issue but a feature request, I am not sure if this is easy to implement. I am a noob at Python otherwise I'd probably do it myself! The request is to be able to be able to use a network socket instead of a serial port for rs485 (would be nice if both tcp and udp would be supported). My esp8266's have serial port forwarding, then it's only a matter of connecting a rs232<->rs485 converter and I can do away with the energy hogging laptop for this purpose.

Would be very nice, thanks in advance!

jbuehl commented 1 year ago

Depending on what you want to run in your esp8266 there are a couple of ways to do it. You could use a utility such as socat that creates a virtual serial port on the device that you are running semonitor and forwards the messages to a port on the esp. Or you could run semonitor in network mode (-t n) and write code for the esp which would make a tcp connection to port 22222 on the semonitor device and forward the messages that way.

eriksl commented 1 year ago

That's a great idea. I am familiar with SOCAT but I didn't realize it can emulate a serial port.

Are the messages on port 22222 exactly the same?

BTW the firmware on the ESP8266 is something I develop myself, so there are some possibilities to be creative there if necessary :-) The only worry I have is that I currently do not allocate very much ram for serial port buffering, so it may not be able to keep up with the rather large messages (it seems). We'll cross that bridge when we come to it, the UART won't be the problem, it can handle up to 80 Mbps...

If I get the UTP cable (12 meters) working after all, this all may not be necessary. Fingers crossed. I just read something about termination on two sides, I only did one side...

jbuehl commented 1 year ago

After thinking about this more, the method using the virtual serial port is definitely the easier way to go as it would not require any code changes, whereas the other way would require either semonitor to add the RS485 master grant messages to network mode or for the ESP to handle those messages, which would be non-trivial.

I would suggest using UDP for the network connection rather than TCP because the solaredge protocol already handles error detection and retries, so the extra reliability of TCP is redundant. Also I don't know what would happen if socat loses a socket connection. You might wind up having to wrap it in something to handle reconnections.

eriksl commented 1 year ago

In the end I might be implementing the whole protocol in the ESP itself, that would be most robust I guess. At the moment I can use both UDP and TCP and I found TCP isn't really that heavier than UDP on the ESP. It has the advantage though that record boundaries are preserved and inside lwip the data isn't queue but sent immediately.

For the moment I am now using a small laptop for this purpose (which runs semonitor itself). I am not yet sure which way to go. My findings until now:

Also I keep getting master ack timeouts. I already tried several workarounds, none work:

The only things I can think of

In the meantime I am fetching the "general" data using tcp modbus and that really works like a charm. Request info and get it back instantly, no delay whatsoever. If only they had added optimiser data there...

Thanks for sharing your thoughts!

jbuehl commented 1 year ago

I'm inclined to think it's a software issue rather than a RS-485 electrical problem. I would expect that you would be seeing a lot of messages about checksum and length errors if it were the latter. The master ack timeout means that semonitor just isn't seeing any response when it polls the inverter. It's possible that the hardware you are running semonitor on is too slow to catch the response from the inverter. I wouldn't rule out a bug in semonitor either. You could try decreasing the value of MASTER_MSG_INTERVAL in semonitor.py to cause it to poll more often which should speed things up but not necessarily fix the timeout problem.

Can you run semonitor with the -vvv option and post the debug output here?

eriksl commented 1 year ago

Thanks for your interest!

I don't think "slow" hardware is the issue, I tried on both a nettop (atom CPU) and a laptop (core i5 CPU).

I am now running with -vvvv (four times, I will append some of the output (it has been running for over a day now...)

Interesting option this MASTER_MSG_INTERVAL, will try!

At the moment I also have another issue (which is not really semonitor related: my inverter keeps resetting the time/date to 2019-12-12/00:00. I now have one day worth of usable data, which already show very interesting things, I might not be persueing this path in the end, if I can't get it working properly. The modbus interface works really well and gives all information except for the individual optimisers.

dataLen:    0000
dataLenInv: ffff
sequence:   0549
source:     fffffffe
dest:       7415f893
function:   0080
/dev/ttyUSB0 <-- message: 3767 length: 22
data:       12 34 56 79 00 00 ff ff 49 05 fe ff ff ff 93 f8
data:       15 74 80 00 68 06
RS485 master ack timeout
dataLen:    0000
dataLenInv: ffff
sequence:   2f47
source:     fffffffe
dest:       00000001
function:   0302
/dev/ttyUSB0 <-- message: 3768 length: 22
data:       12 34 56 79 00 00 ff ff 47 2f fe ff ff ff 01 00
data:       00 00 02 03 d2 22
RS485 master ack timeout
dataLen:    0000
dataLenInv: ffff
sequence:   2f48
source:     fffffffe
dest:       00000001
function:   0302
/dev/ttyUSB0 <-- message: 3769 length: 22
data:       12 34 56 79 00 00 ff ff 48 2f fe ff ff ff 01 00
data:       00 00 02 03 e2 36
RS485 master ack timeout
dataLen:    0000
dataLenInv: ffff
sequence:   2f49
source:     fffffffe
dest:       00000001
function:   0302
/dev/ttyUSB0 <-- message: 3770 length: 22
data:       12 34 56 79 00 00 ff ff 49 2f fe ff ff ff 01 00
data:       00 00 02 03 e6 ca
/dev/ttyUSB0 --> message: 1963 length: 81
data:       12 34 56 79 3b 00 c4 ff ff ff 93 f8 15 74 fe ff
data:       ff ff c2 03 00 00 33 00 a7 8d a1 5d 00 00 00 00
data:       3d c0 b4 44 3d c0 b4 44 ff ff 7f ff ff ff 7f ff
data:       ff ff 7f ff ff ff 7f ff ff ff 7f ff ff ff 7f ff
data:       ff ff 7f ff ff ff 7f ff 00 00 00 00 00 00 00 88
data:       92
dataLen:    003b
dataLenInv: ffc4
sequence:   ffff
source:     7415f893
dest:       fffffffe
function:   03c2
Unknown function 0x03c2
/dev/ttyUSB0 --> message: 1964 length: 22
data:       12 34 56 79 00 00 ff ff 4a 05 93 f8 15 74 fe ff
data:       ff ff 00 05 ce 3e
dataLen:    0000
dataLenInv: ffff
sequence:   054a
source:     7415f893
dest:       fffffffe
function:   0500
dataLen:    0000
dataLenInv: ffff
sequence:   054a
source:     fffffffe
dest:       7415f893
function:   0080
/dev/ttyUSB0 <-- message: 3771 length: 22
data:       12 34 56 79 00 00 ff ff 4a 05 fe ff ff ff 93 f8
data:       15 74 80 00 67 42
RS485 master ack timeout
dataLen:    0000
dataLenInv: ffff
sequence:   2f4a
source:     fffffffe
dest:       00000001
function:   0302
/dev/ttyUSB0 <-- message: 3772 length: 22
data:       12 34 56 79 00 00 ff ff 4a 2f fe ff ff ff 01 00
data:       00 00 02 03 e9 8e
RS485 master ack timeout
dataLen:    0000
dataLenInv: ffff
sequence:   2f4b
source:     fffffffe
dest:       00000001
function:   0302
/dev/ttyUSB0 <-- message: 3773 length: 22
data:       12 34 56 79 00 00 ff ff 4b 2f fe ff ff ff 01 00
data:       00 00 02 03 ed 72
/dev/ttyUSB0 --> message: 1965 length: 22
data:       12 34 56 79 00 00 ff ff 4a 05 93 f8 15 74 fe ff
data:       ff ff 00 05 ce 3e
dataLen:    0000
dataLenInv: ffff
sequence:   054a
source:     7415f893
dest:       fffffffe
function:   0500
dataLen:    0000
dataLenInv: ffff
sequence:   054a
source:     fffffffe
dest:       7415f893
function:   0080
/dev/ttyUSB0 <-- message: 3774 length: 22
data:       12 34 56 79 00 00 ff ff 4a 05 fe ff ff ff 93 f8
data:       15 74 80 00 67 42
RS485 master ack timeout
/dev/ttyUSB0 --> message: 1966 length: 510
data:       12 34 56 79 f6 01 09 fe 4b 05 93 f8 15 74 fe ff
data:       ff ff 00 05 82 00 a7 74 b6 17 15 00 6d 8d a1 5d
data:       12 37 f7 3c 11 14 ce 01 09 05 08 00 00 93 f8 95
data:       74 82 00 a7 74 b6 17 15 00 8b 8d a1 5d 30 37 fb
data:       5c 11 15 d0 01 09 05 08 00 00 93 f8 95 74 82 00
data:       fb 67 ec 15 15 00 91 8d a1 5d 34 37 f9 64 b1 14
data:       c3 01 09 02 06 00 00 93 f8 95 74 10 00 93 f8 95
data:       74 c4 00 a7 8d a1 5d 77 89 00 00 2c 01 00 00 30
data:       f6 25 42 1d 67 5c 45 00 00 2d 43 2e 19 6a 43 a5
data:       15 c6 40 0c 0e 48 42 ff ff 7f ff ff ff 7f ff 9f
data:       ff f0 fc fc fc fc ff 80 3f 04 00 00 00 00 e0 2b
data:       46 00 00 c8 42 ad 5d a1 3b ff ff 7f ff ff ff 7f
data:       ff 3d c0 b4 44 99 02 b5 44 9b f0 9a 42 bd e9 2d
data:       40 bd e9 2d 40 bd e9 2d 40 36 28 03 00 00 00 00
data:       00 a8 b2 61 3c 00 00 00 00 00 00 00 00 00 00 00
data:       00 00 00 36 28 03 00 00 00 00 00 00 00 2d 43 00
data:       00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
data:       00 00 00 00 00 00 00 00 00 ff ff 7f ff 01 00 26
data:       a2 7f 3f 00 00 ff ff ff ff 22 00 93 f8 15 74 3a
data:       00 a7 8d a1 5d 09 01 00 00 00 00 00 00 00 80 00
data:       00 00 00 00 00 00 80 00 00 00 00 00 00 00 80 00
data:       00 00 00 00 00 00 80 2c 01 00 00 ad 00 00 00 00
data:       00 00 00 3d c0 b4 44 ff ff 7f ff 82 00 fd 52 e7
data:       15 15 00 ff 8d a1 5d a4 37 f6 70 36 5b db 07 0d
data:       02 06 00 00 93 f8 95 74 82 00 a4 3d ee 15 15 00
data:       09 8e a1 5d ac 37 f3 64 c6 5b c7 07 0e 03 07 00
data:       00 93 f8 95 74 82 00 27 52 e7 15 15 00 22 8e a1
data:       5d c7 37 f5 a0 e6 6f e5 07 0f 05 0a 00 00 93 f8
data:       95 74 82 00 df 75 b6 17 15 00 2b 8e a1 5d d0 37
data:       f1 2c a6 4d d4 07 0f 03 0a 00 00 93 f8 95 74 82
data:       00 e9 49 e9 15 15 00 2f 8e a1 5d d4 37 f7 14 e6
data:       45 f6 07 0f 05 09 00 00 93 f8 95 74 ba 2c
dataLen:    01f6
dataLenInv: fe09
sequence:   054b
source:     7415f893
dest:       fffffffe
function:   0500
Data length is too big for the message
data:       f6 01 09 fe 4b 05 93 f8 15 74 fe ff ff ff 00 05
data:       82 00 a7 74 b6 17 15 00 6d 8d a1 5d 12 37 f7 3c
data:       11 14 ce 01 09 05 08 00 00 93 f8 95 74 82 00 a7
data:       74 b6 17 15 00 8b 8d a1 5d 30 37 fb 5c 11 15 d0
data:       01 09 05 08 00 00 93 f8 95 74 82 00 fb 67 ec 15
data:       15 00 91 8d a1 5d 34 37 f9 64 b1 14 c3 01 09 02
data:       06 00 00 93 f8 95 74 10 00 93 f8 95 74 c4 00 a7
data:       8d a1 5d 77 89 00 00 2c 01 00 00 30 f6 25 42 1d
data:       67 5c 45 00 00 2d 43 2e 19 6a 43 a5 15 c6 40 0c
data:       0e 48 42 ff ff 7f ff ff ff 7f ff 9f ff f0 fc fc
data:       fc fc ff 80 3f 04 00 00 00 00 e0 2b 46 00 00 c8
data:       42 ad 5d a1 3b ff ff 7f ff ff ff 7f ff 3d c0 b4
data:       44 99 02 b5 44 9b f0 9a 42 bd e9 2d 40 bd e9 2d
data:       40 bd e9 2d 40 36 28 03 00 00 00 00 00 a8 b2 61
data:       3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 36
data:       28 03 00 00 00 00 00 00 00 2d 43 00 00 00 00 00
data:       00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
data:       00 00 00 00 00 ff ff 7f ff 01 00 26 a2 7f 3f 00
data:       00 ff ff ff ff 22 00 93 f8 15 74 3a 00 a7 8d a1
data:       5d 09 01 00 00 00 00 00 00 00 80 00 00 00 00 00
data:       00 00 80 00 00 00 00 00 00 00 80 00 00 00 00 00
data:       00 00 80 2c 01 00 00 ad 00 00 00 00 00 00 00 3d
data:       c0 b4 44 ff ff 7f ff 82 00 fd 52 e7 15 15 00 ff
data:       8d a1 5d a4 37 f6 70 36 5b db 07 0d 02 06 00 00
data:       93 f8 95 74 82 00 a4 3d ee 15 15 00 09 8e a1 5d
data:       ac 37 f3 64 c6 5b c7 07 0e 03 07 00 00 93 f8 95
data:       74 82 00 27 52 e7 15 15 00 22 8e a1 5d c7 37 f5
data:       a0 e6 6f e5 07 0f 05 0a 00 00 93 f8 95 74 82 00
data:       df 75 b6 17 15 00 2b 8e a1 5d d0 37 f1 2c a6 4d
data:       d4 07 0f 03 0a 00 00 93 f8 95 74 82 00 e9 49 e9
data:       15 15 00 2f 8e a1 5d d4 37 f7 14 e6 45 f6 07 0f
data:       05 09 00 00 93 f8 95 74 ba 2c
Ignoring this message
dataLen:    0000
dataLenInv: ffff
sequence:   2f4c
source:     fffffffe
dest:       00000001
function:   0302
/dev/ttyUSB0 <-- message: 3775 length: 22
data:       12 34 56 79 00 00 ff ff 4c 2f fe ff ff ff 01 00
data:       00 00 02 03 f7 06
/dev/ttyUSB0 --> message: 1967 length: 524
data:       12 34 56 79 f6 01 09 fe 4b 05 93 f8 15 74 fe ff
data:       ff ff 00 05 82 00 a7 74 b6 17 15 00 6d 8d a1 5d
data:       12 37 f7 3c 11 14 ce 01 09 05 08 00 00 93 f8 95
data:       74 82 00 a7 74 b6 17 15 00 8b 8d a1 5d 30 37 fb
data:       5c 11 15 d0 01 09 05 08 00 00 93 f8 95 74 82 00
data:       fb 67 ec 15 15 00 91 8d a1 5d 34 37 f9 64 b1 14
data:       c3 01 09 02 06 00 00 93 f8 95 74 10 00 93 f8 95
data:       74 c4 00 a7 8d a1 5d 77 89 00 00 2c 01 00 00 30
data:       f6 25 42 1d 67 5c 45 00 00 2d 43 2e 19 6a 43 a5
data:       15 c6 40 0c 0e 48 42 ff ff 7f ff ff ff 7f ff 9f
data:       07 bb 43 ff ff 7f ff 80 0d 4a 48 44 8c 7c 3b ff
data:       ff 7f ff 00 00 80 3f 04 00 00 00 00 e0 2b 46 00
data:       00 c8 42 ad 5d a1 3b ff ff 7f ff ff ff 7f ff 3d
data:       c0 b4 44 99 02 b5 44 9b f0 9a 42 bd e9 2d 40 bd
data:       e9 2d 40 bd e9 2d 40 36 28 03 00 00 00 00 00 a8
data:       b2 61 3c 00 00 00 00 00 00 00 00 00 00 00 00 00
data:       00 36 28 03 00 00 00 00 00 00 00 2d 43 00 00 00
data:       00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
data:       00 00 00 00 00 00 00 ff ff 7f ff 01 00 26 a2 7f
data:       3f 00 00 ff ff ff ff 22 00 93 f8 15 74 3a 00 a7
data:       8d a1 5d 09 01 00 00 00 00 00 00 00 80 00 00 00
data:       00 00 00 00 80 00 00 00 00 00 00 00 80 00 00 00
data:       00 00 00 00 80 2c 01 00 00 ad 00 00 00 00 00 00
data:       00 3d c0 b4 44 ff ff 7f ff 82 00 fd 52 e7 15 15
data:       00 ff 8d a1 5d a4 37 f6 70 36 5b db 07 0d 02 06
data:       00 00 93 f8 95 74 82 00 a4 3d ee 15 15 00 09 8e
data:       a1 5d ac 37 f3 64 c6 5b c7 07 0e 03 07 00 00 93
data:       f8 95 74 82 00 27 52 e7 15 15 00 22 8e a1 5d c7
data:       37 f5 a0 e6 6f e5 07 0f 05 0a 00 00 93 f8 95 74
data:       82 00 df 75 b6 17 15 00 2b 8e a1 5d d0 37 f1 2c
data:       a6 4d d4 07 0f 03 0a 00 00 93 f8 95 74 82 00 e9
data:       49 e9 15 15 00 2f 8e a1 5d d4 37 f7 14 e6 45 f6
data:       07 0f 05 09 00 00 93 f8 95 74 ba 2c
dataLen:    01f6
dataLenInv: fe09
sequence:   054b
source:     7415f893
dest:       fffffffe
function:   0500
optimizer:      173674A7 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:23:09
    ID : 173674A7
    Inverter : 0
    Uptime : 14098
    Vmod : 30.875
    Vopt : 9.875
    Imod : 2.00625
    Eday : 0
    Temp : 0
optimizer:      173674A7 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:23:39
    ID : 173674A7
    Inverter : 0
    Uptime : 14128
    Vmod : 31.375
    Vopt : 10.875
    Imod : 2.10625
    Eday : 0
    Temp : 0
optimizer:      156C67FB type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:23:45
    ID : 156C67FB
    Inverter : 0
    Uptime : 14132
    Vmod : 31.125
    Vopt : 11.125
    Imod : 2.06875
    Eday : 0
    Temp : 0
inverter:      7415F893 type: 0010 len: 00c4
    Date : 2019-10-12
    Time : 10:24:07
    ID : 7415F893
    Uptime : 35191
    Interval : 300
    Temp : 41.49041748046875
    Eday : 3526.444580078125
    Eac : 173.0
    Vac : 234.09835815429688
    Iac : 6.1901421546936035
    Freq : 50.01371765136719
    Vdc : 374.0595397949219
    Etot : 206902.0
    Pmax : 11000.0
    Pac : 1446.0074462890625
meters_0x0022:  7415F893 type: 0022 len: 003a
    meters_0x0022 : {'7415F893': {'9_PVProduction': {'seType': '0x0022', 'seId': '7415F893', 'devLen': 58, 'devType': 'meters_0x0022', 'dateTime': 1570868647, 'Date': '2019-10-12', 'Time': '10:24:07', 'recType': 9, 'onlyIntervalData': 1, 'TotalE2Grid': 0, 'AlwaysZero_off10_int2': 0, 'Flag_off12_hex': '00 80', 'TotalEfromGrid': 0, 'AlwaysZero_off18_int2': 0, 'Flag_off20_hex': '00 80', 'Totaloff22_int4': 0, 'AlwaysZero_off26_int2': 0, 'Flag_off28_hex': '00 80', 'Totaloff30_int4': 0, 'AlwaysZero_off34_int2': 0, 'Flag_off36_hex': '00 80', 'Interval': 300, 'E2X': 173, 'EfromX': 0, 'P2X': 1446.0074462890625, 'PfromX': nan}}}
optimizer:      156752FD type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:25:35
    ID : 156752FD
    Inverter : 0
    Uptime : 14244
    Vmod : 30.75
    Vopt : 51.5
    Imod : 9.11875
    Eday : 0
    Temp : 0
optimizer:      156E3DA4 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:25:45
    ID : 156E3DA4
    Inverter : 0
    Uptime : 14252
    Vmod : 30.375
    Vopt : 51.125
    Imod : 9.175
    Eday : 0
    Temp : 0
optimizer:      15675227 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:26:10
    ID : 15675227
    Inverter : 0
    Uptime : 14279
    Vmod : 30.625
    Vopt : 53.0
    Imod : 11.1875
    Eday : 0
    Temp : 0
optimizer:      173675DF type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:26:19
    ID : 173675DF
    Inverter : 0
    Uptime : 14288
    Vmod : 30.125
    Vopt : 49.375
    Imod : 7.7625
    Eday : 0
    Temp : 0
optimizer:      156949E9 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:26:23
    ID : 156949E9
    Inverter : 0
    Uptime : 14292
    Vmod : 30.875
    Vopt : 48.625
    Imod : 6.987500000000001
    Eday : 0
    Temp : 0
{"events": {}, "inverters": {"7415F893": {"Date": "2019-10-12", "Eac": 173.0, "Eday": 3526.444580078125, "Etot": 206902.0, "Freq": 50.01371765136719, "ID": "7415F893", "Iac": 6.1901421546936035, "Interval": 300, "Pac": 1446.0074462890625, "Pmax": 11000.0, "Temp": 41.49041748046875, "Time": "10:24:07", "Uptime": 35191, "Vac": 234.09835815429688, "Vdc": 374.0595397949219}}, "meters_0x0022": {"7415F893": {"9_PVProduction": {"AlwaysZero_off10_int2": 0, "AlwaysZero_off18_int2": 0, "AlwaysZero_off26_int2": 0, "AlwaysZero_off34_int2": 0, "Date": "2019-10-12", "E2X": 173, "EfromX": 0, "Flag_off12_hex": "00 80", "Flag_off20_hex": "00 80", "Flag_off28_hex": "00 80", "Flag_off36_hex": "00 80", "Interval": 300, "P2X": 1446.0074462890625, "PfromX": NaN, "Time": "10:24:07", "TotalE2Grid": 0, "TotalEfromGrid": 0, "Totaloff22_int4": 0, "Totaloff30_int4": 0, "dateTime": 1570868647, "devLen": 58, "devType": "meters_0x0022", "onlyIntervalData": 1, "recType": 9, "seId": "7415F893", "seType": "0x0022"}}}, "optimizers": {"15675227": {"Date": "2019-10-12", "Eday": 0, "ID": "15675227", "Imod": 11.1875, "Inverter": 0, "Temp": 0, "Time": "10:26:10", "Uptime": 14279, "Vmod": 30.625, "Vopt": 53.0}, "156752FD": {"Date": "2019-10-12", "Eday": 0, "ID": "156752FD", "Imod": 9.11875, "Inverter": 0, "Temp": 0, "Time": "10:25:35", "Uptime": 14244, "Vmod": 30.75, "Vopt": 51.5}, "156949E9": {"Date": "2019-10-12", "Eday": 0, "ID": "156949E9", "Imod": 6.987500000000001, "Inverter": 0, "Temp": 0, "Time": "10:26:23", "Uptime": 14292, "Vmod": 30.875, "Vopt": 48.625}, "156C67FB": {"Date": "2019-10-12", "Eday": 0, "ID": "156C67FB", "Imod": 2.06875, "Inverter": 0, "Temp": 0, "Time": "10:23:45", "Uptime": 14132, "Vmod": 31.125, "Vopt": 11.125}, "156E3DA4": {"Date": "2019-10-12", "Eday": 0, "ID": "156E3DA4", "Imod": 9.175, "Inverter": 0, "Temp": 0, "Time": "10:25:45", "Uptime": 14252, "Vmod": 30.375, "Vopt": 51.125}, "173674A7": {"Date": "2019-10-12", "Eday": 0, "ID": "173674A7", "Imod": 2.10625, "Inverter": 0, "Temp": 0, "Time": "10:23:39", "Uptime": 14128, "Vmod": 31.375, "Vopt": 10.875}, "173675DF": {"Date": "2019-10-12", "Eday": 0, "ID": "173675DF", "Imod": 7.7625, "Inverter": 0, "Temp": 0, "Time": "10:26:19", "Uptime": 14288, "Vmod": 30.125, "Vopt": 49.375}}}
dataLen:    0000
dataLenInv: ffff
sequence:   054b
source:     fffffffe
dest:       7415f893
function:   0080
/dev/ttyUSB0 <-- message: 3776 length: 22
data:       12 34 56 79 00 00 ff ff 4b 05 fe ff ff ff 93 f8
data:       15 74 80 00 63 be
RS485 master ack timeout
dataLen:    0000
dataLenInv: ffff
sequence:   2f4d
source:     fffffffe
dest:       00000001
function:   0302
/dev/ttyUSB0 <-- message: 3777 length: 22
data:       12 34 56 79 00 00 ff ff 4d 2f fe ff ff ff 01 00
data:       00 00 02 03 f3 fa
RS485 master ack timeout
dataLen:    0000
dataLenInv: ffff
sequence:   2f4e
source:     fffffffe
dest:       00000001
function:   0302
/dev/ttyUSB0 <-- message: 3778 length: 22
data:       12 34 56 79 00 00 ff ff 4e 2f fe ff ff ff 01 00
data:       00 00 02 03 fc be
/dev/ttyUSB0 --> message: 1968 length: 524
data:       12 34 56 79 f6 01 09 fe 4b 05 93 f8 15 74 fe ff
data:       ff ff 00 05 82 00 a7 74 b6 17 15 00 6d 8d a1 5d
data:       12 37 f7 3c 11 14 ce 01 09 05 08 00 00 93 f8 95
data:       74 82 00 a7 74 b6 17 15 00 8b 8d a1 5d 30 37 fb
data:       5c 11 15 d0 01 09 05 08 00 00 93 f8 95 74 82 00
data:       fb 67 ec 15 15 00 91 8d a1 5d 34 37 f9 64 b1 14
data:       c3 01 09 02 06 00 00 93 f8 95 74 10 00 93 f8 95
data:       74 c4 00 a7 8d a1 5d 77 89 00 00 2c 01 00 00 30
data:       f6 25 42 1d 67 5c 45 00 00 2d 43 2e 19 6a 43 a5
data:       15 c6 40 0c 0e 48 42 ff ff 7f ff ff ff 7f ff 9f
data:       07 bb 43 ff ff 7f ff 80 0d 4a 48 44 8c 7c 3b ff
data:       ff 7f ff 00 00 80 3f 04 00 00 00 00 e0 2b 46 00
data:       00 c8 42 ad 5d a1 3b ff ff 7f ff ff ff 7f ff 3d
data:       c0 b4 44 99 02 b5 44 9b f0 9a 42 bd e9 2d 40 bd
data:       e9 2d 40 bd e9 2d 40 36 28 03 00 00 00 00 00 a8
data:       b2 61 3c 00 00 00 00 00 00 00 00 00 00 00 00 00
data:       00 36 28 03 00 00 00 00 00 00 00 2d 43 00 00 00
data:       00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
data:       00 00 00 00 00 00 00 ff ff 7f ff 01 00 26 a2 7f
data:       3f 00 00 ff ff ff ff 22 00 93 f8 15 74 3a 00 a7
data:       8d a1 5d 09 01 00 00 00 00 00 00 00 80 00 00 00
data:       00 00 00 00 80 00 00 00 00 00 00 00 80 00 00 00
data:       00 00 00 00 80 2c 01 00 00 ad 00 00 00 00 00 00
data:       00 3d c0 b4 44 ff ff 7f ff 82 00 fd 52 e7 15 15
data:       00 ff 8d a1 5d a4 37 f6 70 36 5b db 07 0d 02 06
data:       00 00 93 f8 95 74 82 00 a4 3d ee 15 15 00 09 8e
data:       a1 5d ac 37 f3 64 c6 5b c7 07 0e 03 07 00 00 93
data:       f8 95 74 82 00 27 52 e7 15 15 00 22 8e a1 5d c7
data:       37 f5 a0 e6 6f e5 07 0f 05 0a 00 00 93 f8 95 74
data:       82 00 df 75 b6 17 15 00 2b 8e a1 5d d0 37 f1 2c
data:       a6 4d d4 07 0f 03 0a 00 00 93 f8 95 74 82 00 e9
data:       49 e9 15 15 00 2f 8e a1 5d d4 37 f7 14 e6 45 f6
data:       07 0f 05 09 00 00 93 f8 95 74 ba 2c
dataLen:    01f6
dataLenInv: fe09
sequence:   054b
source:     7415f893
dest:       fffffffe
function:   0500
optimizer:      173674A7 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:23:09
    ID : 173674A7
    Inverter : 0
    Uptime : 14098
    Vmod : 30.875
    Vopt : 9.875
    Imod : 2.00625
    Eday : 0
    Temp : 0
optimizer:      173674A7 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:23:39
    ID : 173674A7
    Inverter : 0
    Uptime : 14128
    Vmod : 31.375
    Vopt : 10.875
    Imod : 2.10625
    Eday : 0
    Temp : 0
optimizer:      156C67FB type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:23:45
    ID : 156C67FB
    Inverter : 0
    Uptime : 14132
    Vmod : 31.125
    Vopt : 11.125
    Imod : 2.06875
    Eday : 0
    Temp : 0
inverter:      7415F893 type: 0010 len: 00c4
    Date : 2019-10-12
    Time : 10:24:07
    ID : 7415F893
    Uptime : 35191
    Interval : 300
    Temp : 41.49041748046875
    Eday : 3526.444580078125
    Eac : 173.0
    Vac : 234.09835815429688
    Iac : 6.1901421546936035
    Freq : 50.01371765136719
    Vdc : 374.0595397949219
    Etot : 206902.0
    Pmax : 11000.0
    Pac : 1446.0074462890625
meters_0x0022:  7415F893 type: 0022 len: 003a
    meters_0x0022 : {'7415F893': {'9_PVProduction': {'seType': '0x0022', 'seId': '7415F893', 'devLen': 58, 'devType': 'meters_0x0022', 'dateTime': 1570868647, 'Date': '2019-10-12', 'Time': '10:24:07', 'recType': 9, 'onlyIntervalData': 1, 'TotalE2Grid': 0, 'AlwaysZero_off10_int2': 0, 'Flag_off12_hex': '00 80', 'TotalEfromGrid': 0, 'AlwaysZero_off18_int2': 0, 'Flag_off20_hex': '00 80', 'Totaloff22_int4': 0, 'AlwaysZero_off26_int2': 0, 'Flag_off28_hex': '00 80', 'Totaloff30_int4': 0, 'AlwaysZero_off34_int2': 0, 'Flag_off36_hex': '00 80', 'Interval': 300, 'E2X': 173, 'EfromX': 0, 'P2X': 1446.0074462890625, 'PfromX': nan}}}
optimizer:      156752FD type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:25:35
    ID : 156752FD
    Inverter : 0
    Uptime : 14244
    Vmod : 30.75
    Vopt : 51.5
    Imod : 9.11875
    Eday : 0
    Temp : 0
optimizer:      156E3DA4 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:25:45
    ID : 156E3DA4
    Inverter : 0
    Uptime : 14252
    Vmod : 30.375
    Vopt : 51.125
    Imod : 9.175
    Eday : 0
    Temp : 0
optimizer:      15675227 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:26:10
    ID : 15675227
    Inverter : 0
    Uptime : 14279
    Vmod : 30.625
    Vopt : 53.0
    Imod : 11.1875
    Eday : 0
    Temp : 0
optimizer:      173675DF type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:26:19
    ID : 173675DF
    Inverter : 0
    Uptime : 14288
    Vmod : 30.125
    Vopt : 49.375
    Imod : 7.7625
    Eday : 0
    Temp : 0
optimizer:      156949E9 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:26:23
    ID : 156949E9
    Inverter : 0
    Uptime : 14292
    Vmod : 30.875
    Vopt : 48.625
    Imod : 6.987500000000001
    Eday : 0
    Temp : 0
{"events": {}, "inverters": {"7415F893": {"Date": "2019-10-12", "Eac": 173.0, "Eday": 3526.444580078125, "Etot": 206902.0, "Freq": 50.01371765136719, "ID": "7415F893", "Iac": 6.1901421546936035, "Interval": 300, "Pac": 1446.0074462890625, "Pmax": 11000.0, "Temp": 41.49041748046875, "Time": "10:24:07", "Uptime": 35191, "Vac": 234.09835815429688, "Vdc": 374.0595397949219}}, "meters_0x0022": {"7415F893": {"9_PVProduction": {"AlwaysZero_off10_int2": 0, "AlwaysZero_off18_int2": 0, "AlwaysZero_off26_int2": 0, "AlwaysZero_off34_int2": 0, "Date": "2019-10-12", "E2X": 173, "EfromX": 0, "Flag_off12_hex": "00 80", "Flag_off20_hex": "00 80", "Flag_off28_hex": "00 80", "Flag_off36_hex": "00 80", "Interval": 300, "P2X": 1446.0074462890625, "PfromX": NaN, "Time": "10:24:07", "TotalE2Grid": 0, "TotalEfromGrid": 0, "Totaloff22_int4": 0, "Totaloff30_int4": 0, "dateTime": 1570868647, "devLen": 58, "devType": "meters_0x0022", "onlyIntervalData": 1, "recType": 9, "seId": "7415F893", "seType": "0x0022"}}}, "optimizers": {"15675227": {"Date": "2019-10-12", "Eday": 0, "ID": "15675227", "Imod": 11.1875, "Inverter": 0, "Temp": 0, "Time": "10:26:10", "Uptime": 14279, "Vmod": 30.625, "Vopt": 53.0}, "156752FD": {"Date": "2019-10-12", "Eday": 0, "ID": "156752FD", "Imod": 9.11875, "Inverter": 0, "Temp": 0, "Time": "10:25:35", "Uptime": 14244, "Vmod": 30.75, "Vopt": 51.5}, "156949E9": {"Date": "2019-10-12", "Eday": 0, "ID": "156949E9", "Imod": 6.987500000000001, "Inverter": 0, "Temp": 0, "Time": "10:26:23", "Uptime": 14292, "Vmod": 30.875, "Vopt": 48.625}, "156C67FB": {"Date": "2019-10-12", "Eday": 0, "ID": "156C67FB", "Imod": 2.06875, "Inverter": 0, "Temp": 0, "Time": "10:23:45", "Uptime": 14132, "Vmod": 31.125, "Vopt": 11.125}, "156E3DA4": {"Date": "2019-10-12", "Eday": 0, "ID": "156E3DA4", "Imod": 9.175, "Inverter": 0, "Temp": 0, "Time": "10:25:45", "Uptime": 14252, "Vmod": 30.375, "Vopt": 51.125}, "173674A7": {"Date": "2019-10-12", "Eday": 0, "ID": "173674A7", "Imod": 2.10625, "Inverter": 0, "Temp": 0, "Time": "10:23:39", "Uptime": 14128, "Vmod": 31.375, "Vopt": 10.875}, "173675DF": {"Date": "2019-10-12", "Eday": 0, "ID": "173675DF", "Imod": 7.7625, "Inverter": 0, "Temp": 0, "Time": "10:26:19", "Uptime": 14288, "Vmod": 30.125, "Vopt": 49.375}}}
dataLen:    0000
dataLenInv: ffff
sequence:   054b
source:     fffffffe
dest:       7415f893
function:   0080
/dev/ttyUSB0 <-- message: 3779 length: 22
data:       12 34 56 79 00 00 ff ff 4b 05 fe ff ff ff 93 f8
data:       15 74 80 00 63 be
RS485 master ack timeout
dataLen:    0000
dataLenInv: ffff
sequence:   2f4f
source:     fffffffe
dest:       00000001
function:   0302
/dev/ttyUSB0 <-- message: 3780 length: 22
data:       12 34 56 79 00 00 ff ff 4f 2f fe ff ff ff 01 00
data:       00 00 02 03 f8 42
/dev/ttyUSB0 --> message: 1969 length: 22
data:       12 34 56 79 00 00 ff ff 4c 05 93 f8 15 74 fe ff
data:       ff ff 00 05 d0 b6
dataLen:    0000
dataLenInv: ffff
sequence:   054c
source:     7415f893
dest:       fffffffe
function:   0500
dataLen:    0000
dataLenInv: ffff
sequence:   054c
source:     fffffffe
dest:       7415f893
function:   0080
/dev/ttyUSB0 <-- message: 3781 length: 22
data:       12 34 56 79 00 00 ff ff 4c 05 fe ff ff ff 93 f8
data:       15 74 80 00 79 ca
/dev/ttyUSB0 --> message: 1970 length: 22
data:       12 34 56 79 00 00 ff ff 4c 05 93 f8 15 74 fe ff
data:       ff ff 00 05 d0 b6
dataLen:    0000
dataLenInv: ffff
sequence:   054c
source:     7415f893
dest:       fffffffe
function:   0500
dataLen:    0000
dataLenInv: ffff
sequence:   054c
source:     fffffffe
dest:       7415f893
function:   0080
/dev/ttyUSB0 <-- message: 3782 length: 22
data:       12 34 56 79 00 00 ff ff 4c 05 fe ff ff ff 93 f8
data:       15 74 80 00 79 ca
RS485 master ack timeout
dataLen:    0000
dataLenInv: ffff
sequence:   2f50
source:     fffffffe
dest:       00000001
function:   0302
/dev/ttyUSB0 <-- message: 3783 length: 22
data:       12 34 56 79 00 00 ff ff 50 2f fe ff ff ff 01 00
data:       00 00 02 03 9c 96
/dev/ttyUSB0 --> message: 1971 length: 81
data:       12 34 56 79 3b 00 c4 ff ff ff 93 f8 15 74 fe ff
data:       ff ff c2 03 00 00 33 00 d3 8e a1 5d 00 00 00 00
data:       92 d2 17 45 92 d2 17 45 ff ff 7f ff ff ff 7f ff
data:       ff ff 7f ff ff ff 7f ff ff ff 7f ff ff ff 7f ff
data:       ff ff 7f ff ff ff 7f ff 00 00 00 00 00 00 00 d4
data:       0b
dataLen:    003b
dataLenInv: ffc4
sequence:   ffff
source:     7415f893
dest:       fffffffe
function:   03c2
Unknown function 0x03c2
RS485 master ack timeout
dataLen:    0000
dataLenInv: ffff
sequence:   2f51
source:     fffffffe
dest:       00000001
function:   0302
/dev/ttyUSB0 <-- message: 3784 length: 22
data:       12 34 56 79 00 00 ff ff 51 2f fe ff ff ff 01 00
data:       00 00 02 03 98 6a
/dev/ttyUSB0 --> message: 1972 length: 524
data:       12 34 56 79 f6 01 09 fe 4d 05 93 f8 15 74 fe ff
data:       ff ff 00 05 82 00 be 9e bf 15 15 00 45 8e a1 5d
data:       e9 37 f6 2c 36 4e de 07 0f 04 0b 00 00 93 f8 95
data:       74 82 00 79 4f e7 15 15 00 5e 8e a1 5d 02 38 f6
data:       54 f1 14 da 01 09 03 06 00 00 93 f8 95 74 82 00
data:       2a 47 e9 15 15 00 6a 8e a1 5d 0f 38 fa 54 a1 14
data:       c4 01 09 00 04 00 00 93 f8 95 74 82 00 d8 5d e7
data:       15 15 00 76 8e a1 5d 1b 38 f8 40 31 15 cb 01 09
data:       04 07 00 00 93 f8 95 74 82 00 e7 75 b6 17 15 00
data:       89 8e a1 5d 2e 38 fb 4c 11 16 e4 01 09 04 07 00
data:       00 93 f8 95 74 82 00 fb 67 ec 15 15 00 a9 8e a1
data:       5d 4e 38 fa 60 71 16 d7 01 09 01 05 00 00 93 f8
data:       95 74 82 00 79 4f e7 15 15 00 cf 8e a1 5d 74 38
data:       f6 64 21 18 e2 01 09 04 07 00 00 93 f8 95 74 82
data:       00 df 75 b6 17 15 00 d1 8e a1 5d 76 38 f4 80 16
data:       71 0d 08 10 05 0e 00 00 93 f8 95 74 10 00 93 f8
data:       95 74 c4 00 d3 8e a1 5d a3 8a 00 00 2c 01 00 00
data:       1f fc 27 42 69 c4 66 45 00 00 2b 43 ae 01 6c 43
data:       ba 04 25 41 5a 05 48 42 ff ff 7f ff ff ff 7f ff
data:       c2 fd bb 43 ff ff 7f ff 40 38 4a 48 b2 57 b3 3b
data:       ff ff 7f ff 00 00 80 3f 04 00 00 00 00 e0 2b 46
data:       00 00 c8 42 48 ea 9a 3b ff ff 7f ff ff ff 7f ff
data:       92 d2 17 45 8e f0 17 45 52 df be 42 bd e9 2d 40
data:       bd e9 2d 40 bd e9 2d 40 e1 28 03 00 00 00 00 00
data:       a8 b2 61 3c 00 00 00 00 00 00 00 00 00 00 00 00
data:       00 00 e1 28 03 00 00 00 00 00 00 00 2b 43 00 00
data:       00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
data:       00 00 00 00 00 00 00 00 ff ff 7f ff 01 00 7b cd
data:       7f 3f 00 00 ff ff ff ff 22 00 93 f8 15 74 3a 00
data:       d3 8e a1 5d 09 01 00 00 00 00 00 00 00 80 00 00
data:       00 00 00 00 00 80 00 00 00 00 00 00 00 80 00 00
data:       00 00 00 00 00 80 2c 01 00 00 ab 00 00 00 00 00
data:       00 00 92 d2 17 45 ff ff 7f ff f7 0a
dataLen:    01f6
dataLenInv: fe09
sequence:   054d
source:     7415f893
dest:       fffffffe
function:   0500
optimizer:      153F9EBE type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:26:45
    ID : 153F9EBE
    Inverter : 0
    Uptime : 14313
    Vmod : 30.75
    Vopt : 49.375
    Imod : 7.8187500000000005
    Eday : 0
    Temp : 0
optimizer:      15674F79 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:27:10
    ID : 15674F79
    Inverter : 0
    Uptime : 14338
    Vmod : 30.75
    Vopt : 10.625
    Imod : 2.09375
    Eday : 0
    Temp : 0
optimizer:      1569472A type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:27:22
    ID : 1569472A
    Inverter : 0
    Uptime : 14351
    Vmod : 31.25
    Vopt : 10.625
    Imod : 2.0625
    Eday : 0
    Temp : 0
optimizer:      15675DD8 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:27:34
    ID : 15675DD8
    Inverter : 0
    Uptime : 14363
    Vmod : 31.0
    Vopt : 10.0
    Imod : 2.11875
    Eday : 0
    Temp : 0
optimizer:      173675E7 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:27:53
    ID : 173675E7
    Inverter : 0
    Uptime : 14382
    Vmod : 31.375
    Vopt : 10.375
    Imod : 2.2062500000000003
    Eday : 0
    Temp : 0
optimizer:      156C67FB type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:28:25
    ID : 156C67FB
    Inverter : 0
    Uptime : 14414
    Vmod : 31.25
    Vopt : 11.0
    Imod : 2.24375
    Eday : 0
    Temp : 0
optimizer:      15674F79 type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:29:03
    ID : 15674F79
    Inverter : 0
    Uptime : 14452
    Vmod : 30.75
    Vopt : 11.125
    Imod : 2.4125
    Eday : 0
    Temp : 0
optimizer:      173675DF type: 0082 len: 0015
    Date : 2019-10-12
    Time : 10:29:05
    ID : 173675DF
    Inverter : 0
    Uptime : 14454
    Vmod : 30.5
    Vopt : 52.0
    Imod : 11.30625
    Eday : 0
    Temp : 0
inverter:      7415F893 type: 0010 len: 00c4
    Date : 2019-10-12
    Time : 10:29:07
    ID : 7415F893
    Uptime : 35491
    Interval : 300
    Temp : 41.996212005615234
    Eday : 3692.275634765625
    Eac : 171.0
    Vac : 236.00656127929688
    Iac : 10.313653945922852
    Freq : 50.005226135253906
    Vdc : 375.98248291015625
    Etot : 207073.0
    Pmax : 11000.0
    Pac : 2429.16064453125
meters_0x0022:  7415F893 type: 0022 len: 003a
    meters_0x0022 : {'7415F893': {'9_PVProduction': {'seType': '0x0022', 'seId': '7415F893', 'devLen': 58, 'devType': 'meters_0x0022', 'dateTime': 1570868947, 'Date': '2019-10-12', 'Time': '10:29:07', 'recType': 9, 'onlyIntervalData': 1, 'TotalE2Grid': 0, 'AlwaysZero_off10_int2': 0, 'Flag_off12_hex': '00 80', 'TotalEfromGrid': 0, 'AlwaysZero_off18_int2': 0, 'Flag_off20_hex': '00 80', 'Totaloff22_int4': 0, 'AlwaysZero_off26_int2': 0, 'Flag_off28_hex': '00 80', 'Totaloff30_int4': 0, 'AlwaysZero_off34_int2': 0, 'Flag_off36_hex': '00 80', 'Interval': 300, 'E2X': 171, 'EfromX': 0, 'P2X': 2429.16064453125, 'PfromX': nan}}}
{"events": {}, "inverters": {"7415F893": {"Date": "2019-10-12", "Eac": 171.0, "Eday": 3692.275634765625, "Etot": 207073.0, "Freq": 50.005226135253906, "ID": "7415F893", "Iac": 10.313653945922852, "Interval": 300, "Pac": 2429.16064453125, "Pmax": 11000.0, "Temp": 41.996212005615234, "Time": "10:29:07", "Uptime": 35491, "Vac": 236.00656127929688, "Vdc": 375.98248291015625}}, "meters_0x0022": {"7415F893": {"9_PVProduction": {"AlwaysZero_off10_int2": 0, "AlwaysZero_off18_int2": 0, "AlwaysZero_off26_int2": 0, "AlwaysZero_off34_int2": 0, "Date": "2019-10-12", "E2X": 171, "EfromX": 0, "Flag_off12_hex": "00 80", "Flag_off20_hex": "00 80", "Flag_off28_hex": "00 80", "Flag_off36_hex": "00 80", "Interval": 300, "P2X": 2429.16064453125, "PfromX": NaN, "Time": "10:29:07", "TotalE2Grid": 0, "TotalEfromGrid": 0, "Totaloff22_int4": 0, "Totaloff30_int4": 0, "dateTime": 1570868947, "devLen": 58, "devType": "meters_0x0022", "onlyIntervalData": 1, "recType": 9, "seId": "7415F893", "seType": "0x0022"}}}, "optimizers": {"153F9EBE": {"Date": "2019-10-12", "Eday": 0, "ID": "153F9EBE", "Imod": 7.8187500000000005, "Inverter": 0, "Temp": 0, "Time": "10:26:45", "Uptime": 14313, "Vmod": 30.75, "Vopt": 49.375}, "15674F79": {"Date": "2019-10-12", "Eday": 0, "ID": "15674F79", "Imod": 2.4125, "Inverter": 0, "Temp": 0, "Time": "10:29:03", "Uptime": 14452, "Vmod": 30.75, "Vopt": 11.125}, "15675DD8": {"Date": "2019-10-12", "Eday": 0, "ID": "15675DD8", "Imod": 2.11875, "Inverter": 0, "Temp": 0, "Time": "10:27:34", "Uptime": 14363, "Vmod": 31.0, "Vopt": 10.0}, "1569472A": {"Date": "2019-10-12", "Eday": 0, "ID": "1569472A", "Imod": 2.0625, "Inverter": 0, "Temp": 0, "Time": "10:27:22", "Uptime": 14351, "Vmod": 31.25, "Vopt": 10.625}, "156C67FB": {"Date": "2019-10-12", "Eday": 0, "ID": "156C67FB", "Imod": 2.24375, "Inverter": 0, "Temp": 0, "Time": "10:28:25", "Uptime": 14414, "Vmod": 31.25, "Vopt": 11.0}, "173675DF": {"Date": "2019-10-12", "Eday": 0, "ID": "173675DF", "Imod": 11.30625, "Inverter": 0, "Temp": 0, "Time": "10:29:05", "Uptime": 14454, "Vmod": 30.5, "Vopt": 52.0}, "173675E7": {"Date": "2019-10-12", "Eday": 0, "ID": "173675E7", "Imod": 2.2062500000000003, "Inverter": 0, "Temp": 0, "Time": "10:27:53", "Uptime": 14382, "Vmod": 31.375, "Vopt": 10.375}}}
dataLen:    0000
dataLenInv: ffff
sequence:   054d
source:     fffffffe
dest:       7415f893
function:   0080
/dev/ttyUSB0 <-- message: 3785 length: 22
data:       12 34 56 79 00 00 ff ff 4d 05 fe ff ff ff 93 f8
data:       15 74 80 00 7d 36
RS485 master ack timeout
dataLen:    0000
dataLenInv: ffff
sequence:   2f52
source:     fffffffe
dest:       00000001
function:   0302
/dev/ttyUSB0 <-- message: 3786 length: 22
data:       12 34 56 79 00 00 ff ff 52 2f fe ff ff ff 01 00
data:       00 00 02 03 97 2e
jbuehl commented 1 year ago

After seeing your debug output I can see more than one problem. The MASTER_GRANT (0x0302) message is sent by semonitor, the inverter responds with a POST_DATA (0x0500) message, and semonitor replies with an ACK (0x0080). The PROT_RESP_POLESTAR_MASTER_GRANT_ACK (0x039a) message is apparently never being sent by your inverter which results in the timeout message. This is how the protocol worked in my 10 year old SE5000 inverter when this code was written, however it looks like SolarEdge may have changed it in your inverter.

Another problem is that even though 0x0500 messages are being received, validated, parsed, and acknowledged by semonitor, the inverter keeps sending the same ones over and over. Messages with sequence numbers 0x054b and 0x054d appear more than once and contain the exact same data. It may be that the inverter is expecting some other message as acknowledgement of receipt.

The only way I can think of to fix this would be to connect a device to your inverter that implements the current protocol and then monitor the messages on the RS485 bus. I originally did this with two inverters configured as the master and slave, but that's not useful in this situation.

eriksl commented 1 year ago

Yes, sadly I only have one inverter. Maybe at some time someone does.

On the other hand, I do get all of the data at some point, I now have successfully received data for most of the day today. I'll leave it running for a few more days and after that I'll probably have enough detailed information, the totals from the inverter (modbus) will probably be sufficient.

I have found the wrong date issue btw. Apparently my laptop had a wrong date in it's hardware clock, OS clock was incorrect after reboot, and somehow it managed to send it's date-time to the inverter, I am not sure if semonitor sents messages containing timestamps? Somehow at some point the inverter adapted this incorrect date-time, weird.

So I am actually quite content for the moment. Thanks for your effort!

jbuehl commented 1 year ago

Yes the inverter does get its date from semonitor.