# Problem to get robust Modbus connection to SMA Inverter

**URL:** https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343
**Category:** General
**Tags:** modbus
**Created:** [12 August 2022 06:36 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343 "2022-08-12T06:36:09Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![klaus123](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/klaus123/32/39677_2.png) [@klaus123](https://discourse.nodered.org/u/klaus123)
#### Post date: [12 August 2022 06:36 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/1 "2022-08-12T06:36:09Z")

</div>

Hallo  
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).

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [12 August 2022 06:46 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/2 "2022-08-12T06:46:08Z")

</div>

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 ?

Craig

---

<div class="post-metadata">

### Author: ![klaus123](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/klaus123/32/39677_2.png) [@klaus123](https://discourse.nodered.org/u/klaus123)
#### Post date: [12 August 2022 15:08 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/3 "2022-08-12T15:08:58Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [12 August 2022 15:28 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/4 "2022-08-12T15:28:25Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![klaus123](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/klaus123/32/39677_2.png) [@klaus123](https://discourse.nodered.org/u/klaus123)
#### Post date: [12 August 2022 16:18 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/5 "2022-08-12T16:18:59Z")

</div>

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 ☹

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [12 August 2022 16:21 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/6 "2022-08-12T16:21:55Z")

</div>

Does the inverter have a fixed IP address?

Can you ping the device before and after it hangs?

---

<div class="post-metadata">

### Author: ![klaus123](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/klaus123/32/39677_2.png) [@klaus123](https://discourse.nodered.org/u/klaus123)
#### Post date: [12 August 2022 16:25 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/7 "2022-08-12T16:25:51Z")

</div>

Ping seems to be ok

> C:\Users\Admin\>ping 192.168.1.149
> 
> 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  
> (0% Verlust),  
> Ca. Zeitangaben in Millisek.:  
> Minimum = 75ms, Maximum = 130ms, Mittelwert = 98ms

But my Senec Battery lacking data from the inverter too

---

<div class="post-metadata">

### Author: ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)
#### Post date: [12 August 2022 16:30 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/8 "2022-08-12T16:30:59Z")

</div>

@klaus123  
You can try another approach, install the free [Modbus Master](http://modbusmaster.com/) 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.  
Good luck.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/6440e2c95ec3a34519a5e105d6b9a14226aa2ed1.png)

---

<div class="post-metadata">

### Author: ![klaus123](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/klaus123/32/39677_2.png) [@klaus123](https://discourse.nodered.org/u/klaus123)
#### Post date: [12 August 2022 17:22 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/9 "2022-08-12T17:22:17Z")

</div>

@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

---

<div class="post-metadata">

### Author: ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)
#### Post date: [12 August 2022 20:32 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/10 "2022-08-12T20:32:39Z")

</div>

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.  
[https://www.kscada.com/modbusdoctor.html](https://www.kscada.com/modbusdoctor.html)

---

<div class="post-metadata">

### Author: ![klaus123](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/klaus123/32/39677_2.png) [@klaus123](https://discourse.nodered.org/u/klaus123)
#### Post date: [12 August 2022 20:34 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/11 "2022-08-12T20:34:45Z")

</div>

Thank you - currently the inverter and myself try to sleep..... I'll try tomorrow

---

<div class="post-metadata">

### Author: ![klaus123](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/klaus123/32/39677_2.png) [@klaus123](https://discourse.nodered.org/u/klaus123)
#### Post date: [13 August 2022 07:15 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/12 "2022-08-13T07:15:25Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)
#### Post date: [13 August 2022 07:42 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/13 "2022-08-13T07:42:01Z")

</div>

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.  
Good day.

---

<div class="post-metadata">

### Author: ![klaus123](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/klaus123/32/39677_2.png) [@klaus123](https://discourse.nodered.org/u/klaus123)
#### Post date: [13 August 2022 08:25 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/14 "2022-08-13T08:25:41Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)
#### Post date: [13 August 2022 08:36 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/15 "2022-08-13T08:36:13Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![klaus123](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/klaus123/32/39677_2.png) [@klaus123](https://discourse.nodered.org/u/klaus123)
#### Post date: [13 August 2022 08:38 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/16 "2022-08-13T08:38:27Z")

</div>

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:

> **[PV-Anlagedaten in Home Assistant auswerten](https://klaus-macht-bilder.blogspot.com/2021/04/pv-anlagedaten-in-home-assistant.html)**
>
>   Heute wird es hier mal un-photographisch: Seit einiger Zeit beschäftige ich mich mit der Smart Home Software Home Assistant , die ich ...

---

<div class="post-metadata">

### Author: ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)
#### Post date: [13 August 2022 08:43 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/17 "2022-08-13T08:43:46Z")

</div>

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 ?

---

<div class="post-metadata">

### Author: ![klaus123](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/klaus123/32/39677_2.png) [@klaus123](https://discourse.nodered.org/u/klaus123)
#### Post date: [13 August 2022 09:03 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/18 "2022-08-13T09:03:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [14 August 2022 00:50 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/19 "2022-08-14T00:50:26Z")

</div>

Yep - probably not really healthy - but a couple of things (which many people here in Australia have to do)

1. 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

2. 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 ?

3. 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

Craig

---

<div class="post-metadata">

### Author: ![klaus123](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/klaus123/32/39677_2.png) [@klaus123](https://discourse.nodered.org/u/klaus123)
#### Post date: [15 August 2022 08:31 UTC](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343/20 "2022-08-15T08:31:54Z")

</div>

Hello  
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:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/b/dbd4ff949d8bc3e058fb7bca3b2d0ce2d98ac839.jpeg)  
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.  
 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/d/2d067f3f2e9dbce7c6ab6ad699c0f9c0af310fe2.jpeg)  
(Picture reversed for readability)

Nevertheless I ordered a passive cooling element to be applied on that chip.

[Next page](https://discourse.nodered.org/t/problem-to-get-robust-modbus-connection-to-sma-inverter/66343.md?page=2)
