Forum

Arduino Serial.println() , vvvv loosing some char after a wile

hi
i am communicating with my arduino with serial
i am sending a bunch of coordinates and commands and it systematically answer by repeating the last coordinate (or command) it received

so i know i can go and send the next coord. or the next command

the problem is that the communication vvvv to arduino it working good , but then the way back is not so cool
when data goes from arduino to vvvv , vvvv is often losing some char
for example if i print “NEXT” arduino s side sometimes i get “XT” only vvvv s side

i tried many baud rates , but not much luck there

then i tried slowing vvvv s fps with mainloop (set to increment and 25fps foreground and background)
it helps a lot , but there is always a point (between 1 sec to 30mn) when vvvv loose some char and i get stuck

do you have any advice ?
do i have to do some dark multi threading on the rs232 node or something like this :
https://discourse.vvvv.org/t/7955
https://discourse.vvvv.org/t/7634

or is there simple way to have perfect communication running for hours/days/weeks ?

Cheers

are you using Tokenizer(String)?

no , i am not using this node

the lost appends right out the rs232 , i just have a S+H node and a string iobox for visualize the arduino serial

then i process what i receive

i ve thought it could be because of noise on the usb line
so i ve put distance between the usb cable and the cable running on my desk (nape driving step motors)

but as i was writing this post , i got an error after running for 31minutes

try using Tokenizer (String) it does what you need.

no , sorry , it doesn t

the issue i was having here is serial “packet” lost
tokenizer as nothing to do here

i made some more test , changed my usb cable , slowed my fps to 20 , set my baud rate to 56700 , and it seams running better , it ran for 4 hours without fail (i stoped it , it didn t failed)

maybe the cable was the problem , i don t know , does any one had the same issue ?

it was the cable , i made a quick try with 120 fps , it would have not worked past 2mn with the other cable , now , works like a charm

so :

if you have serial packet lost , change your cable to a shielded one