Excellent news (in these dark corona days): it works!
The SUN2000L is slightly different form its predecessor:
COM-pinout connector = pin 1 - & pin 2 + (not pin3 as I did all my previous tests without result)
WLAN can stay active together with RS485, working both at the same time
offline “No irradiation” does not cut off the communication
hotplugable COM-port, no restart needed
With my test setup, seen frequent ‘Try 1 out of 3 failed when executing request’. 2nd retry often is enough to obtain the data. Even after extending all settings to ‘refresh=10000’ kept me seeing this messages. Any idea, suggestion?
Nice.
I just looked at my manual and the pin out is really different then.
Because pin 1 and 2 would not work with my inverter.
Offline "no irradiation"does not cut off all communication you can only see E-total,E-day ,warnings and alarms.
do you use an exact copy of my things file?(if not show me your things file)
I still think the WLAN causes your problem.(mine runs super stable without errors)
I have never done a lot of tests with the WLAN module(it was allways causing issues) because I prefer to keep everything local. If I have some time tomorrow I will test some more with the WLAN module plugged in to see what happens and if it is causing your problem.
Take care with your physical RS485 wiring. Twisted pair, avoid running alongside power cables, ensure good termination. Most USB dongles include one terminator which willoften “do”, but consider another if the cable is over a couple of metres and the other end is unterminated.
For persistence en graphing i use grafana and influxdb.
you can make nice graphs with grafana.
i followed this tutorial InfluxDB+Grafana persistence and graphing
It is not a huge amount of data i reinstalled openhab 6 months ago and this is the volume of data for all my items i persist.
81M /var/lib/influxdb/data/openhab_db
I am only persisting the gSolar group in the inverter items file.
This is my influxdb.persist
Strategies {
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
everyMinute : "0 * * * * ?"
// if no strategy is specified for an item entry below, the default list will be used
default = everyMinute
}
/*
* Each line in this section defines for which item(s) which strategy(ies) should be applied.
* You can list single items, use "*" for all items or "groupitem*" for all members of a group
* item (excl. the group item itself).
*/
Items {
Heatpump * : strategy = everyMinute,restoreOnStartup
gShelly * ,gSolar *,gHeatpump * ,gSystem * : strategy = everyChange,restoreOnStartup,everyMinute
Sun_Azimuth * : strategy = everyHour
gVerlichting * ,ComfoAir * , gIrrigation * ,gIrrigation_Times * ,gVac * ,gVacStat * ,gVacCons * , gVacHist * ,gVerlichtingsinput * : strategy = restoreOnStartup
}
I just plugged the WLAN module out and the error remains.
I had to take the power of the inverter and let it reboot to get everything back to normal.
I just read the quick guide and it said if the smart dongle(WLAN module) is configured you are advised to install the smart dongle before connecting the signal cable.
Maybe you can give that a try?
But why do you want to use the smart dongle you can have the same fuctions in openhab?
Checked both register definitions versions one by one, all appear to be equal.
Did some another test; see the screenshot below; left my WLAN active and connected to RS485 over usb and pulled all the meaningfull holding registers with a scan rate of 1000ms. A significant larger datastream without any errors over an interval of 10 minutes (Modbus Poll limit unregistered - used setting files available on request).
My installer is supervising his installations for errors as a free service, on the Huawei platform.
My idea on the dropped answer issue: I suspect that the openhab modbus binding is connecting/disconnecting after each poll. On reconnect, there might by a (longer) wait time (penalty) when the WLAN is active.
Can the poller things be configured to keep the COM port open, once connected?
Why would you think that would matter? Modbus is a master-slave protocol. The slave has no idea when it is going to be queried, until it is queried. However long it takes the master to prepare to query is immaterial.
It might make a difference to slave response time, if it has to handle extra tasks too on WLAN.
CRC errors are a pretty reliable indicator of crap on the serial line. Have you considered that the WLAN may contribute to RF interference, or noise via the RS485 interface’s power feed?
Earth loop and termination issues can create time-based weirdness, where a busy line can run error free, while transmission silences allow errors to appear.
If you want you can make rules that send e-mail’s or send push messages when the inverter is giving an error.Then you can contact your installer.every installer does this without any effort, because the alarms come in automatically.I am planning to make this rules for error notification when i have some free time.
You can see the alarms with the modbus connection.normal state is 0 and error is 1
In my site map the alarms are visual.
Test setup was on a crappy W10 2.5.2, now on a fresh installed RPI3b potential free setup; powerbank fueled, wifi and only usb-RS485 short wired 2 cm, not even 1 error.
Pushed it to the limit by increasing the poll freq to 1000 ms and all is running fine now!
@Rado1 for easy use I crammed all pollers under 1 serial brigde in the things file and added ‘reconnectAfterMillis=500’ to it
So it is running fine with the WLAN module?
If i read the docs the ‘reconnectAfterMillis=500’ is a TCP bridge parameter.
And we are using a serial bridge?
Does this parameter work on a serial bridge?
If you remove it do you get error’s?
Maybe I should also take a look at my cabling because I have not used a shielded cable.
Thanks for the tip i set all pollers under 1 serial bridge
It’s not generally needed except in adverse environments e.g. heavy machinery. Twisted pair usually suffices, but much depends on the wiring route.and electrically noisy neighbours.
Do pay attention to RS485 termination.
Dropped the ‘reconnectAfterMillis=500’ without errors @ 1000 ms for all readings.
To be sure all detection is done correctly, unplugged a few seconds and got noticed in the log.
Nice
I am going to replace my cable to the inverter with a shielded one and see what it gives. I can’t bring everything close to the inverter because I have multiple modbus modules on the RS485 bus.
I removed the timeBetweenTransactionsMillis= parameter from the tutorial it got in there because i used it for testing with my other DI and DO modbus modules.There is no need for it in reading out the inverter.
Big thanks for this. Have a SUN2000-15KLT-M0 and modbus definitons are nearly the same (some modifications/additions on error and warning codes)
Two points:
The bigger Huawei inverters have DC input sockets which are internally connected e.g. 15KTL has PV1 - PV4, where PV1+PV2 and PV3+PV4 are in parallel. In this example PV1 and PV2 show the same voltage, but only PV1 is showing the current (PV2 current = 0)
Not sure about modbus binding, but when I change something the modbus is waiting the defined time updateUnchangedValuesEveryMillis until I get another reading of data. Also most of the time the first polling ends with an error (CRC, try 1 of 3,…) Afterwards everything runs smoothly. Maybe my wiring isnt professional enough?