Hi everyone! I have a really weird thing I want to do. Basically I want to make a USB sniffer.
I am not sure how to do this and hoping someone can give me advice.
I have hardware that is RS232 and has an FTDI chip. The output is a USB cable. I cannot change this hardware setup.... What I want to do is make a USB hub that can take the OUTPUT of the FTDI and bring it back to RS232. Here I can read the data using Arduino, manipulate it, inject serial commands ect. and then connect to an FTDI chip again to OUTPUT USB to connect to a PC...
What would be the best way to do this?
Thanks for the help!!
You need a usb host of some sort in the middle. Since you need to communicate with two USB devices, this is probably going to be a computer or RPi or something connected to the host port on the hub) running software that piped the serial ports to eachother. At which point, you might as well just implement the manipulation in there...
USB to serial converters need a computer on the other side of the USB connection to do anything.
Eff. Tee. Dee. Eye. At least that's how I read it.
First, is it really RS232? With +/-12V RS232 levels? The FTDI can't do this without an extra chip such as a MAX232. (It may be hidden inside this cable you can't modify.)
Can you not solder some wires onto the serial side of the FTDI? Then it can be connected to the serial pins of any convenient Arduino. There's very few products I'm aware of which have the FTDI so tightly integrated that you can't do this. (Unless it's not an actual FTDI.)
IF you can get direct TTL (5V) serial access to the pins on the other side of the FTDI, then an Arduino Leonardo or Micro will be perfect for reading this data and sending it on to a PC over USB. An Uno, Mini or other common Arduino can do this too, via SoftwareSerial.
I'm beginning to think that this unspecified hardware is not going to be using FTDI at all. Does it really show up on the PC as a COM port when it's plugged in?
A Due can act as a USB host and pretend to be a connected PC for the device. It's my last choice to do this function as I suspect there may be a better way.
Its an 8051 processor connected to a “IC DRVR/RCVR MULTCH RS232 16SOIC MAX3232” and “IC USB TO PARALLEL FIFO 28-SSOP FT245RL”
If that answers your question. Sure I can add wires internally of the product but that doesn’t help what I am trying to accomplish. Something an end user uses as a quick compliment product instead of retrofitting internal components.
Long story short, I am trying to make this device wireless. customers buy this product and can buy up to 6 of these… and connect them all to a usb hub then to a PC. Its basic 9600 Serial data going back and forth from the PC. In case the PC dies, I want to make this emergency device that talks to a smartphone to send serial commands to unlock/lock… or do whatever I want really.
I have a couple of 8051s in my toolbox and it's fun seeing what 'modern' products still use them.
"In case the PC dies" - I would first tackle this problem. What failures have been observed? What mitigation is already in place (turn off windows update, have a person designated to do updates manually on a schedule)? Of those failures that still occur, how many are power failures that bring down everything, including your proposed new solution? Can you add battery backup to the PC and fix all of those power problems?
So if you decide that you still need this thing, you need a processor that can act as USB host for a COM port type connection. The basic Arduino USBHost library can't do this - it can only talk to a keyboard and a mouse.
This looks useful: https://www.circuitsathome.com/mcu/arduino-usb-host-part-3-descriptors but it's pretty low-level. There must be USB host libraries out there that will do this. Towards the bottom of the first page of google results is: http://avahilario.net/2013/11/arduino-due-bt-dongle/ This looks like it's closer to what you want.
This is looking even better: GitHub - felis/USB_Host_Shield_2.0: Revision 2.0 of USB Host Library for Arduino. and it includes the magic acronym "SPP". So that means your next google search would be "Arduino USB SPP"
Man… talk about snatching defeat from the jaws of victory… If you got the serial out, there’d be so many easy routes forward.
I don’t see a solution other than modifying the devices, or using a cheap little computer that will have no trouble being a USB host (RPi like) to do it.
I agree that using a full on desktop computer for that role is undesirable.
I have the Circuits @ Home USB Host Shiled (mini).. just got it and am still working through it.. (that being said I'm just a hobby guy at all this.. so my obstacles may not be yours)
I believe it even have FTDI classes/examples...
Brolly did give me more information on the 8051 product via private message.
I think in this case the real solution is to go to your marketing guys and get them to find out how much the customers are willing to pay for this added feature. If you have 100 customers want to pay $5000 each for this new capability, then that's going to set your budget for how much engineering you invest in this thing.
If this involves building a new box and delivering that to the customer premises then I think the customers would pay a lot for that. They won't pay for a iPhone app but if you tell them that they need a new box to support that app's features, then they will pay. Somehow hardware always seems more valuable than software.
Morgan: I appreciate your advice on doing a market test to see if this is even worth the investment. What I am about to say is probably BEYOND rare but here it goes. Money is no object for where I work. The goal is to create less troubleshooting calls, create a better/cooler product, and to keep evolving something. That being said, without doing a market research, I can say as I work with the product directly everyday, that people call in a lot. Whether they want to access the product remotely, not use wires, or want to unlock the product using alternate means... We provide an industrial USB hub that costs around 70$. If we build a USB hub for $100 that has "smarts" to it, its not scratch off our back. Considering the product costs.... $12,000 per system and higher and comes with a 2-4K annual subscription.
Building a new box for the future is the way to go, but the point of the thread here is to see if I can build something with Arduino or other processor/low cost CPU to retrofit onto the existing product line.
Thanks Drazzy. So the question is.... I need a USB host. The options on the table are USB host shield for Arduino and ras Pi. I dont like ras Pi because I feel that would need to be reboot it more often than a lower level processor without a GUI ect. Are there any other options that are easy to prototype/work with?
On a side note. I made a ZigBee IR sensor to detect people. They are retrofitted to gym equipment in buildings to know when a treadmill or other equipment is in use or not. (So they can be lazy and not walk downstairs until something is free).
Something I will work on next week: We have 4 restrooms on our floor. I am going to create a sensor that goes over the door lock and using a simple tilt ball switch. The company can just see on a webpage if the restroom is free or not.
So that is my side job at work. I get to "play" and hopefully one of these idea's stick and we can sell in the future.