USB Serial Sniffer

Expensive Notes

Well-known member
Hoping someone can point me in the right direction to do this. I have used MIDI over serial and USB and the USB host so I am comfortable implementing this sort of thing.
I want to be able to plug a Teensy 4.1 into my computer (Mac mini) and a Tonex One guitar pedal into the USB host. I want to use it to read the bytes streaming to and from my computer to the pedal. Eventually I would like to just use the Teensy without the computer to change patches on the Tonex One.
What librarys should I use to do this considering the data will be bytes but not MIDI? Or can you point me to the appropriate page.
Thanks
John
 
Teensy doesn't have hardware support for USB sniffing. Teensy's USB hardware can act as a device or as a host, but it simply is not capable to passively listen.

Your cheapest option would be a software-only sniffer program. I have not personally used any of them, but they do exist. Ordinary computers also lack hardware to passively listen. These programs depend on your computer acting as the USB host. They work by hooking into the host driver to log everything that happened. You get the USB host's very which is usually plenty for reverse engineering protocols, but it lacks precise timing and view of individual tokens. Because it depends on USB host, PC-based software sniffers can't possibly show you the communication between Teensy's USB host port and a USB device. For that you would need a hardware sniffer.

The expensive but very mature and (usually) reliable option is Total Phase's Beagle 480. I have one and can confirm it works well.

A relatively new open source project called Cynthion aims to give similar functionality, and also some hacking-oriented features not in the Total Phase products, at a more affordable price. It's stocked at Mouser. I have not personally tried Cynthion and its Packetry software yet, but it's on my long bucket list....

Capture of slower 12 and 1.5 Mbit USB speeds can also be done using logic analyzers like Saleae and cheap clones. How well this really works in practice (especially with the cheap clones or oldest Saleae hardware), I'm not sure. Those analyzers depend your PC keeping up with sustained fast input data.
 
Hoping someone can point me in the right direction to do this. I have used MIDI over serial and USB and the USB host so I am comfortable implementing this sort of thing.
I want to be able to plug a Teensy 4.1 into my computer (Mac mini) and a Tonex One guitar pedal into the USB host. I want to use it to read the bytes streaming to and from my computer to the pedal. Eventually I would like to just use the Teensy without the computer to change patches on the Tonex One.
What librarys should I use to do this considering the data will be bytes but not MIDI? Or can you point me to the appropriate page.
Thanks
John

This is doable software side only.

The first route I choose for a similar guitar effects pedal, was first through a custom man-in-the-middle .dll which the host software interfaced the hardware through. In my case, the host software using the HidApi library made it rather easy to replace the .dll with my own code, dumping communication(s) & data to the console.
Secondly, I used USBPcap (https://desowin.org/usbpcap/) to capture ALL USB communications on the USB port in question. This generates a .pcap format file for later importing in to Wireshark. With Wireshark (I use v3.6.1), one can then scrutinize the USB protocol data packets individually.

How this works in practice is: With a hex editor at hand, sniff and send a Patch to the pedal. Use Wireshark to search for said Patch data within the capture. You'll figure the rest as you go along.

After you've figured out the transfer protocol of the pedal, next is to verify the method (& data collected) by generating a proof of concept program on a Desktop pc - before touching a Teensy. This should speed development greatly.

Using the above method, I created this for a SourceAudio C4 Synth pedal for the PC (console application).
Using that to verify and iron out the protocol (discovered Teensy2pedal does not require the HID Id byte Pc2pedal requires), I then created this for the Teensy 4.1.

Hope this helps.
 
Thank you both for your detailed replies.
I was hoping I could listen to both USB connections and then simply record what was coming in one USB connection and pass it to the other USB connection.
I know people have done this with a Tonex One but I thought it might be fun to investigate it myself. I'm not that interested to want to spend hundreds or more dollars for a hardware solution.
Michael, your solution is great, thanks for the pointers.
 
Back
Top