I run Node Red in a Home Assistant environment as an Add-on.
I have a TCP-connection to a SMA Tripower Inverter and read date via Modbus-Getter which works fine in general, but after some minutes, hours, days or weeks (very wide range - I know) the Modbus Server connection is interrupted. In these cases the flow stops in the Modbus-Getter-Node and I do not get any data.
To restart I have to cold start the inverter (only way I found so far). Is ther any way to reset the TCP-Modbus connection via a Node Red-Node?
PS: Node Red Version is the latest in HA (13.3.1).
Based on your description of the problem it would seem your inverter interface is the one locking up rather than Node Red ? Not sure how you would think NR could solve that ?
ALso as you are using the HA add-in - it might be better to ask on the HA Node Red (third party integration) forum ?
You are not (by chance) also running the SMA Home Monitor are you ? As i believe this also connects with Modbus TCP to the Inverter ?
Thank you Craig. Based on you idea I increased the dely to 3 second an removed the all-10-minutes part ..... but no success.
I had some failures which recovered but finally after app. 1h it fails permanently again.
Is there any possibility in NR to recover or reset the Modbus connection?
If you reboot the Pi (if that is what it is) does it recover? If not then there is not much that node-red can do. If it does recover when you reboot the pi, does it recover if you just restart node-red?
I shutdown the Pi Host Supervisor and restarted the Pi by a cold start: No success. Still no Modbus connection.
I come more to the conclusion that this might be a hardware issue
Does the inverter have a fixed IP address?
Can you ping the device before and after it hangs?
Ping seems to be ok
Ping wird ausgeführt für 192.168.1.149 mit 32 Bytes Daten:
Antwort von 192.168.1.149: Bytes=32 Zeit=130ms TTL=64
Antwort von 192.168.1.149: Bytes=32 Zeit=80ms TTL=64
Antwort von 192.168.1.149: Bytes=32 Zeit=75ms TTL=64
Antwort von 192.168.1.149: Bytes=32 Zeit=108ms TTL=64
Ping-Statistik für 192.168.1.149:
Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0
Ca. Zeitangaben in Millisek.:
Minimum = 75ms, Maximum = 130ms, Mittelwert = 98ms
But my Senec Battery lacking data from the inverter too
You can try another approach, install the free Modbus Master software on a Windows PC and query your SMA for a long time to see if the problem appears too.
Make sure you don't have another program somewhere on your network that has also connected to your SMA.
So don't forget to turn off your HA add-on for the test.
@Jean-Luc: Is there anything specific I have to look for?
After start of the Modbus Monitor I put in the adresses and ports, but I cannot get any connection established
My apologies. I meant modbus doctor as software.
With this one, you just have to give the ip address, the port, the register, the length.
Once the values are found and displayed, click on the button that allows to loop every x seconds.
Thank you - currently the inverter and myself try to sleep..... I'll try tomorrow
I tried Modbus-Doctor - seems to be a good tool. Thank you Jean-Luc
This morning after cooling down the Signal was available for some minutes and died then. I am now convinced that this is a Hardware over-heat problem... so nothing Node Red can solve.
I will install a separate measurement unit as a repair just for this purpos would be more expensive.
I think we can close this discussion - Thank you all for your help
What brand is your inverter?
Does it have an external dongle to connect to wifi or does it connect via rj45.
It must also have rj11 or rj45 connectors for rs232 or rather rs485 serial links.
You could use this to talk to your inverter.
Nodered is an excellent tool for this.
It has 2 dedicated nodes for this. One for rs232 and one for modbus.
However, you need the documentation for the dialogue protocol and the pinout of the connectors.
It is a SMA STP 7000TL-20 711 connected to the local network via RJ45.
External connectors I have not found and have not looked inside so far. I will have a closer look..will need some time
I know about the NR capabilities and currently control my ABL Charger via an RS485 interface.
It is a large three-phase inverter. A nice tool it seems.
However I see in the documentation that it connects to the SMA cloud.
Wouldn't the problem come from there ?
What is the automated data acquisition interval to the Sunny Portal cloud?
Wouldn't the Modbus link be interrupted when the inverter connects to the cloud?
Just a thought.
SMA is using a special bus (Speedwire) for that communication - this interface still gets data but I do not see any Access to that Data
Some details of my setup I described on my Blog:
Maybe I didn't make myself clear.
When you come to pool the inverter from HA, there may be a conflict when the inverter decides to connect to the cloud to send its data ?
The surprising thing is that it ran good for nearly 1 1/2 years. The problem occurs normale seldom but more frequently in hot summer.
I looked to old data and found severe problems last August too
Yep - probably not really healthy - but a couple of things (which many people here in Australia have to do)
Is the Inverter mounted out of direct sunlight ? If not need to build it a little awning/canopy to keep the harshest Summer sun off it - especially when it is working hardest
Does the Inverter have its own fans ? You might want to make sure they are working properly and not clogged up - how old is the inverter ?
It may be worthwhile supplementing with additional external fans mounted to the bottom of the inverter heatsink - you could automate these to only operate when the inverter internal temperature reaches X degrees
It seems that the number of requests is heating the responsibel chip - even 2 read operations all 10 seconds is not much.
Yesterday evening I reduced to 2 reading all 5 minutes and so far today things run fine and even the Senec battery gets data again. I hope it is not just the weather less hot today.
I opend the inverter case and found following situation:
As there are high DC-Voltages involved I would like to keep changes minimal. I was able to identify the chip but have not taken any temperature mesurements so far.
(Picture reversed for readability)
Nevertheless I ordered a passive cooling element to be applied on that chip.