Hi,
I have a head scratcher of a problem I would really appreciate any help or thoughts on. We are Building a teensy 3.1 - controlled video camera tracking system.
Basically Teensy is controlling 2 HiTech servos (pan and tilt) on which camera sits. Position commands are sent from a PC to the T3.1 using Paul's rawhid library. Camera is also connected to the same PC and is pumping video frames back to the PC in realtime.
Unfortunately, the PC (Surface Pro) has only one USB 3 port, so both the teensy and the hidef camera traffic are going through the same port (via an un-powered USB hub).
PC CPU is at around 50-70% utilization, which includes a fair amount of processing that I do on vide frames once they arrive.
Everything works fine ... until RawHid messages stop arriving at Teensy after a period between 1 minute and 1 hour. Once it happens - that's it, no matter what I do on my PC side - rawhid is dead until I reboot the microcontroller. Interestingly the "loop()" is still running, I can verify that using serial monitor, controller is not frozen, its just that RawHID.recv(...) returns 0 when called from the loop. Boot loader is also running, i.e. I can re-flash the sketch and it all starts working again.
Any thoughts? Can USB traffic be a problem? Should I be looking for some electrical issues (I installed ferrite chokes all around, no efect)? Is it possible to I am crashing the rawhid library somehow by sending commands simultaneously (the frequency can be high sometimes).
More specifically, are there any guidelines on things are not advised to do on the PC side of raw USB library that may cause a crash on the microcontroller side? I have an weak hunch that the problem shows up earlier if the CPU on the PC is pegged.
The wiring diagram is quite trivial. Teesny is powered from USB (from the USB hub), the GND of teensy is connected to the GND of my power supply, and servos are sitting on pins 9 and 10, feeding from the power supply.
Thanks for any hints,
Greg
I have a head scratcher of a problem I would really appreciate any help or thoughts on. We are Building a teensy 3.1 - controlled video camera tracking system.
Basically Teensy is controlling 2 HiTech servos (pan and tilt) on which camera sits. Position commands are sent from a PC to the T3.1 using Paul's rawhid library. Camera is also connected to the same PC and is pumping video frames back to the PC in realtime.
Unfortunately, the PC (Surface Pro) has only one USB 3 port, so both the teensy and the hidef camera traffic are going through the same port (via an un-powered USB hub).
PC CPU is at around 50-70% utilization, which includes a fair amount of processing that I do on vide frames once they arrive.
Everything works fine ... until RawHid messages stop arriving at Teensy after a period between 1 minute and 1 hour. Once it happens - that's it, no matter what I do on my PC side - rawhid is dead until I reboot the microcontroller. Interestingly the "loop()" is still running, I can verify that using serial monitor, controller is not frozen, its just that RawHID.recv(...) returns 0 when called from the loop. Boot loader is also running, i.e. I can re-flash the sketch and it all starts working again.
Any thoughts? Can USB traffic be a problem? Should I be looking for some electrical issues (I installed ferrite chokes all around, no efect)? Is it possible to I am crashing the rawhid library somehow by sending commands simultaneously (the frequency can be high sometimes).
More specifically, are there any guidelines on things are not advised to do on the PC side of raw USB library that may cause a crash on the microcontroller side? I have an weak hunch that the problem shows up earlier if the CPU on the PC is pegged.
The wiring diagram is quite trivial. Teesny is powered from USB (from the USB hub), the GND of teensy is connected to the GND of my power supply, and servos are sitting on pins 9 and 10, feeding from the power supply.
Thanks for any hints,
Greg