Modbus stops without any errors

You´re right. everything is working fine since I´d enabled the trace log…
I will not have time to give your suggest a try untill late tonight or tomorrow. But I will give it a try for sure.

1 Like

I got two stops since the change.
First one was just after 1 hour second around 11 hours.
So it seems no fix with the new pool2 version.

Ok that’s a shame to hear :grimacing:

Would you please run the threads commands when it is stuck?

Yet another possible fix

Install the binding manually, with pool 2.8.1, per the instructions in this post. Use the jar files from this zip:
modbus-fix-hang-reupload.zip.pdf (309.0 KB)

Successful installation should look like (check the date part after 2.5.9....)

openhab> bundle:list -s|grep '(modbus|pool)'; bundle:tree-show org.openhab.io.transport.modbus|grep pool2
256 │ Active   │  80 │ 2.5.9.202009100355      │ org.openhab.io.transport.modbus
257 │ Active   │  80 │ 2.5.9.202009100357      │ org.openhab.binding.modbus
266 │ Resolved │  80 │ 2.8.1                   │ org.apache.commons.commons-pool2
+- org.apache.commons.commons-pool2 [266]

2 Likes

Can you upload modbus-fix-hang.zip again? jar files contain only text of .jar file locations…
I have the same issue since I configured my inverter (SE4K) - it works for a few hours then suddenly stops - no matching errors in log files.

After about two days without any interupts I just got an stop again.
Here is the threads output: threads.txt (77.0 KB)

I will try the new possible fix tomorrow.
As said by @pewu78 the .jar Files you uploaded are only 1kb, I guess the compile failed.

1 Like

Thanks @pewu78 @jomojomo95. Reuploaded above.

Thanks. Got it up running as instructed together with org.openhab.binding.modbus.sunspec-2.5.8.jar, will see how it works.

Hi @ssalonen sorry for beeing away… I had some personal issues here I had to deal with first… Modbus has been running stable ever since I started the trace logging.

Anyway, I´m ready to test now. Just one question.
When using Zigbee og Zwave, I assume #8 should not become a problem. As far as I recall, both Zigbee and Zwave uses the transport serial, right?

You are probably correct indeed. If you do not get error on “gnu.io” then it’s fine.

Regarding trace logging: Yes… It seems that the problem does not manifest with the trace logging enabled. This is a bit of luck and probabilities… I presume the few extra milliseconds that go into logging help to sidestep the bug.

In order to test the new possible fix, I would like you to remove the trace logging, to make it more likely to encounter the issue if it is still present. Our target is of course have the system working with all logging levels :slight_smile:

Hi any update on the stability with the fix?

We are bit rushed to get this into 2.5.9 release, so all test results are most appreciated :slightly_smiling_face:

I have it running since yesterday fine - it’s the first time it worked for so long (overnight), so it’s a good sign. :+1:
My only issue is with status item (string) - it’s not obtained for some reason…

1 Like

Sorry haven’t had any time yesterday, just switched the modbus bindings to 2.5.9.
Will give feedback as I have results.

I hope I can try the latest update tonight, have had some other stuff going on. Maybe this will be “the fix”.

1 Like

Have it up running for a few hours… Still no issue.
Anyway… For some reason I had to install the transport serial, even though I have Zwave and Zigbee running as well… Pretty weird!

1 Like

For me it’s still working, so I’m eager to say it’s fixed. Thank you.

1 Like

I finally got a chance install the latest update a few minutes ago and it is working fine so far. I will try to report back after it has run for several hours.

1 Like

Thank you @pewu78!

Yes I think this should do it – I introduced a precise ‘workaround’ in the binding to resolve the specific problem witness by all of you in this thread.

It looks like the actual bug is in a 3rd party library but unfortunately I could not figure it out to fix it in upstream. As your reports have shown, it is quite hard to reproduce and requires very specific conditions to trigger. I suspect that the issue was possible with previous binding versions but these exact conditions did not just occur.

Thank you all, would have not been possible without your testing! I pushed fix for the official binding, should hopefully get to the next release.

@ssalonen,

I am sorry about being a little slow getting this update installed, my wife’s mother fell this week and was hurt pretty bad so there has been a lot going on here.

I did get the update installed last night, or perhaps more accurately early this morning and am very pleased to report that the Modbus binding has been running for over nine hours, which I have not seen at anytime previously unless I had extra logging on.

I am still reading a single holding register as I have been pretty much throughout this testing process. During this current test I have been polling at 250ms and have the extra logging turned off. I have not seen any errors since starting openhab the last time. The “openhab.log” has not had any entries since shortly after startup and the only entries in the “events.log”
(except for a couple of 0 values mentioned below) have been the expected “ItemStateChangedEvent” entries whenever I operate a discrete input (a light switch) which causes a change in the register value.

I did see a couple of odd entries over an 9 hour or so time period where the log reported a value of 0 from my register and it was between 1 and 5 minutes later before the log reported the register returning to the expected value. If this persists I may have to look into this but I don’t want to muddy things here since it is unrelated to this topic and may simply be a quirk on my end.

I want to thank you for your patience, especially in the early time when I seemed to be the only one reporting this issue (on another thread) and we both were probably convinced that I (a new user) was just making a stupid mistake somewhere or there was possibly something with my specific installation or hardware especially since I was running on Windows. I was almost relieved when a few other users started reporting similar issues.

Again I applaud you for your patience with all of this, I know it had to be tough, especially since you (as far as I know) were unable to reproduce the issue on your openhab install.

I also want to thank all the others that have tried to help with this issue.

Things are looking much better here so I guess this issue can be marked as resolved whenever you thing it to be appropriate to do so.

Now maybe I can see if I can do something in openhab, I guess my first project will be getting things set up for writing bits to modbus registers in order to fire my outputs once I get the jython stuff set up again for rules.

Thanks again for all the help.

1 Like

Yes I can also report back that the polling is running without any problems since the 2.5.9 binding install.
Thank you @ssalonen for your help, really appreciate your work. Your the MVP.