How to run Teensy Loader remotely (over SSH) on Linux?

dlab

Active member
I am uploading code to a Teensy remotely via SSH from a Raspberry Pi using arduino-cli (since terminal is the only interface available).

Commands used:
Compilation (works fine):
Code:
arduino-cli compile -v --fqbn teensy:avr:teensy41 /home/pi/AutoTrainerModular/AutoTrainerModular.ino --output-dir /home/pi/BuildATM/ --libraries /home/pi/.arduino15/packages/teensy/hardware/avr/1.57.2/libraries

Upload (works on Raspberry Pi locally, but not over SSH*):
Code:
arduino-cli upload -v --fqbn teensy:avr:teensy41 --port /dev/ttyACM0 /home/pi/AutoTrainerModular/AutoTrainerModular.ino

However the command throws an error that says that Teensy Loader is not running (when upload command is run over SSH), if I run the same commands used to compile and upload to the Teensy on the RPi itself, it works fine.
Once the Teensy Loader application is running on the Raspberry Pi, and now if I try running the upload command over SSH it works just fine.
This lead me to believe that what is necessary for the upload command to work over SSH is for Teensy Loader to be running on the RPi when upload is required to work remotely, but I was unable to find the binary that needs to be executed to get the GUI to appear on the RPi.

My question is where (or how) do I find the file that needs to be run for Teensy Loader's GUI to appear when it is executed from the terminal?
 
I think you need to ssh with the graphics option. So when you ssh into your RPi, you need to do
Code:
$ ssh -X pi@yourpi.local
The flag X allows graphics. Without X, Teensy Loader over ssh will fail to launch.
 
As has been mentioned in other threads. The arduino-cli teensy support was setup to allow the compiles to go on headless. So far the upload code has not been updated to allow headless operations.

However, there are other ways, I mentioned some of this in the thread/post: https://forum.pjrc.com/threads/5354...nsy-Supported!?p=185984&viewfull=1#post185984
likewise, the thread: https://forum.pjrc.com/threads/6926...less-(CI-Woes)?p=297925&viewfull=1#post297925

You can instead use teensy_loader_cli - More information up at: https://www.pjrc.com/teensy/loader_cli.html
Or I have had good luck with tytools: https://koromix.dev/tytools
 
Thanks a lot for posting those links!

I have used teensy_loader_cli before to upload the .hex file generated during arduino-cli's compilation process, but doesn't teensy_loader_cli require one to press the PROGRAM MODE button on the Teensy? This is not desirable as I want to upload miles away from where the Teensy is XD
 
Last edited:
Back
Top