Feasibility to use a Teensy 4.1 for a Custom USB Device

LRTNZ

New member
Hey all.

I am currently stuck in lockdown, and looking at building this project: https://github.com/amyworrall/eos-playground

Video with extra information: https://www.youtube.com/watch?v=2jeyQjmPyMM

Inside this folder: https://github.com/amyworrall/eos-p...encoders-follow-eos/Teensyduino modifications, look for sections with the term "eos" to find what
was changed - also further information can be found in the video.


This project is based on using a Teensy 3.6, however I only have some Teensy 4.1s immediately to hand.
From what I have found, looking through the Teensy source code, the USB code for the Teensy 4.x series
appears to not be as complete as the code for the T3.6s.

I am wondering how easy it would be to port this code to use a T4.1 instead of a T3.6, to decide whether or not to
potentially just purchase a T3.6 to get it going.

Many thanks in advance for any help anyone may be able to provide.
 
It would be nice if you at least could write what eos is, and what this project is about. The github link does not even have a description and I think most of us (including me) don't like having to watch a video first (probably with advertisements) to find out, only to answer your question.
Just no.
 
I quickly skimmed the video. EOS ETC looks like a big custom keyboard & rotary knob user interface for some sort of theater lighting stuff.

eos.jpg

(must admit, at first glance seeing "EOS" I though of Canon cameras, but unless I missed something it seems to have nothing to do with those DSLR or mirrorless cameras)

Regarding the main question

I am wondering how easy it would be to port this code to use a T4.1 instead of a T3.6, to decide whether or not to potentially just purchase a T3.6 to get it going.

The USB hardware on Teensy 4.1 is quite different. If you just want to get the project going, buy a Teensy 3.6.

If you really want to dive into low-level USB programming and learn a lot along the way, this would be a pretty good way to do so, since Amy already did all the hard work of reverse engineering that device and functionally identical HID code exists on Teensy 4.1 and 3.6 so you can compare, and people here can help if you get stuck. But it will be a long journey of learning if you're not already familiar with how to do this sort of thing.

If your goal is the destination rather than the journey, just buy a Teensy 3.6.
 
It would be nice if you at least could write what eos is, and what this project is about. The github link does not even have a description and I think most of us (including me) don't like having to watch a video first (probably with advertisements) to find out, only to answer your question.
Just no.

Sorry that I did not explain this clearly enough for you - I shall keep that in mind when posting in future.

EOS is a lighting control system used worldwide in different theatres. To program it, one often uses a custom input surface of some kind, either being a dedicated console, or a programming wing that connects to your computer via USB.
I am specifically trying to replicate the functionality of the 4 encoders present on the programming wing, by emulating an official programming wing. This is because I am trying to further my skills with the EOS system while in lockdown - which is also preventing me from accessing official hardware to use instead.
I am currently dealing to the rest of the buttons and user interface using a custom layout in an ipad app that can spit out OSC (Open sound control, a network based communication protocol used in the entertainment industry, that transmits character strings between different devices to allow for different applications/systems to talk to each other) - however I cannot get these 4 encoders to work using OSC. I found this project (Which to be fair, is lacking in documentation in the git repo), that to the EOS software "Looks like a duck, and quacks like a duck" enough to emulate a programming wing. However instead of having all of the buttons and encoders, it just uses the 4 encoders.

My main issue is trying to get USB code for a Teensy 3.6 working on a Teensy 4.1, as it appears the USB backend/hardware between the two platforms is quite different - as Paul has now confirmed.

Regarding the video - sorry that I did not provide a transcript/timestamped links to the relevant parts. I can also confirm that it is not filled with advertisements.


But thank you for the warm welcome to this community. I hope this reply contains sufficient information for you.
 
I quickly skimmed the video. EOS ETC looks like a big custom keyboard & rotary knob user interface for some sort of theater lighting stuff.

View attachment 25651

(must admit, at first glance seeing "EOS" I though of Canon cameras, but unless I missed something it seems to have nothing to do with those DSLR or mirrorless cameras)

Yes EOS is the software that most theatres around the world use for their lighting control. Quite a nifty system, when you really dig into what it can do.

Specifically this program emulates some of the functionality of a programming wing (A USB interfaced surface, that does not stand-alone, requiring a computer to program on - unlike a dedicated console), exclusively the 4 encoders.
All the other functionality of these wings can be emulated by sending OSC commands to an EOS instance on a network, except for how these 4 encoders behave.

Sorry that I did not make it clear that it was not about the cameras - google certainly likes to keep thinking all of my EOS searches are about those cameras however.


Regarding the main question

The USB hardware on Teensy 4.1 is quite different. If you just want to get the project going, buy a Teensy 3.6.

If you really want to dive into low-level USB programming and learn a lot along the way, this would be a pretty good way to do so, since Amy already did all the hard work of reverse engineering that device and functionally identical HID code exists on Teensy 4.1 and 3.6 so you can compare, and people here can help if you get stuck. But it will be a long journey of learning if you're not already familiar with how to do this sort of thing.

If your goal is the destination rather than the journey, just buy a Teensy 3.6.


Ah, I thought this may have been the case. My aim at this time is certainly to just get the project going - I do not really have the time to dedicate to reinventing the wheel to get this show on the road to speak.
I would otherwise be game to learn how to get this done, and would certainly be interested in potentially revisiting this project down the line, to port it to more upto date hardware. Unfortunately this level of hardware/software is outside of my current skillset - I have only ever really dealt with serial communications to microcontrollers, never really needing or having the hardware to hand to implement USB.

Might I add a general thank you for the Teensy Ecosystem/Product as a whole - they are a wonderful little thing, and have proven to be useful to me on a few occasions now with some other projects/jobs.
 
Hey LRTNZ,

After a week of beating my head against the wall, I finally got Amy's code adapted for the 4.1. Key to getting it all together was unscrewing my endpoints. Give me a few days for my brain to unexplode and I'll share my code with you.

Key to my success was dumb luck and Paul's comment here. I kept trying to use endpoint 1 since I apparently didn't read that bit of documentation.
 
For anyone else who stumbles across this and has the same question, here you go. My code works, but it's certainly possible that there's a much better way to go about this.

You'll have to alter the teensy4 cores in much the same way as Amy altered those for the teensy3. It's mostly the same, except the following:

- As Paul said elsewhere, (linked in my post above), Endpoint1 is reserved on the teensy 4. You're going to want the following endpoint config in the usb_desc.h file:
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_INTERRUPT + ENDPOINT_TRANSMIT_INTERRUPT
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK

It's pretty much the same as the other configurations listed in the .h file, but be sure to change the IFC_TX/RX_ENDPOINTs as well.

- You'll also want to tweak the Descriptors List in the usb_desc.c file:
#ifdef IFC_INTERFACE
{0x2200, IFC_INTERFACE, etceos_report_desc, sizeof(etceos_report_desc)},
{0x2100, IFC_INTERFACE, usb_config_descriptor_480+IFC_HID_DESC_OFFSET, 9},
#endif

- And the boards file needs tweaked for the teensy41 (in my case):
teensy41.menu.usb.etceos=ETC EOS Encoders
teensy41.menu.usb.etceos.build.usbtype=USB_ETC_EOS

- I made my own usb_ifc library out of the usb_rawhid library when I was fumbling around. It works nicely, and now I don't confuse myself. I don't think this was necessary, but I was stuck for quite a while trying to figure out why things weren't working.

My code works, but it's certainly possible that there's a much better way to go about this. I'd share the entirety of my code, but I like ETC and this seems like a bit of a gray area with their gear. Feel free to shoot me a message if y'all run into trouble with it out there.
 
- I made my own usb_ifc library out of the usb_rawhid library when I was fumbling around. It works nicely, and now I don't confuse myself. I don't think this was necessary, but I was stuck for quite a while trying to figure out why things weren't working.

My code works, but it's certainly possible that there's a much better way to go about this. I'd share the entirety of my code, but I like ETC and this seems like a bit of a gray area with their gear. Feel free to shoot me a message if y'all run into trouble with it out there.

I am currently undertaking the same project and cannot believe my luck that this question has already been posed. smitty053 I have sent you a message as I'm not sure I understand what a usb_ifc library is exactly...
Also I don't blame you re: reluctance to share your full code - I also quite like ETC and don't want to get on the wrong side of them. My feeling is if it is OSC they're super happy to have it open source, but maybe not so much with emulating programming wings...
 
Back
Top