I have a uno board which I use connected to a windows 7 laptop using some software called Race Coordinator which is for slot car lap timing.
Now it all works great with wifi turned off but with wifi turned on the it will display the message lost protocol communication on the laptop. I think that is the uno board losing communication with windows 7 laptop.
So how can I leave wifi turned on and not have the uno board lose communication with windows 7.
I use the wifi to live stream the slot car racing timing to smartphones and tablets which is not needed but nice feature to use.
I have been asking on a Race Coordinator forum but no one seems to know how to fix it so thought if it is a non race coordinator problem someone here might know how to fix it..
Based on the thread that I found (lost protocol communication), you might still have some interference issues; this is far outside my area of expertise.
Some tests that you can do
1)
Take your USB booster out, use only a short USB cable and see if the problem is solved.
2)
If you switch wifi on while race coordinator is running, change the sequence. First switch the wifi on, next start race coordinator. Problem solved?
Questions
Does the system automatically recover after the wifi is switched on? Does it automatically recover if you switch the wifi off again? Does it recover after disconnecting / connecting the Uno while wifi is still on? Or not at all.
Regarding the code.
1)
Is there a description of the protocol? Would make life easier.
2)
The protocol seems a little wonkey.
2a)
Messages don't contain a checksum or crc; so there is no way to check if a message is corrupted or not.
2b)
If an inChar is invalid (due to corruption), it will not be added to the buffer. As a result, your message might be one or more characters shorter and when processing a message you might access incorrect info.
3)
If the message is corrupt (specifically the byte that indicates the number of pins to read), the dynamic memory allocation can fail if one tries to allocate too much memory. The pointers to the dynamically allocated memory should be checked for NULL after memory allocation.
There is a resetRequest command; do you know if that is issued by race coordinator in case of a "lost protocol" error? If it is and the Arduino does not react on it, the Arduino is definitely in a state where it should not be.
I might see things wrong but these are some notes/questions.
sterretje:
Are you mark h in the below linked thread?
Based on the thread that I found (lost protocol communication), you might still have some interference issues; this is far outside my area of expertise.
Some tests that you can do
1)
Take your USB booster out, use only a short USB cable and see if the problem is solved.
2)
If you switch wifi on while race coordinator is running, change the sequence. First switch the wifi on, next start race coordinator. Problem solved?
Questions
Does the system automatically recover after the wifi is switched on? Does it automatically recover if you switch the wifi off again? Does it recover after disconnecting / connecting the Uno while wifi is still on? Or not at all.
Regarding the code.
1)
Is there a description of the protocol? Would make life easier.
2)
The protocol seems a little wonkey.
2a)
Messages don't contain a checksum or crc; so there is no way to check if a message is corrupted or not.
2b)
If an inChar is invalid (due to corruption), it will not be added to the buffer. As a result, your message might be one or more characters shorter and when processing a message you might access incorrect info.
3)
If the message is corrupt (specifically the byte that indicates the number of pins to read), the dynamic memory allocation can fail if one tries to allocate too much memory. The pointers to the dynamically allocated memory should be checked for NULL after memory allocation.
There is a resetRequest command; do you know if that is issued by race coordinator in case of a "lost protocol" error? If it is and the Arduino does not react on it, the Arduino is definitely in a state where it should not be.
I might see things wrong but these are some notes/questions.
I've attached the unzipped code.
I am mark H in the link.
Also I fitted a ferrite to each end of the usb cable.
I can not use a short usb cable as it will not reach the laptop.
It makes no difference when wifi is turned on with race coordinator.
The system sometimes automatically recovers but then it could happen again. For best results i will reboot the laptop and then it is all good and working again.
Regarding the code I no nothing about it other that how to upload it to the uno.
quakebo:
I think you will find I have answered most of the questions all ready. And I can not post the .ino file as it is to big and it will not let me.
It's not my day for thinking or finding.
And, as you can see, it is possible to attach long .ino files - see How to use the Forum
sterretje:
The removal of the usb booster is a temporary measure to eliminate a possible source of the problem; ferrite might not have solved it completely.
Can you ask race coordinator for a full description of the protocol?
I will ask about full description of the protocol and report back.
Inmo Not sure crc in code etc will help if it's noise from WiFi causing corrupt packets then you'll get missed laps, bad timing etc non of which is recoverable.
Few options to work round issue.
Repurpose an old WiFi router and hookup the laptop via ethernet.
Try a different arduino, in case it's a faulty board (especially if it's an import)
I have been told that lost protocol communication is windows losing communication with the uno board and that anti virus software can cause problems with com ports.