Teensy remote display

beermat

Well-known member
If you have a Teensy with Ethernet and a TFT screen that you update with buffers of 16 bit RGB565 pixel data you should be able to use this code, along with the supplied Mac or Windows client, to also display (and control) the screen remotely on your desktop via the network:


The paint is still fresh and it's my first publicly shared code, so any help in testing this, and comments and improvements on the code, readme, etc would be appreciated! Quick video of it in action streaming my LVGL powered Teensy GUI, along with some client-side features that can help with GUI development, here:


Client has been tested on Windows 10 and MacOS Sonoma. I have working Android and iOS builds too, just need a code tweak for scaling and then find a way to distribute outside the relevant app stores.....
 
Is it possible to build the lib without having to include either of the ETH dependencies? Just for USBSerial usage only.
 
Hmm, not as it stands, no.....but just pushed an update to the repo which guards ethernet code with the #define USE_ETHERNET in the header, and defaulted it to commented out, so it should build without ethernet now.
 
I had an idea to do something similar to this but modifying the Teensy's USB descriptor to present as a webcam (as well as an audio device) and sending the screen frames as JPGs. Then you wouldn't need any specific server-side software, just something that can view a camera.

(Webcams can send raw frames too, but USB bandwidth restricts the framerate pretty bad.)
 
Interesting idea but "sending the screen frames as JPGs" would also require "server-side" software on the Teensy, right? Plus, this implements remote touch too, not just screen casting, so you'd need something on the Teensy side to interpret that. *edit* You probably meant client side :)

The frame rate is pretty great this way, as good ol' RLE encoding produces pretty good compression levels for UI-type screens (with long runs of background colors, for instance) without the performance overhead and latency of JPG encoding on the Teensy. You can see in the above video (using slower Ethernet vs SerialUSB) that the compression percentage in the "Per pixel" text on the left sidebar is pretty high, and it fits in nicely with traditional Teensy screen drivers that use a 16 bit color buffer.

I've streamed JPG the other way, from a webcam on a desktop to the Teensy via ffmpeg creating an RTP feed from the webcam, and Teensy code cobbled together from ffmpeg source for RTP receiving....it wasn't too bad, better than I expected.
 
Last edited:
Thanks for sharing. Used this utility to make a very very very cheap oscilloscope.
 

Attachments

  • Scope.jpg
    Scope.jpg
    328.3 KB · Views: 39
Back
Top