XtheOne / Inverter-Data-Logger

Data logger for Omnik/Hosola and other Solarman Wi-Fi kit powered Solar Inverters
GNU General Public License v3.0
117 stars 28 forks source link

Add Version 5 protocol support #3

Open XtheOne opened 6 years ago

XtheOne commented 6 years ago

Implement support for V5 protocol as used in new embedded ethernet loggers. Needs documentation from Omnik and or iGEN / Solarman.

This is requested. Also a firmware update file is requested.

jessiesolar commented 3 years ago

@silvanverschuur

You can extract the right header and prefix from the base64 string as follows:

$ python3
>>> import base64
>>> bytes = base64.b64decode('pQoAEBEwAYojXCUCAb9rcWCqqgAA3BU=')
>>> header = bytes[0:4]
>>> prefix = bytes[6:13]
>>> header
b'\xa5\n\x00\x10'
>>> prefix
b'\x01\x8a#\\%\x02\x01'

EDIT: corrected error in the above.

Note that the header seems standard, and does not require updating (same in my case).

To solve your ImportError:

-from .messaging import (
+from messaging import (
silvanverschuur commented 3 years ago

@jessiesolar Thanks for the update. I have replaced the prefix, removed the persistence and updated the imports. I can run it now and get some data from my inverter. The only strange thing is that I receive 3 messages from the inverter within 20 seconds and then it stops sending data.

I also have an Omnik inverter with the same firmware. Do you have any idea why the inverter only sends 3 (same) messages? Could it be that the response from the server is incorrect?

jessiesolar commented 3 years ago

@silvanverschuur

Do you have any idea why the inverter only sends 3 (same) messages?

How long are these messages? Can you share them?

silvanverschuur commented 3 years ago

@jessiesolar

This is the output of the python3 server.py command:

2021-04-19 19:09:01,009 - solis_service - INFO - Starting server on 192.168.1.51:10000
2021-04-19 19:10:00,631 - solis_service - DEBUG - Received heartbeat message from ('192.168.1.18', 1196)
2021-04-19 19:10:01,717 - solis_service - DEBUG - Received data message from ('192.168.1.18', 36257)
2021-04-19 19:10:01,718 - solis_service - DEBUG - data message: {'inverter_serial_number': 'NLBN50201894N017', 'inverter_temperature': <Quantity(23.4, 'centigrade')>, 'dc_voltage_pv1': <Quantity(262.4, 'volt')>, 'dc_current': <Quantity(1.1, 'ampere')>, 'ac_current_t_w_c': <Quantity(0.0, 'ampere')>, 'ac_voltage_t_w_c': <Quantity(0.0, 'volt')>, 'ac_output_frequency': <Quantity(50.02, 'hertz')>, 'daily_active_generation': <Quantity(16.76, 'kilowatt_hour')>, 'total_dc_input_power': <Quantity(3225138.0, 'watt')>, 'total_active_generation': <Quantity(0.0, 'kilowatt_hour')>, 'generation_yesterday': <Quantity(1335.8, 'kilowatt_hour')>, 'power_grid_total_apparent_power': <Quantity(0.0, 'volt_ampere')>}
2021-04-19 19:10:12,648 - solis_service - DEBUG - Received data message from ('192.168.1.18', 17344)
2021-04-19 19:10:12,649 - solis_service - DEBUG - data message: {'inverter_serial_number': 'NLBN50201894N017', 'inverter_temperature': <Quantity(23.4, 'centigrade')>, 'dc_voltage_pv1': <Quantity(262.4, 'volt')>, 'dc_current': <Quantity(1.1, 'ampere')>, 'ac_current_t_w_c': <Quantity(0.0, 'ampere')>, 'ac_voltage_t_w_c': <Quantity(0.0, 'volt')>, 'ac_output_frequency': <Quantity(50.02, 'hertz')>, 'daily_active_generation': <Quantity(16.76, 'kilowatt_hour')>, 'total_dc_input_power': <Quantity(3225138.0, 'watt')>, 'total_active_generation': <Quantity(0.0, 'kilowatt_hour')>, 'generation_yesterday': <Quantity(1335.8, 'kilowatt_hour')>, 'power_grid_total_apparent_power': <Quantity(0.0, 'volt_ampere')>}
2021-04-19 19:10:23,656 - solis_service - DEBUG - Received data message from ('192.168.1.18', 3682)
2021-04-19 19:10:23,657 - solis_service - DEBUG - data message: {'inverter_serial_number': 'NLBN50201894N017', 'inverter_temperature': <Quantity(23.4, 'centigrade')>, 'dc_voltage_pv1': <Quantity(262.4, 'volt')>, 'dc_current': <Quantity(1.1, 'ampere')>, 'ac_current_t_w_c': <Quantity(0.0, 'ampere')>, 'ac_voltage_t_w_c': <Quantity(0.0, 'volt')>, 'ac_output_frequency': <Quantity(50.02, 'hertz')>, 'daily_active_generation': <Quantity(16.76, 'kilowatt_hour')>, 'total_dc_input_power': <Quantity(3225138.0, 'watt')>, 'total_active_generation': <Quantity(0.0, 'kilowatt_hour')>, 'generation_yesterday': <Quantity(1335.8, 'kilowatt_hour')>, 'power_grid_total_apparent_power': <Quantity(0.0, 'volt_ampere')>}

As you can see the inverter sends the same message 3 times with an interval of about 10 seconds. After these messages it remains silent. I have captured some of the data between the inverter and the cloud service (using the intercept script). I'm wondering if the suffix is always the same.

This is a part of the intercept output:

serving on ('192.168.1.51', 10000)
{"timestamp": "2021-04-13T18:45:05.802607", "target": ["47.88.8.200", 10000], "data": "pVYAEEEAAYojXCUC92f/AhQAAAAAAAAABTx4AWQBSDQuMDEuNTFNVy4yLjAxVzEuMC42NCgyMDE4LTAxLTI1MS1EKQAAALxU+fcsqTE5Mi4xNjguMS4xOAAAAAAAAAECATIV", "length": 99}
{"timestamp": "2021-04-13T18:45:05.987256", "target": ["192.168.1.18", 18888], "data": "pQoAEBEqAYojXCUCAZHKdWCqqgAACxU=", "length": 23}
{"timestamp": "2021-04-13T18:45:07.062630", "target": ["47.88.8.200", 10000], "data": "pdcAEEIqAoojXCUBAgH4Z/8CFQAAAJlidl0BALosAABOTEJONTAyMDE4OTROMDI57QCeCl4KMwAJADwAAAAAACYJAAAAAIgTmAUAAAUIAAAY6wAAQTUAAAEAAAAAAAAAAAAAAAAAAAAAAFY1LjI3QnVpbGQyNjEAAAAAAAAAVjUuNDNCdWlsZDE4MgAAAAAAAAAwLjAwQnVpbGQwMDAAAAAAAAAAADAuMDBCdWlsZDAwMAAAAAAAAAAAMC4wMEJ1aWxkMDAwAAAAAAAAAAAwLjAwQnVpbGQwMDAAAAAAAAAAABIV", "length": 228}
{"timestamp": "2021-04-13T18:45:07.207958", "target": ["192.168.1.18", 14511], "data": "pQoAEBIrAoojXCUBAZPKdWCqqgAADxU=", "length": 23}
{"timestamp": "2021-04-13T18:45:09.112543", "target": ["47.88.8.200", 10000], "data": "pRwAEEgrA4ojXCUB+Wf/AhYAAACbYnZdAQEM82f/AgAAAAAAAAAAgRU=", "length": 41}
{"timestamp": "2021-04-13T18:45:09.257586", "target": ["192.168.1.18", 5715], "data": "pQoAEBgsA4ojXCUBAZXKdWCqqgAAGRU=", "length": 23}
{"timestamp": "2021-04-13T18:45:11.375479", "target": ["47.88.8.200", 10000], "data": "pTwAEEgsBIojXCUB+2f/AhgAAACbYnZdAQUsmdFtW0g0LjAxLjUxTVcuMi4wMVcxLjAuNjQoMjAxOC0wMS0yNTEtRCkAAAAyFQ==", "length": 73}
{"timestamp": "2021-04-13T18:45:11.527394", "target": ["192.168.1.18", 5759], "data": "pQoAEBgtBIojXCUBAZfKdWCqqgAAHRU=", "length": 23}
{"timestamp": "2021-04-13T18:45:21.795128", "target": ["47.88.8.200", 10000], "data": "pQEAEEctBYojXCUAuBU=", "length": 14}
{"timestamp": "2021-04-13T18:45:21.941758", "target": ["192.168.1.18", 36488], "data": "pQoAEBcuBYojXCUAAaHKdWCqqgAAJxU=", "length": 23}
{"timestamp": "2021-04-13T18:47:27.352197", "target": ["47.88.8.200", 10000], "data": "pQEAEEcuBoojXCUAuhU=", "length": 14}
{"timestamp": "2021-04-13T18:47:27.352566", "target": ["192.168.1.18", 38516], "data": "", "length": 0}
{"timestamp": "2021-04-13T18:49:49.270415", "target": ["47.88.8.200", 10000], "data": "pQEAEEcuB4ojXCUAuxU=", "length": 14}
{"timestamp": "2021-04-13T18:49:49.270748", "target": ["192.168.1.18", 28424], "data": "", "length": 0}
{"timestamp": "2021-04-13T18:50:24.844280", "target": ["47.88.8.200", 10000], "data": "pdcAEEIuCIojXCUBAgE0af8CUwEAAJpidl0BALssAABOTEJONTAyMDE4OTROMDI56AB6CloKMgAJADoAAAAAABwJAAAAAIQTYwUAABAIAAAZ6wAAQTUAAAEAAAAAAAAAAAAAAAAAAAAAAFY1LjI3QnVpbGQyNjEAAAAAAAAAVjUuNDNCdWlsZDE4MgAAAAAAAAAwLjAwQnVpbGQwMDAAAAAAAAAAADAuMDBCdWlsZDAwMAAAAAAAAAAAMC4wMEJ1aWxkMDAwAAAAAAAAAAAwLjAwQnVpbGQwMDAAAAAAAAAAADQV", "length": 228}
{"timestamp": "2021-04-13T18:50:24.844545", "target": ["192.168.1.18", 7009], "data": "", "length": 0}
{"timestamp": "2021-04-13T18:50:35.838414", "target": ["47.88.8.200", 10000], "data": "pdcAEEIuCYojXCUBAgE+af8CXgEAAJpidl0BALssAABOTEJONTAyMDE4OTROMDI56AB6CloKMgAJADoAAAAAABwJAAAAAIQTYwUAABAIAAAZ6wAAQTUAAAEAAAAAAAAAAAAAAAAAAAAAAFY1LjI3QnVpbGQyNjEAAAAAAAAAVjUuNDNCdWlsZDE4MgAAAAAAAAAwLjAwQnVpbGQwMDAAAAAAAAAAADAuMDBCdWlsZDAwMAAAAAAAAAAAMC4wMEJ1aWxkMDAwAAAAAAAAAAAwLjAwQnVpbGQwMDAAAAAAAAAAAEoV", "length": 228}
{"timestamp": "2021-04-13T18:50:35.979614", "target": ["192.168.1.18", 18665], "data": "pQoAEBIvCYojXCUBAdvLdWCqqgAAYxU=", "length": 23}
jessiesolar commented 3 years ago

Does the output completely stop for at least 30 minutes? In my case, a fresh 228 byte message arrives every 5-10 minutes; so if it takes longer than 15 minutes, something seems indeed wrong.

I must admit I am not sure about that 41 byte message and the 14 byte messages. The 14 byte messages I see as well, and I also see sometimes 60 byte messages; but I ignore all these, and that seems to work fine.

One other improvement I did was to disable acknowledgements on that config_hide.html page - that got rid of a resends, as it seems the response that the solis-service provides is not a proper acknowledgement. I now see a fresh 228 byte message about every 5-10 minutes.

I also added following at the end of async def handle_inverter_message(persist, reader, writer):, to make messages other than the expected 99 and 228 byte messages visible:

    else:
        writer.close()
        logger.debug(f'Invalid data message len: {len(message)}')
        logger.debug(f'Invalid data message: {message}')
silvanverschuur commented 3 years ago

@jessiesolar Thanks for your help! I have disabled the acknowledgements and now it's working.

NibblyPig commented 3 years ago

Been playing with this and it is what I would call a gigantic pain in the bottom.

Even proxying the chinese server with my ginlong wifi stick, it doesn't behave properly. Sometimes it connects and sends no data. Sometimes it ignores the heartbeat acknowledgement messages. And it almost always stops on 3 messages. Occasionally it sends other-sized packets like 41 bytes or 60 bytes.

As a result even though my code works and if I wanted I can emulate the server responses correctly, the thing is so unreliable and stops working so often that it can't feasibly be used to log any data.

What I would give for a simple json API... if anyone has any ideas on why it's so temperamental, would be appreciated.

As a side note my config_hide page doesn't seem to have any option for disabling acknowledgements as mentioned above.

silvanverschuur commented 3 years ago

@NibblyPig Did you try to disable acknowledgements? I had the same issue (stopping after 3 messages) and disabling acknowledgements fixed my problem.

NibblyPig commented 3 years ago

@silvanverschuur Unfortunately I don't seem to have an option for that. Perhaps because I'm using the wifi stick rather than the LAN stick? Or it could be my firmware, however I couldn't find any information about upgrading/downgrading.

Here is a screenshot of my config hide page

Inverter Firmware version (main)003E Inverter Firmware version (slave)0025 Inverter model00AD Wifi stick MW_08_512_0501_1.82

I'm sending the acknowledgements directly from the server, or I can emulate them myself as I figured out from someone else's page how to recreate them. But it sometimes stops responding despite sending them. Resetting the stick fixes it for a short while, like 20 messages or so will send between acks but then it stops again.

silviudc commented 3 years ago

Anyone got this to work consistently with a wifi logger, serial number starting with 072? model EN2-8M and MW_08_512_0501_1.82

jlopez77 commented 2 years ago

Implement support for V5 protocol as used in new embedded ethernet loggers. Needs documentation from Omnik and or iGEN / Solarman.

This is requested. Also a firmware update file is requested.

I might have a bit of information about the V5 protocol... Can we try something?

--- To get data from the logger --- Connect to TCP port 8899 on the WiFi-Kit IP.

Then sent the following DATA (16 bytes) to trigger the logger. HEX: A5 (V5 headCode) HEX: 02 (dataFieldLength) HEX: 10 45 (contrlCode) HEX: e8 e4 71 5f (reversed hex notation of the logger s/n) HEX: e8 e4 71 5f (reversed hex notation of the logger s/n) HEX: 01 00 (command) HEX: 2d (checksum) HEX: 15 (V5 endCode)

I've read all the msgs in the post. I see that most of this information was already decoded.

  public SendInstruction(String paramString, BusinessField paramBusinessField) {
    setStart("A5");
    setControlCode("1045");
    setSerial("0000");
    setDeviceSN(paramString);
    SendDataField sendDataField = new SendDataField();
    sendDataField.setBusinessField(paramBusinessField);
    setDataField(sendDataField);
    setDataLength((String)null);
    setChecksum((String)null);
    setEnd("15");
  }

This is the java function used in the APK to communicate with the inverter...

public String toString() {
    StringBuilder stringBuilder = new StringBuilder();
    stringBuilder.append(this.start);
    stringBuilder.append(this.dataLength);
    stringBuilder.append(this.controlCode);
    stringBuilder.append(this.serial);
    stringBuilder.append(this.deviceSN);
    stringBuilder.append(this.dataField);
    stringBuilder.append(this.checksum);
    stringBuilder.append(this.end);
    return stringBuilder.toString().toUpperCase();
  }

And this is the right order of the fields...

jlopez77 commented 2 years ago

If someone is interested

https://github.com/jlopez77/DeyeInverter

I've written a version to read Deye Inverters with serial 17XXXXX

gordonforbes commented 2 years ago

If someone is interested

https://github.com/jlopez77/DeyeInverter

I've written a version to read Deye Inverters with serial 17XXXXX

This is really great, Updated the config file and removed the comment from the print-command and it work perfectly first time. Thank you very much, you saved me a whole lotta trouble.

jlopez77 commented 2 years ago

Sounds good!

El mié., 25 ago. 2021 15:06, gordonforbes @.***> escribió:

If someone is interested

https://github.com/jlopez77/DeyeInverter

I've written a version to read Deye Inverters with serial 17XXXXX

This is really great, Updated the config file and removed the comment from the print-command and it work perfectly first time. Thank you very much, you saved me a whole lotta trouble.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/XtheOne/Inverter-Data-Logger/issues/3#issuecomment-905484646, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQIBIXBZJPFOHWH3O6Y4KTT6TTFFANCNFSM4D5IESIA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

MichaluxPL commented 2 years ago

If someone is interested

https://github.com/jlopez77/DeyeInverter

I've written a version to read Deye Inverters with serial 17XXXXX

@jlopez77 Do You have any information what should I change in Your solution to get data from Sofar Solar Inverter ? Currently, using Your solution, I can see it comunicates with interver through logger, but logger sends only short packets without the required data.

Michal

jlopez77 commented 2 years ago

If someone is interested https://github.com/jlopez77/DeyeInverter I've written a version to read Deye Inverters with serial 17XXXXX

@jlopez77 Do You have any information what should I change in Your solution to get data from Sofar Solar Inverter ? Currently, using Your solution, I can see it comunicates with interver through logger, but logger sends only short packets without the required data.

Michal

Sadly I dont have one of this to check. Probably my script is not querying the right addresses also, It cannot decode the answers.

MichaluxPL commented 2 years ago

If someone is interested https://github.com/jlopez77/DeyeInverter I've written a version to read Deye Inverters with serial 17XXXXX

@jlopez77 Do You have any information what should I change in Your solution to get data from Sofar Solar Inverter ? Currently, using Your solution, I can see it comunicates with interver through logger, but logger sends only short packets without the required data. Michal

Sadly I dont have one of this to check. Probably my script is not querying the right addresses also, It cannot decode the answers. It's not about querying wrong adresses. The response simply it too short to contain the actuall data. So probably it requires a different query data to be sent.

Michal

jlopez77 commented 2 years ago

In fact, what we send to the inverter is tha addresses we want to query about. If the addresses are not the ones in the MODBUS, the answers are plain garbage.

El sáb, 18 sept 2021 a las 14:58, MichaluxPL @.***>) escribió:

If someone is interested https://github.com/jlopez77/DeyeInverter I've written a version to read Deye Inverters with serial 17XXXXX

@jlopez77 https://github.com/jlopez77 Do You have any information what should I change in Your solution to get data from Sofar Solar Inverter ? Currently, using Your solution, I can see it comunicates with interver through logger, but logger sends only short packets without the required data. Michal

Sadly I dont have one of this to check. Probably my script is not querying the right addresses also, It cannot decode the answers. It's not about querying wrong adresses. The response simply it too short to contain the actuall data. So probably it requires a different query data to be sent.

Michal

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/XtheOne/Inverter-Data-Logger/issues/3#issuecomment-922272985, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQIBIRHLLDUWSNHMYYX4NTUCSEHLANCNFSM4D5IESIA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

MichaluxPL commented 2 years ago

Could You please tell me which part of the request data is the address we ask for ? I've tested several control codes, but the only one that make the logger respond is 1045.

Michal

MichaluxPL commented 2 years ago

Actually, I've managed to figure it out on my own :) Now I have a working solution for Sofar KTL-X intverter family. Thanks jlopez77 for a great work !

mindakas commented 2 years ago

Actually, I've managed to figure it out on my own :) Now I have a working solution for Sofar KTL-X intverter family. Thanks jlopez77 for a great work !

Michal, could you share your findings? Have you managed to connect to Sofar inverter via WiFi kit?

MichaluxPL commented 2 years ago

Actually, I've managed to figure it out on my own :) Now I have a working solution for Sofar KTL-X intverter family. Thanks jlopez77 for a great work !

Michal, could you share your findings? Have you managed to connect to Sofar inverter via WiFi kit?

I'll make a project on github shortly to share the solution. Yes it allows to gather Sofar inverter data through WiFi dongle (WLS-3).

jlopez77 commented 2 years ago

That's Great! I didn't have a computer with me this weekend so I couldn't point you to the correct lines, but I see that you managed to solve it by yourself. Please share with the community so I can star your project!

El dom, 19 sept 2021 a las 13:20, MichaluxPL @.***>) escribió:

Actually, I've managed to figure it out on my own :) Now I have a working solution for Sofar KTL-X intverter family. Thanks jlopez77 for a great work !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/XtheOne/Inverter-Data-Logger/issues/3#issuecomment-922457186, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQIBIRDI72S6S5YF5Z5EULUCXBPDANCNFSM4D5IESIA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

MichaluxPL commented 2 years ago

OK, so the new project (based on @jlopez77 fantastic work) is here: https://github.com/MichaluxPL/Sofar_LSW3 In addition to Sofar registers mapping, I've made some other changes in the code to make some results look better or use dictionaries from mapping file. One thing: I'm not sure if two byte values (Total production and Total generation time) are derived correctly (when first byte value <> 0) - have to think about this :) Enjoy :)

jmccrohan commented 2 years ago

FYI

I've written a Python module to interact with Solarman v5 data loggers. The library exposes a Modbus type interface and encapsulates the Modbus RTU frames in the V5 protocol.

https://github.com/jmccrohan/pysolarmanv5/

Might be of use to someone here.

iv765 commented 1 year ago

Thx to the community

For Bosswerk(Deye) MI600 SN=22* FW=V0.2.0.1 V0.1.1.4 V1.2.1.2

this works for me:

def parse_inverter_message(message): return { "Timestamp": datetime.now().timestamp(), "Today(44)": unpack_from("<H", message, 44)[0], # Or? unpack_from("<I", message, 44)[0] "Total(48)": unpack_from("<H", message, 48)[0], # Or? unpack_from("<I", message, 48)[0] "Frequency(68)": unpack_from("<H", message, 68)[0], "Production(70)": unpack_from("<H", message, 70)[0], "Voltage(56)": unpack_from("<H", message, 56)[0], "Temperature(74)": unpack_from("<H", message, 74)[0], }

BR

iMarvinS commented 1 year ago

Thx to the community

For Bosswerk(Deye) MI600 SN=22* FW=V0.2.0.1 V0.1.1.4 V1.2.1.2

this works for me:

def parse_inverter_message(message): return { "Timestamp": datetime.now().timestamp(), "Today(44)": unpack_from("<H", message, 44)[0], # Or? unpack_from("<I", message, 44)[0] "Total(48)": unpack_from("<H", message, 48)[0], # Or? unpack_from("<I", message, 48)[0] "Frequency(68)": unpack_from("<H", message, 68)[0], "Production(70)": unpack_from("<H", message, 70)[0], "Voltage(56)": unpack_from("<H", message, 56)[0], "Temperature(74)": unpack_from("<H", message, 74)[0], }

BR

Could you please go a little bit more into detail how you got it working? I own exactly the same Inverter with the the same FW Version but simply replacing the parse_inverter_message function with your version and intercepting the Inverter's traffic did not work.

ppiwowar commented 1 year ago

Implement support for V5 protocol as used in new embedded ethernet loggers. Needs documentation from Omnik and or iGEN / Solarman. This is requested. Also a firmware update file is requested.

I might have a bit of information about the V5 protocol... Can we try something?

--- To get data from the logger --- Connect to TCP port 8899 on the WiFi-Kit IP.

Then sent the following DATA (16 bytes) to trigger the logger. HEX: A5 (V5 headCode) HEX: 02 (dataFieldLength) HEX: 10 45 (contrlCode) HEX: e8 e4 71 5f (reversed hex notation of the logger s/n) HEX: e8 e4 71 5f (reversed hex notation of the logger s/n) HEX: 01 00 (command) HEX: 2d (checksum) HEX: 15 (V5 endCode)

I've read all the msgs in the post. I see that most of this information was already decoded.

  public SendInstruction(String paramString, BusinessField paramBusinessField) {
    setStart("A5");
    setControlCode("1045");
    setSerial("0000");
    setDeviceSN(paramString);
    SendDataField sendDataField = new SendDataField();
    sendDataField.setBusinessField(paramBusinessField);
    setDataField(sendDataField);
    setDataLength((String)null);
    setChecksum((String)null);
    setEnd("15");
  }

This is the java function used in the APK to communicate with the inverter...

public String toString() {
    StringBuilder stringBuilder = new StringBuilder();
    stringBuilder.append(this.start);
    stringBuilder.append(this.dataLength);
    stringBuilder.append(this.controlCode);
    stringBuilder.append(this.serial);
    stringBuilder.append(this.deviceSN);
    stringBuilder.append(this.dataField);
    stringBuilder.append(this.checksum);
    stringBuilder.append(this.end);
    return stringBuilder.toString().toUpperCase();
  }

And this is the right order of the fields...

jlopez77, I am not sure I understand how the below sequence:

--- To get data from the logger --- Connect to TCP port 8899 on the WiFi-Kit IP.

Then sent the following DATA (16 bytes) to trigger the logger. HEX: A5 (V5 headCode) HEX: 02 (dataFieldLength) HEX: 10 45 (contrlCode) HEX: e8 e4 71 5f (reversed hex notation of the logger s/n) HEX: e8 e4 71 5f (reversed hex notation of the logger s/n) HEX: 01 00 (command) HEX: 2d (checksum) HEX: 15 (V5 endCode)

is compatible with SolarmanV5 protocol? https://pysolarmanv5.readthedocs.io/en/latest/solarmanv5_protocol.html

BTW: Your code https://github.com/jlopez77/DeyeInverter is compatible with SolarmanV5.

Which one is right ? Regards, Paweł

iv765 commented 1 year ago

For Bosswerk(Deye) MI600 SN=22* FW=V0.2.0.1 V0.1.1.4 V1.2.1.2 this works for me (writing to /dev/shm/pv.json):

intercept.zip

iv765 commented 1 year ago

@iMarvinS

Do you confirm?

    "Voltage1(96)":                         0.1 * unpack_from("<H", message, 96)[0], # seems to be Voltage Module1
    "Ampere1(98)":                          0.1 * unpack_from("<H", message, 98)[0], # seems to be Ampere Module1
    "Voltage2(100)":                        0.1 * unpack_from("<H", message, 100)[0], # seems to be Voltage Module2
    "Ampere2(102)":                         0.1 * unpack_from("<H", message, 102)[0], # seems to be Ampere Module2

BTW: Response Time might by lazy, keep calm( >10m)

Bosswerk(Deye) MI600 SN=22* FW=V0.2.0.1 V0.1.1.4 V1.2.1.2

BR

iMarvinS commented 1 year ago

@iv765 It worked out perfectly, thank you very much! I

iv765 commented 1 year ago

Cloudless (App does not work) Bosswerk(Deye) MI300/MI600/SUN600G3-EU-230 SN=22* FW=V0.2.0.1 V0.1.1.4 V1.2.1.2 inverter.zip Experimental !!!

psunny28 commented 1 month ago

Can some one help decode the bytes

data_packet1 = b'\xa5\x82\x00\x10A\x00\x01\x8cn\x91\xd1\x02\xa8\xc0\x06\x00:\x00\x00\x00\x00\x00\x00\x00\x05<x\x011\x03LSW5BLE_17_DD01_1.23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@*\x8f?\xa2\x1c192.168.0.80\x00\x00\x00\x00\x03\x00\x01\x01\xdd\x07\x00\xffV1.1.00.0B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xffF\x15'
data_packet2 = b'\xa5\x82\x00\x10A\x00\x02\x8cn\x91\xd1\x02\xc7\xc0\x06\x00Y\x00\x00\x00\x00\x00\x00\x00\x05<x\x014\x03LSW5BLE_17_DD01_1.23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@*\x8f?\xa2\x1c192.168.0.80\x00\x00\x00\x00\x03\x00\x01\x01\xdd\x07\x00\xffV1.1.00.0B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x88\x15'
data_packet3 = b'\xa5\x82\x00\x10A\x00\x03\x8cn\x91\xd1\x02\xe6\xc0\x06\x00x\x00\x00\x00\x00\x00\x00\x00\x05<x\x011\x03LSW5BLE_17_DD01_1.23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@*\x8f?\xa2\x1c192.168.0.80\x00\x00\x00\x00\x03\x00\x01\x01\xdd\x07\x00\xffV1.1.00.0B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc4\x15'

This would be a great help

also help me understand the decoding