Airlab and HA modbus over Wifi troubleshooting

Although it works, there seems to be many misreads of the registers in the Airlab.
I configured extremely defensive values for message_wait_milliseconds (500) and delay between register reads (1s) and still see these weird values?

The worst aspect of these misreads is that is seems the Airlab returns valid responses, but the values are wrong and allways the same (6.5 °C for temp e.g.) so it’s hard(er) to create automations on (low) values. I could filter 6.5°C, but then I would mis real 6.5°C measurements.

Is my Airlab broken? Can this behaviour be fixed in other ways?

This looks like some bad data on the serial bus. I would set up a data capture on the rs485 network and see what’s actually going on there. We use a serial port monitor like docklight for debugging problems like this.

Maurice

1 Like

But I use modbus over TCP and don’t have rs485 debugging tools?

For IP we use wireshark. I will have the team study your posts so far. if there’s any other clues or observations you can share please do.

Maurice

That doesn’t make sense, a capture on wireshark would reveil 6.5°C because that’s what HA is registering? For all the missing values HA reports unavailable which I have no doubt would be the result of missing replies? I suggest you create a HA test instance and monitor Airlab registers (one-by-one) over modbus for a while and see if you can reproduce?

Please give me some time, I will do some tests and send some feedback shortly. If you could make sure you have the latest firmware running on the Airlab that will be a good first step.

The Airlab is currently at 13.8 (due to the register cleaning option I needed).

Hopefully that is the latest version. If not please update.

Maurice

Please update rev13.9, we did duplicate this issue in the older version when we used wifi.
T3000->Help->Check for Updates->download firmware and update

Updated to 1.3.9, hope this helps.

To be honest I’m quite disappointed by your QA process, but quite happy about your responsiveness to issues like this.

1 Like

It’s much, much worse now. I can only do one succesful read per connection, the following requests now fail:

$ mbpoll 192.168.1.61 -0 -r 121
mbpoll 1.0-0 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright © 2015-2019 Pascal JEAN, https://github.com/epsilonrt/mbpoll
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type 'mbpoll -w' for details.

Protocol configuration: Modbus TCP
Slave configuration...: address = [1]
                        start reference = 121, count = 1
Communication.........: 192.168.1.61, port 502, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table

-- Polling slave 1... Ctrl-C to stop)
[121]:  228
-- Polling slave 1... Ctrl-C to stop)
Read output (holding) register failed: Invalid data
-- Polling slave 1... Ctrl-C to stop)
Read output (holding) register failed: Invalid data
^C--- 192.168.1.61 poll statistics ---
3 frames transmitted, 1 received, 2 errors, 66.7% frame loss

everything was closed.
Have a nice day !

Cold reset doesn’t help, HA is also VERY unhappy now…

Any progress on this?

Chelsea will continue with you on this first thing next week. In the mean time please give the polling a try with MBPolll. Wifi is pretty slow so you will need to tweak the polling to match the speed of the module. Allow plenty of time between requests. Use the block read & write operations whenever possible.

We do have a faster wifi soluition in the works.

I already posted an mbpoll example above, which had poll rate 1s. I increased it to 5s and still, the first request succeeds while any consecutive read reproducably fails, as you can see:

$ mbpoll 192.168.1.61 -0 -r 121 -l 5000
mbpoll 1.0-0 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright © 2015-2019 Pascal JEAN, https://github.com/epsilonrt/mbpoll
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type 'mbpoll -w' for details.

Protocol configuration: Modbus TCP
Slave configuration...: address = [1]
                        start reference = 121, count = 1
Communication.........: 192.168.1.61, port 502, t/o 1.00 s, poll rate 5000 ms
Data type.............: 16-bit register, output (holding) register table

-- Polling slave 1... Ctrl-C to stop)
[121]:  238
-- Polling slave 1... Ctrl-C to stop)
Read output (holding) register failed: Invalid data
-- Polling slave 1... Ctrl-C to stop)
Read output (holding) register failed: Invalid data
^C--- 192.168.1.61 poll statistics ---
3 frames transmitted, 1 received, 2 errors, 66.7% frame loss

everything was closed.
Have a nice day !

This is not about faster Wifi, this is a connection state bug.

Chelsea will study your logs and report back shortly.

I used mbpoll rev1.5 and was able to reproduce your phenomenon. I found that the root cause of this problem is the Wifi module itself, it is occasionally, around 5% of the time, inserting an extra ‘A’ character, decimal 65 at the end of the packet. This is a bug inside the wifi firmware itself which we have no control over. Modbus Poll and other tools we tried here manage to deal with the extra char but other tools like HA and your modbus tool cannot.

This only affects Rev13.9 where we tried a workaround, inserting an extra char on all our packets but evidently its not helping. You should revert to 13.8 for now.

We’re researching this extra ‘A’ char issue with the wifi module manufacturer and will update here when we have a fix.



Thanks!

I only use mbpoll to demonstrate the problem, but please be aware that Home Assistant doesn’t get one single reading (after the first) as well! So maybe you have some software that behaves well, but all I have at the moment is one reading on 13.9. Thx for looking at this. Will revert back to 13.8 for now.

To show that the misreadings on 13.8 do not happen all the time, just sporadically. Nevertheless frustrating and not very professional.
image
image
image

Please update to rev14.0, this problem has been fixed. You can update it by T3000.exe → help → check for updates → download firmware & update.

1 Like

Upgraded to 14.0. This look very promissing! :slightly_smiling_face:

$ mbpoll 192.168.1.61 -0 -r 121
mbpoll 1.0-0 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright © 2015-2019 Pascal JEAN, https://github.com/epsilonrt/mbpoll
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type 'mbpoll -w' for details.

Protocol configuration: Modbus TCP
Slave configuration...: address = [1]
                        start reference = 121, count = 1
Communication.........: 192.168.1.61, port 502, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table

-- Polling slave 1... Ctrl-C to stop)
[121]:  247
-- Polling slave 1... Ctrl-C to stop)
[121]:  247
-- Polling slave 1... Ctrl-C to stop)
[121]:  247
-- Polling slave 1... Ctrl-C to stop)
[121]:  247
-- Polling slave 1... Ctrl-C to stop)
[121]:  247
-- Polling slave 1... Ctrl-C to stop)
[121]:  247
-- Polling slave 1... Ctrl-C to stop)
[121]:  247
^C--- 192.168.1.61 poll statistics ---
7 frames transmitted, 7 received, 0 errors, 0.0% frame loss

everything was closed.
Have a nice day !