I am attempting to put a device together to relay USB traffic for a USB device to a host, with the ability to view/inject/alter packets.
A particular use case I'm interested in is programtically sending button presses to an Xbox360. Since there is a security handshake between the controller and the Xbox, you can't just hook up (or emulate) any HID device. However you can relay the traffic from the controller to the Xbox and inject additional USB traffic.
<BEGIN BACKGROUND - FEEL FREE TO SKIP>
One option I was able to get working was emulating a PS2 controller using a Teensy2 based on this: http://procrastineering.blogspot.com/2010/12/simulated-ps2-controller-for.html
I used this in combination with a PS2 to Xbox controller adapter which does the whole USB interception thing (it also requires a standard Xbox controller to be connected to it). There were unfortunately two limitations. It can only be used with a standard xbox controller (no guitar, steering wheels, etc). Only one can be used at a time. I think there may have been some sort of hard coded address in the adapter. If a 2nd one is plugged in, the 1st one stops working.
Another option was using the facedancer: http://goodfet.sourceforge.net/hardware/facedancer21/
I got this all the way through the security handshake, but unfortunately the facedancer (using the Max3421E chip) can only support 3 endpoints and they are unidirectional (1 is read-only, 2/3 are write only). The controller uses two bi-directional endpoints, so even if I were able to fudge the descriptor and translate traffic to different endpoints, I can't manage 2 endpoints in each direction.
I did run across someone doing something very similar using a pair of Teensy2s. https://github.com/brandonlw/USBSimulator
But I ran into some trouble getting it to work.
<END BACKGROUND>
So on to my questions:
USB
How many endpoints does the Teensy2 support?
The Teensy3?
Are they all capable of bidirectional traffic?
Can I program the Teensy2 to do fairly low level USB, specifically control traffic on endpoint 0 (e.g. descriptors, vendor requests)?
The Teensy3?
Communication
It looks like there are several communication options on the Teensy2:
USB (as a serial)
USB (as other device)
Serial
SPI
The teensy 3 adds a few more:
I2C
2 more Serial
This will be primarily for HID devices, but I'd like to minimize the latency, and not unnecessarily limit my bandwidth.
If I am using a setup like Device<->PC<->Teensy#1<->Teensy#2<->Host, then I can have the two Teensies communicate via I2C,Serial, or SPI.
What is the bandwidth of using the USB port as a serial between the PC and the Teensy?
What about if I used the USB as a custom device and spoke directly to the endpoints?
What would the bandwidth be like between the Teensies using I2C?
Serial?
SPI?
I know that USB host support isn't available at the moment for the Teensy but could be in the future at some point. But there are also some host shield options, particularly this one:
http://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-miniI understand this is supported on the Teensy2, but not the 3.
This uses the Max3421E over the SPI bus which I'm already familiar with from the FaceDancer, so is the "not supported" mean that it could likely be made to work if I write the code?
A particular use case I'm interested in is programtically sending button presses to an Xbox360. Since there is a security handshake between the controller and the Xbox, you can't just hook up (or emulate) any HID device. However you can relay the traffic from the controller to the Xbox and inject additional USB traffic.
<BEGIN BACKGROUND - FEEL FREE TO SKIP>
One option I was able to get working was emulating a PS2 controller using a Teensy2 based on this: http://procrastineering.blogspot.com/2010/12/simulated-ps2-controller-for.html
I used this in combination with a PS2 to Xbox controller adapter which does the whole USB interception thing (it also requires a standard Xbox controller to be connected to it). There were unfortunately two limitations. It can only be used with a standard xbox controller (no guitar, steering wheels, etc). Only one can be used at a time. I think there may have been some sort of hard coded address in the adapter. If a 2nd one is plugged in, the 1st one stops working.
Another option was using the facedancer: http://goodfet.sourceforge.net/hardware/facedancer21/
I got this all the way through the security handshake, but unfortunately the facedancer (using the Max3421E chip) can only support 3 endpoints and they are unidirectional (1 is read-only, 2/3 are write only). The controller uses two bi-directional endpoints, so even if I were able to fudge the descriptor and translate traffic to different endpoints, I can't manage 2 endpoints in each direction.
I did run across someone doing something very similar using a pair of Teensy2s. https://github.com/brandonlw/USBSimulator
But I ran into some trouble getting it to work.
<END BACKGROUND>
So on to my questions:
USB
How many endpoints does the Teensy2 support?
The Teensy3?
Are they all capable of bidirectional traffic?
Can I program the Teensy2 to do fairly low level USB, specifically control traffic on endpoint 0 (e.g. descriptors, vendor requests)?
The Teensy3?
Communication
It looks like there are several communication options on the Teensy2:
USB (as a serial)
USB (as other device)
Serial
SPI
The teensy 3 adds a few more:
I2C
2 more Serial
This will be primarily for HID devices, but I'd like to minimize the latency, and not unnecessarily limit my bandwidth.
If I am using a setup like Device<->PC<->Teensy#1<->Teensy#2<->Host, then I can have the two Teensies communicate via I2C,Serial, or SPI.
What is the bandwidth of using the USB port as a serial between the PC and the Teensy?
What about if I used the USB as a custom device and spoke directly to the endpoints?
What would the bandwidth be like between the Teensies using I2C?
Serial?
SPI?
I know that USB host support isn't available at the moment for the Teensy but could be in the future at some point. But there are also some host shield options, particularly this one:
http://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-miniI understand this is supported on the Teensy2, but not the 3.
This uses the Max3421E over the SPI bus which I'm already familiar with from the FaceDancer, so is the "not supported" mean that it could likely be made to work if I write the code?