UBS pass-through with USBHost_t36?

Status
Not open for further replies.

crustn

Member
Hi,

I wonder if it's possible to use Teensy's USBHost port to pass through the data to a computer over the other USB port? I have a USB device which sends MIDI data and other authentication stuff over USB to an application on a mac. I want to enhance it's capabilities, that means passing through all the data between the USB device and the mac app but also send additional data (Midi SysEx bytes) from Teensy to the mac as if it would have been sent from the USB device. Is that possible?

thanks for any advice,
Stefan
 
USB is a complex protocol. You can't "pass through". But you can have a USB MIDI device talk to Teensy 3.6 on the USB host port, and you can program the USB device port to act as a separate USB MIDI device. You can try to write code that relays the messages received on one port to the other. That is possible. But it's not a pure pass through. It's fully receiving, then after you've got the message, transmitting a similar message on the other port.

The library comes with an example that has most of what you need. The example uses the 16 virtual cable MIDI device and allows 6 serial (5 pin DIN) MIDI and 10 single virtual cable USB MIDI devices (connected via USB hubs) to map onto the 16 ports your PC sees. In Arduino, click File > Examples > USBHost_t36 > Interface_16x16. You'll probably end up deleting much of that code for the serial MIDI devices, but hopefully the parts showing how to retransmit messages will give you a good start.
 
Hi Paul,

thanks for your fast reply.
USB is a complex protocol. You can't "pass through".
I fear you would say that. Just wanted to be sure.
But you can have a USB MIDI device talk to Teensy 3.6 on the USB host port, and you can program the USB device port to act as a separate USB MIDI device. You can try to write code that relays the messages received on one port to the other.
Yes I know. I did something similar passing Midi Data received through Ethernet (ipMidi) and then sending it via Class Compliant USB Midi to the Mac. Problem here is, that there is not only Midi involved. There is kind of a shake hands done before the USB device connects to the app and I didn't want to hack all that stuff because as you said, USB protocol is quite complex.

But anyway, as always, thank you so much for your help and support.
Stefan
 
Status
Not open for further replies.
Back
Top