Hello all.
Wrote a console app primarily developed in Windows but for both Windows and Linux. What the app does is to poll a number of remote devices (also developed in house and are known good) who return either an acknowledgement of sorts or some data after interaction with a person. The remotes only speak when first spoken to by the app. The protocol they use is fairly simple and short.
For testing I have used all the same hardware except for the PC where one is Win10 and the other is Linux Mint.
On windows, everything works perfectly all the time. However, on Linux all does not work perfectly. However the failures are consistent!
I get a string of data returned that looks like this (in hex):
3C 0 1 1 41 0 0 A 55 0 0 D <<=== good complete data
3C 0 1 1 41 0 0 CD EF 0 0 D <<==== good complete data
3C 0 1 1 41 0 0 29 0 0 D <<----- BAD DATA, MISSING THE 9th byte which should be 9C
3C 0 1 1 41 0 0 7 0 0 D <<----- BAD DATA, MISSING THE 9th byte which should be B5
There are more examples, but the ones that get the 9th byte thrown out are consistent. The good ones are also consistent.
Both computers use the same USB to Serial Adapter. And I tested on a Raspberry Pi and it too had exactly the same problem.
The set up is like this for both Linux and Windows
Me.Close
Me.DataTerminalReady = True
Me.Bits = Serial.Bits8 //8 //3
Me.Parity = Serial.ParityNone // 0 'N
Me.Stop = Serial.StopBits1 //0 '1
Me.Baud=Serial.Baud9600
Me.RequestToSend = False
Me.SerialPort = System.SerialPort(SP)
LastErCode = Me.LastErrorCode
Me.Reset
Looking at the data with a scope, it appears the same on both Linux and Windows too, the remote hardware is sending the complete set of data.
Any ideas what is wrong and how to fix???
Thank you,
Tim