Hi
So I'm getting this weird issue in a raspberrypi with virtualhere server where when connectin a teensy 4.1 (arduino similar device) I can receive data on a virtualhere client (windows 10) but not send any serial data to the remote device (The teensy 4.1) Programming the teenys remotely work great, though this is done in programming mode (i guess in a different USB driver/mode?)
I've tried mani options. Currently 2 different raspberrypies (version 1 and version 3 B+) various OSes, dietpi, raspbian... and all have the same weird issue.
Also tried the virtual here hub on a raspberry py, same issue there.
(update) Tried on a android phone and also same issue
Tried with an arduino UNO, and this works correctly.
Tried the teensy locally on the raspberrypi and there I can correctly receive and send data to the teensy, no problem.
Also and curiously, the teensy 4.1 works correctly on a virtualhere server running on windows 10, so this issue seems to happen only on linux servers.
I'm out of ideas, and I would love to see this working as I need it for several installations. Any help will be apreciated
.
Are you connecting via the Teensy onboard USB for serial or via one of the serial ports https://www.pjrc.com/teensy/td_uart.html via USB<->Serial adapter?
Hi Michael,I'm connecting…
Hi Michael,
I'm connecting over the main onboard USB serial as the intention was to use it for programing, and this can only be done with the main onboard port.
Some more findings on the issue:
I found that when using an old laptop with windows 10 as server I can connect the teensy on the 3.0 USB ports and it works all correctly, but when connecting to a 2.0 USB port I get the same issue I was getting with the raspberrypi / android / etc..
That would indicate an issue with the HUB? rather than the operating system? can this be possible?
Any Idea where to start investigating this issue?
Also observed that when programing the teensy remotely sometimes the program gets corrupted and I get wird behaviour, like if there was a bug in my code, but when programing locally this problems disappears. Could it be that data is lost during transmission?
.
Virtualhere will never drop packets or corrupt data. What is likely happening is that your latency is too high and that is causing the ring buffer in your serial port to overflow. (I.e the data cannot be taken off serial fast enough onto the USB bus).
In the virtualhere client, right click USB Servers->About->Statistics. What does that generally show when you are connected to the teensy?
.
I found I have a Teensy 4.0 in my testing cupboard. So i hooked that up and programmed in the SerialEvent example and i can reproduce the problem.
I tried a Linux server / windows 11 client, and a windows 11 server/windows 11 client, and both failed to receive serial but transmitted serial OK.
I then ran the virtualhere server and client on the same machine and used the teensy - and it worked reliably. This tells me it is a latency issue.
So then i looked at how the serial is actually implemented, pjrc implemented a DIY serial driver and that has a few timers in it. I didn't debug it but i suspect somewhere there is a latency sensitive part which fails to trigger the rx section. Possibly you could write a post on his forum to see if he can quickly find the issue as he knows the firmware best.
Hi MichaelI will create a…
Hi Michael
I will create a post on their forum explaining what you just told me, thanks for your time!
https://forum.pjrc.com/index.php?threads/teensy-4-1-doesn%E2%80%99t-rec…