lost protocol communication?

Sorry if this is the wrong section.

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..

You have given us very little information from which to help you.

  • Is the Uno connected to the PC with a USB cable?
  • What sort of WiFi adapter have you got for the Uno?
  • What is the purpose of the WiFi connection compared to the USB connection (assuming there is a USB connection)?
  • Is this a problem with your Arduino program or with your PC program?
  • What program are you running on the Arduino?
  • Where did you get it?
  • Do you understand in detail how it works?
  • ... and anything else that you know and we don't

...R

First suspect would be that the WiFi adapter is using (in some way) pins 0 and 1 of the Uno as well.

Further I suggest that you answer Robin's questions ;)

The uno is connected to the laptop with a 10m boosted usb cable and the wifi is the laptop wifi (uno does not have wifi).

Sounds to me like a Windows / Race Coordinator problem, not an Arduino problem.

I can't find much info on their site regarding Arduino except for viasue.

this is the website forum Race Coordinator (RC) - SlotForum

quakebo: this is the website forum

And the answers to the questions in Reply #1 are ???

...R

Here the code that runs on the uno board should be attached.

and it comes from here. https://racecoordinator.net/

lapCounter.zip (6.02 KB)

quakebo: Here the code that runs on the uno board should be attached.

Can't you just post your .ino file so we don't have to download a strange ZIP file?

And if you can't be bothered answering the other questions I don't think I will give any more time to this.

...R

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.

quakebo:
this is the website forum Race Coordinator (RC) - SlotForum

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.

lapCounter.ino (20.8 KB)

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

...R

Robin2: 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

...R

Sorry I was trying to paste all the code which is what it would not let me do.

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?

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.

  1. Repurpose an old WiFi router and hookup the laptop via ethernet.
  2. Try a different arduino, in case it's a faulty board (especially if it's an import)
  3. Try a different usb cable.
  4. Try a different usb port.

Hope that helps.

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.