So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By McChubby007
#80118 Oh yes I forgot... I don't know anything about Modbus, just looked on wikipedia !!

So, are you using a modbus protocol over wifi/tcp or serial or what ?

It does seem that enabling the modbus at least aggravates your problem so I personally would look deeply into that area. Is it the protocol formatter on the esp8266 causing problems, or what/how it communicates over a given GPIO or wi-fi etc? Is it serial/uart attached? Is the uart/wifi/? Getting swamped, running out of buffers/memory etc?

Perhaps you can describe it here, with as much detail as possible, as although I don't know modbus, many different I/O problems stem from the same thing and one of us may spot a problem.
User avatar
By McChubby007
#80119 Reading more on modbus...

A lot of my experience is working on weird/wacky device protocols (in air traffic we have odd stuff not used anywere else in the world) and so I would definitely put a protocol analyser on the line (serial) or use wireshark (network etc). I reckon it is a rogue/corrupt packet that is causing the problem. Perhaps too small/large than was expected or corrupt data causing your protocol handler to misbehave.

You could also program the protocol analyser/wireshark to detect errors or the esp8266 stopping comms and then save its analyser trace info or raise an alarm etc. That is definitely what I'd do, it's easier than debugging the code as a first step.
User avatar
By lucasromeiro
#80147
McChubby007 wrote:Reading more on modbus...

A lot of my experience is working on weird/wacky device protocols (in air traffic we have odd stuff not used anywere else in the world) and so I would definitely put a protocol analyser on the line (serial) or use wireshark (network etc). I reckon it is a rogue/corrupt packet that is causing the problem. Perhaps too small/large than was expected or corrupt data causing your protocol handler to misbehave.

You could also program the protocol analyser/wireshark to detect errors or the esp8266 stopping comms and then save its analyser trace info or raise an alarm etc. That is definitely what I'd do, it's easier than debugging the code as a first step.


Cool!!
Excelent idea!
I will do this.
I already read about wireshark. but as a modbus RTU network, I do not know how I can use it.
Maybe a protocol analyzer is better.
I'm going to do it Monday. There's an analyzer in the company, but I've never used it. It's an opportunity!
User avatar
By McChubby007
#80149 Great, I'm glad it's something you haven't tried yet as I like to surprise you with new ideas every day. Life would be boring otherwise. To show you how old I am, the first analyser I used was the size of a small suitcase with a pin/plug board for selecting options - it was state of the art in 1982! One of our newest expensive mini-computers had 'cache' ram... I'd never heard of cache before. Exciting times haha.

I always found the biggest issue was cabling... It didn't matter what comms it was, it was cabling, noise, clocks out of sync or drifting!