herrJones / node-ginlong

Node.JS parsing of Ginlong/Solis pv-panel data
GNU General Public License v3.0
9 stars 0 forks source link

Solarman-Ethernet #1

Open BasSwildens opened 3 years ago

BasSwildens commented 3 years ago

Really nice work on this SolarInverter datalogging, we have it working on our Solis 4G-5kW solarpower inverter. Thanks you for all your work on this.

I am wondering why you chose to work with binary-parser to parse the messages? It looks like that our inverter with a Ethernet dongle is sending a different lenght message than the node would expect. I'm seeing a different pkgtype (232) from parsing our message than tested in your lib. I'm curious how to interpret the test IF (pkgtype != 119, line 220 - analysis.js) is preventing records being written to the logs table of the database. Do you have any pointers on that?

Thanks, Bas

herrJones commented 3 years ago

Hey Bas,

Happy to see someone who likes it too!

While the binary-parser has some drawbacks, it is also a structured way to parse such binary packages. So I chose the easy way :-) I have no idea if - in the end - everything's done efficiently. Since this one is not time-critical, I don't give a ...

Concerning the protocol: it seems we get 2 kinds of packages: some kind of 'preambles' with (just?) a timestamp in it (the unixepoch field). The long version contains the actual data.

I know you can select (in the 'home'-page of your inverter) between several protocols. The most obvious ones are Solarman-1 and Solarman-eth. There is also a 'custom' version but it seemed the same as the ethernet version. Most probably you have a newer version. If you'd like to invest some time and contribute: feel free. The raw data is stored in the SQLite db, so you can even investigate at night. Exporting stats from the provider (mine is ginlong) can get you started on the fields available in the data package.

If you compare the Solarman-1 and *-eth protocols, you'll notice they're quite similar (I know my reverse engineering but I'm not that smart ;-) ).

Kind regards,

Jan