[APP][Pro] Modbus

I first set the connection type to keep connection as well, but i realised, that after 2-3 hours the connection gets closed (maybe by the dongle itself?). So I made to manual so that I can restart the connection (close and open) when the read query stucks with the typical error (no modbus connection). I didn’t try out if it workes like this, I hav to wait now 2 hours till it stucks again, and I hope the automatic restart works.

The app should reconnect itself. But perhaps the apps state is wrong and it thinks it’s still connected. I’ll check later if that’s the cause.

The connection handling is a bit ugly if you are combining the socket and the modbus classes :upside_down_face:

I get the same error with 0.3.3. No connection to modbus server.
I also tried to use Manual or Single connect. It works 1-2 times then it fails.

LE: reverted to 0.1.5 and it works perfectly.

I also reverted to 0.1.5 and it works perfectly. I have a Huawei inverter

I think it’s the auto reconnect after the inverter closes the connection that’s not working. I’ll check it later…

manual reconnection doesn’t work either. After 30 - 90 minutes the modbus app just stucks. And also close and reopen connection doesn’t work. Now i made a flow, whenever there is a error in one flow card, the modbus app will be restarted. With this I get along. All 30.90 minutes I get a restartm but it works. I am sure, ronny you’ll find the right solution.

And all issues started while trying to bring single connection and multi device together :sweat_smile:

As mentioned, I set up a flow to restart the Modbus app when there is a error code coming with readout of a Modbus address. With this I get my data read. With the modus “Keep connection” the error code comes more often than in manual mode. As suggested from Ronny I put a timeline message on each restart of Modbus app:


@Bosse_Rasater in older versions the connection only worked if you connect directly and exclusive to one single ID. But connection to more than one ID didn’t work with my Huawei system. Also if it worked at all, it always stopped after two hours or earlier. Ronny doesn’t have problems with his own fronius inverter. This seems to be a Huawei specific problem. So thanks to him that he invested so much of his time to help us Huawei users to get along.

OK I understand.
It’s not a problem for me as I only have one inverter connected with a wifi dongle. I reverted to version 0.1.5 which works great for my purposes. Also version 0.2.0 worked perfectly but it is not available anymore. I agree with you that we should give RonnyW a big thank you for the effort.

@Bosse_Rasater I have the same situation, that is a single inverter with a Wifi dongle. Can’t get it to work (“no connection to server”) but my suspicion is that Modbus TCP simply is not activated on my dongle. Until I get that fixed, would You be so kind and tell me what combination of ID and port that works for You? Both port 502 and 6607 are mentioned here and there. Seems to depend on what version of firmware you have. What works for You?

Usually port is 502 and ID is 1.

I use port 502 and ID 1.
You have to activate Modbus in the Dongle. I use the “unrestricted” option. I don’t know if you need an installer account to do this.

@Bosse_Rasater @Valentin_Ciopei
Thanks both of you!
I have sent mail to my installer to see if they remotely can set the “unrestricted” option for Modbus.
/PO

1 Like

What does it look like if you have connected the dongle via a network cable? Or is there no difference to WiFi?

New test version 0.3.4:

  • Fixed device reconnect (hopefully :slight_smile: )

Who wants to test?
FYI: @Sasan_Khandanpour, @Bosse_Rasater , @Valentin_Ciopei, @PO_Blomstrand

@RonnyW Many thanks again for this great app. Today was the first day I was actually able to control my heat pump thanks to it!

What I found that the app seems to crash from time to time. The modbus connection is then down and the only possibility to get it reestablished is to restart the app.

Do you think it will be possible in the future to also write negative values? E.g. the offset of my heating curve supports values in the range -10 to +10, but right now I can only write 0 to +10.
image

Also, when trying to read certain registers with size 6 and INT64, the flow card just hangs forever. (INT32 would result in non-sense values, therefore I tried INT64).
image

Please let me know if I can help in anyway.

That was a reconnect issue. The app didn’t reconnect after the connection was closed by the Modbus device. Thsi should be fixed in new test version - hopefully :slight_smile:

I will check the datatypes. I hope I find some registers to work with…

1 Like

Been looking for a Modbus app for a long time and gave up. Too soon now I see :grin:
Great app, thanks! No problem retrieving data from my M-Tec heatpump (with Keba controller).

2 Likes

Which brand is your inverter? I have Huawei. First you need your provider to activate Modbus unregistered… You could do it by yourself using a special Huawei app. But you need to have the password. Must PV installer change password to avoid you making something wrong… But they can do it remotely.
Than you must first install the dongle using ID 100. Next you must install the inverter using id1. You can ask your provider which Id is right

I’ll test immediately