[SOLVED] Modbus binding 2.5.10 issues

can you give me 30s of logs?

Indeed it looks like the same error still, gateway/slave responds with wrong transaction ID.

Hopefully this will do, (had to filter it manually).

To big to fit, so I have saved it to a txt file:
modbus 2 minutes logging.txt (151.1 KB)

Thanks Kim,

The responses returned by the slave are all over the place, it’s really odd. Sometime slave responds with the previous requests ID.

Do you know how to do tcpdump of the traffic?

Sounds like termshark is coming into play. :wink:

1 Like

Nope I have no idea. But I guess I can learn :slightly_smiling_face:

Got as far as using tshark to dump the tcp trafic to a pcap file. I guess thats an start :slight_smile:

I do have wiredshark installed on my windows, but it has been way too long since I used it, so I have a slight problem trying to filter the informations needed. And I have a slight feeling, even though I managed to get the filters, it´ll be all mumble jumble to me :woozy_face:

@ssalonen would it be enough if you get the dump file?

Dump is the best

I also suggest you try to simplify, having only one poller.

It is good to test what @rossko57 suggested, trying out other tool

I already did…
I cutted down my things files to only the first two pollers, and this lowered the issue significant. But its still there.

I´ve compress the dump file. Here you go.
tshark1.rar.txt (942.7 KB)
Its a rar compressed file. Remove the .txt from the filename and you should have aprox 2 minutes of tcp dump.

The “other tool” suggested by rossko is fine. However I have no idea what other tool.

There is a point to trying with just one, if you’ve been following along about it being a sequencing issue. One can’t get out of sequence at our end.

What does that mean? Do you ever get good data, or do you mean there are (understandably) less error reports

Please don’t, we don’t all have the same software.

Absolutely any modbus diagnostic utility that you like. A means to manually type in a modbus query and see an answer. There are various ones, modbus-poll is a favourite, I use Simply modbus.

Good data, less warning (no errors, only a few timeout warnings).

I cant add 2.6MB file to the post.
If someone cant extract rar, I can add it to a public dropbox directory. Just let me know.

I´ll try locate one of them and give it a shot.

Just installed modbus-poll…
I see some different issue regulary polling register adress 200 (40201)

13:44:13.700 <00200>   4500   4000      0
13:44:15.681 <00200> Timeout error
13:44:15.902 <00200>   4500   4000      0
13:44:17.867 <00200> Timeout error
13:44:18.088 <00200>   4500   4000      0
13:44:19.075 <00200>   4500   4000      0
13:44:20.075 <00200>   4500   4000      0
13:44:21.076 <00200>   4500   4000      0
13:44:22.076 <00200>   4500   4000      0
13:44:23.076 <00200>   4500   4000      0
13:44:24.076 <00200>   4500   4000      0
13:44:25.076 <00200>   4500   4000      0
13:44:26.078 <00200>   4500   4000      0
13:44:27.075 <00200>   4500   4000      0
13:44:28.075 <00200>   4500   4000      0
13:44:29.321 <00200>   4500   4000      0
13:44:30.076 <00200>   4500   4000      0
13:44:31.075 <00200>   4500   4000      0
13:44:32.076 <00200>   4500   4000      0
13:44:33.076 <00200>   4500   4000      0
13:44:34.075 <00200>   4500   4000      0
13:44:35.076 <00200>   4500   4000      0
13:44:37.055 <00200> Timeout error
13:44:37.275 <00200>   4500   4000      0
13:44:38.262 <00200>   4500   4000      0
13:44:39.262 <00200>   4500   4000      0
13:44:40.264 <00200>   4500   4000      0
13:44:41.264 <00200>   4500   4000      0
13:44:42.264 <00200>   4500   4000      0
13:44:43.263 <00200>   4500   4000      0
13:44:44.264 <00200>   4500   4000      0
13:44:45.262 <00200>   4500   4000      0
13:44:46.262 <00200>   4500   4000      0
13:44:47.264 <00200>   4500   4000      0
13:44:48.263 <00200>   4500   4000      0
13:44:49.263 <00200>   4500   4000      0
13:44:50.263 <00200>   4500   4000      0
13:44:51.263 <00200>   4500   4000      0
13:44:52.243 <00200> Byte count error
13:44:53.263 <00200>   4500   4000      0
13:44:54.262 <00200>   4500   4000      0
13:44:55.262 <00200>   4500   4000      0
13:44:56.263 <00200>   4500   4000      0
13:44:57.263 <00200>   4500   4000      0
13:44:58.263 <00200>   4500   4000      0
13:44:59.262 <00200>   4500   4000      0
13:45:00.262 <00200>   4500   4000      0
13:45:01.263 <00200>   4500   4000      0
13:45:02.264 <00200>   4500   4000      0
13:45:03.262 <00200>   4500   4000      0
13:45:04.263 <00200>   4500   4000      0
13:45:06.765 <00200> Transaction ID error
13:45:06.986 <00200>   4500   4000      0
13:45:07.981 <00200>   4500   4000      0
13:45:08.981 <00200>   4500   4000      0
13:45:09.982 <00200>   4500   4000      0
13:45:11.962 <00200> Timeout error
13:45:12.182 <00200>   4500   4000      0
13:45:13.169 <00200>   4500   4000      0
13:45:14.169 <00200>   4500   4000      0
13:45:15.170 <00200>   4500   4000      0
13:45:17.148 <00200> Timeout error
13:45:17.369 <00200>   4500   4000      0
13:45:18.357 <00200>   4500   4000      0
13:45:20.336 <00200> Timeout error
13:45:20.556 <00200>   4500   4000      0
13:45:21.544 <00200>   4500   4000      0
13:45:22.545 <00200>   4500   4000      0
13:45:23.544 <00200>   4500   4000      0
13:45:24.544 <00200>   4500   4000      0
13:45:25.545 <00200>   4500   4000      0
13:45:26.545 <00200>   4500   4000      0
13:45:27.544 <00200>   4500   4000      0
13:45:28.545 <00200>   4500   4000      0
13:45:29.544 <00200>   4500   4000      0
13:45:30.543 <00200>   4500   4000      0
13:45:31.543 <00200>   4500   4000      0
13:45:32.546 <00200>   4500   4000      0
13:45:34.524 <00200> Timeout error
13:45:34.745 <00200>   4500   4000      0
13:45:35.737 <00200>   4500   4000      0
13:45:36.731 <00200>   4500   4000      0
13:45:37.732 <00200>   4500   4000      0
13:45:38.731 <00200>   4500   4000      0
13:45:39.732 <00200>   4500   4000      0
13:45:40.732 <00200>   4500   4000      0
13:45:41.732 <00200>   4500   4000      0
13:45:42.732 <00200>   4500   4000      0
13:45:43.731 <00200>   4500   4000      0
13:45:44.731 <00200>   4500   4000      0
13:45:45.732 <00200>   4500   4000      0
13:45:46.732 <00200>   4500   4000      0
13:45:47.730 <00200>   4500   4000      0
13:45:48.732 <00200>   4500   4000      0
13:45:49.730 <00200>   4500   4000      0
13:45:50.730 <00200>   4500   4000      0
13:45:51.731 <00200>   4500   4000      0
13:45:52.712 <00200> Byte count error
13:45:53.731 <00200>   4500   4000      0
13:45:54.731 <00200>   4500   4000      0
13:45:55.733 <00200>   4500   4000      0
13:45:56.731 <00200>   4500   4000      0
13:45:57.732 <00200>   4500   4000      0
13:45:58.732 <00200>   4500   4000      0
13:45:59.731 <00200>   4500   4000      0
13:46:00.732 <00200>   4500   4000      0
13:46:01.731 <00200>   4500   4000      0
13:46:02.732 <00200>   4500   4000      0
13:46:03.732 <00200>   4500   4000      0
13:46:04.731 <00200>   4500   4000      0
13:46:06.711 <00200> Timeout error
13:46:06.932 <00200>   4500   4000      0
13:46:07.918 <00200>   4500   4000      0
13:46:08.919 <00200>   4500   4000      0
13:46:09.919 <00200>   4500   4000      0
13:46:10.919 <00200>   4500   4000      0
13:46:11.902 <00200> Insufficient bytes received
13:46:12.918 <00200>   4500   4000      0
13:46:13.918 <00200>   4500   4000      0
13:46:14.920 <00200>   4500   4000      0
13:46:15.919 <00200>   4500   4000      0
13:46:16.919 <00200>   4500   4000      0
13:46:17.919 <00200>   4500   4000      0
13:46:18.920 <00200>   4500   4000      0
13:46:19.919 <00200>   4500   4000      0
13:46:20.919 <00200>   4500   4000      0
13:46:21.919 <00200>   4500   4000      0
13:46:23.899 <00200> Timeout error
13:46:24.121 <00200>   4500   4000      0
13:46:25.113 <00200>   4500   4000      0
13:46:26.106 <00200>   4500   4000      0
13:46:28.087 <00200> Timeout error
13:46:28.307 <00200>   4500   4000      0
13:46:29.276 <00200> Insufficient bytes received
13:46:30.295 <00200>   4500   4000      0
13:46:31.295 <00200>   4500   4000      0
13:46:32.294 <00200>   4500   4000      0
13:46:33.294 <00200>   4500   4000      0
13:46:34.295 <00200>   4500   4000      0
13:46:35.294 <00200>   4500   4000      0
13:46:36.294 <00200>   4500   4000      0
13:46:37.294 <00200>   4500   4000      0
13:46:38.294 <00200>   4500   4000      0
13:46:39.294 <00200>   4500   4000      0
13:46:40.293 <00200>   4500   4000      0
13:46:42.275 <00200> Timeout error
13:46:42.495 <00200>   4500   4000      0
13:46:43.481 <00200>   4500   4000      0

I guess its safe to say, this is not an openhab issue. Openhab just got more “sensitive” and mess up when there are errors. (that could be an openhab issue though :slight_smile: ).

I need to locate, howcome I have all these errors… I´m back to cabling I guess… (I have exchanged the ethernet cable, made no difference).

Alright, that moves us forward.

A serial problem can conceivably give you timeout or rejection errors, depending how the gateway decides to handle them.

Transaction ID errors are strictly about the TCP conversation between gateway and modbus master, nothing to do with serial. Don’t go further disturbing stuff that will not help.

This going to be something silly like a duplicate IP address.

1 Like

Hmprf!!!
My USR gateway is (was) setup for static IP. I see no other devices using the same IP in my Unifi controller. And I would have sworn my Unifi controller would have complainted, if I setup duplicate IP. It hasnt complaint.

But since you´d mention it, I thought I would give it a try and set a new IP for the USR gateway, (one I know for sure has never been used).

Guess what… All issues are gone when I run the same test from modbus-poll.
2 x time-out in 10 minutes run. Absolutely no other issues. :scream:

Then I changed my .things file to the new IP for the USR… And now everything works without a problem, Nilan and my two SMA inverters running perfectly! :smiley:

I would never have found this, if you havn´t mentioned it. I would have ripped everything appart, only to discover the exact same issue…

Thank you very much, Rossko57!!! I´ve learned alot today.

Okay, weird. Speculation, the upgrade / reboot process had your host picking up a new IP.

You can usually set up your router DHCP to avoid a range of address, use as your fixed IP pool.

Now you can review your TCP Thing settings for efficiency.

1 Like

I have a feeling there is something weird going on in my Unifi controller/setup. I´m investigating.

Normally I setup devices to use DHCP, and then in the Unifi controller, I mark the applied DHCP IP to be static.This way Unifi controller will never apply the same IP for another device.

Yeah, but I wonder how I would do that…
I´m still not comfort with register adresses and specially the lenght. I see no logic in the length for my whole setup. Sometimes length has to be two for an register adresse, and other times its one or three. A real mess if you ask me :slight_smile:

In this case, I just took an Holding adresse, which I knew exactly what was and knew it would supply the value all the time. And then played around in modbus-poll, untill i got the results I knew it was suppose to give.