Ways to analyze unknown USB device? - bash

I have a piece of equipment at work that has a USB output, that then requires to be connected to a specific USB-to-Ethernet adapter in order to send TCP packets. I am trying to cut the Ethernet adapter out of the equation, and connect the USB output directly to the computer.
A Windows machine does not detect hardware changes when it's connected, so I'm thinking about using a Ubuntu device since it might have better network tools.
What are the ways I can test the device to figure out what it actually is? Is it even possible to remove the adapter from the equation in this situation?
PS. The device is a very specific ECU used in cars. It is not something I can download drivers for. It also uses a Class C IP address.

Related

How can I find the VID and PID of a device on the other end of a USB-to-Serial adapter?

I am attempting to connect to a weight-measuring scale using the following communication line: Laptop -> USB to DB-9 Serial adapter -> Scale. The problem I'm experiencing is that my laptop recognizes the adapter as the device on the COM port, thus when I check the VID and PID of the device, it gives me the IDs for the cable and not the scale. Is there some way to find the information for the device on the other end?
I am coding in Python using the PySerial library, but any general answer would be helpful. The adapter I'm using is a USB to UART PL2303 from Prolific Technology Inc. My OS is Windows 10.
I have tried connecting scales from multiple different brands using a USB-to-Serial adapter, and I get the same result. I haven't been able to establish a connection with any of them, with all queries to the scales not being responded to. Two such scales are the Sartorius Entris and the Mettler Toledo Excellence Plus.
EDIT: Responses are saying that serial devices do not have a VID or PID. In that case, how can I tell if a serial device is a certain device from a specific manufacturer? I'm trying to do this so I can recognize when a scale is plugged in and not some other device, using a Python program to communicate with the scale.
Serial devices dont have VID/PID pair.
In "historic" times PCs have two ports - parallel and serial (also known as RS-232). Serial devices are PnP devices, so dont need driver and because this no need VID/PID pair.
What scales are you used?
If industrial, is very possible that are based on RS-485 standard.

Spying on a USB connection on Windows?

I have an Arduino application talking over USB to an application on Windows 8 using the MAVLINK protocol. The connection appears as COM3.
Is there a Windows application that can spy on this connection and display the traffic going in both directions? Raw bytes are fine, I don't need the protocol decoded.
You could log serial port activity using Portmon. (Edit: You need to first connect to the local computer via the Computer menu, and you must start capture on the port before a program opens it.)
You may not want to log USB traffic. Such a log would include a lot of extra information relating to the USB to serial adapter which is providing COM3. Portmon would only give you the bytes transferred over COM3, and the Mavlink protocol is entirely contained within that data stream. If you're sure you want to log all USB traffic to and from that device, then I recommend SnoopyPro. In Windows 7, you need to run it as administrator.
If you can use Windows XP in your environment, USB sniff should work for you. If you need something more powerful (and are willing to pay a fee for it) then USBLyzer might be a viable option.
The answer is SnoopyPro, and you can download it at:
SnoopyPro Sourceforge
This tool allows you to get USB information and also USB communication data. I used it in the past to know how a USB device worked in order to do its driver on Linux. I used this tool as a sniffer.
Basically, SnoopyPro allows you to intercept, display, record and analyze the USB protocol and all transferred data between any USB device connected to your PC and applications. It can be successfully used in application development, USB device driver or hardware development and offers the powerful platform for effective coding, testing and optimization.

Communications between Visual C++ and Arduino:

I have a Arduino app that needs to talk to my PC across the USB (Serial) connection. I have this bit of code that I lifted from the Arduino Playground at
http://arduino.cc/playground/Interfacing/CPPWindows#VisualStudio2008
this->serialPort1->PortName = "COM5"; // Replace with your COM port!
this->serialPort1->Open();
this->serialPort1->Write( "7" ); // In the future, you'll expand on this
// to write your custom data to the board
this->serialPort1->Close();
My question is how does one determine what COM port the Arduino USB cable is attached to?
There are several ways you can approach this.
The most obvious is that you simply make your application configurable and tell it which serial port to use. The port name should never change, unless you have other processes on your machine allocating virtual COM ports such as Bluetooth drivers.
A second option is that you can do what the Arduino app does and scan the serial ports on the system looking for the hardware. Since you are using the CLR, System.IO.Ports.SerialPort.GetPortNames() will give you a list of all the serial ports on the system. (You can also get this from the registry.) Then you can enumerate through them and check the status of the pins to see which serial ports have devices attached. You should probably include in your sketch a way to query the Arduino so that you can send it a command and have it give a fixed response. This would allow you to discern your application from other serial devices such as modems.
There is a third option which would involve figuring out where the FTDI driver stores its configuration information in the system/registry and going from there. This is a bit more involved, so I can't give any information on if this approach is even viable.

Unique, persistent, network device information

I've been trying write an application which will be able to connect to a network device via rndis or over wifi and perform some simple operations.
The kicker is that I want to be able to find a device I've connected to before, through either connection method. I initially figured I'd just check for a previously seen mac address, but I discovered that the rndis mac address and the wifi mac address don't match. I'm on windows so the next thing I tried was to use nbtstat -A and ping -a, but those didn't turn up anything unique either (I figured I might get a device name, but it doesn't seem to have one).
So my question is, is there any tool (ideally available for windows), which will allow me to retrieve some sort of unique information about a network device that will allow me to find it again? I don't have a huge amount of experience in this field so I'm not sure exactly what that would be, but I hoped that there may be a way to get the mac addresses for both network adapters while only connected to one, or perhaps use a different tool to find a device name that I'd missed.
Thank you for any advice you might give, I really appreciate it. Sorry if I'm overly wordy.
EDIT: In case I've been ambiguous. I am connecting repeatedly to an external device via RNDIS or WIFI from my desktop PC. My goal is to be able to consistently recognize the network device regardless of the connection method used.
EDIT: By networked device, I mean that I have small independant devices (such as cell phones or tablets) running a unix os, which I access from my Windows desktop via wifi or rndis, and that I would like to be able to consistently identify. So for example I might want to use this tool to connect to one of two cell phones and be able to recognize which one it is so I can recall previous operations performed with that device. So what I'm looking for is a unique (or semi unique) attribute of the cellphone available to me that is consistent when accessed via rndis or wifi.
You can get MAC address (and bunch of other network interface info) with built-in ipconfig command and parse its output later:
ipconfig /all
Alternatively, if MAC address is all you need, try getmac.

USB Debugging

I'm looking for a very specific USB device for debugging systems that may use USB but not with a regular computer (proprietary hardware). I want a device that has a USB host controller and two USB device connections. The device to be debugged is connected to the USB host controller and one of the device connections is connected to another device with it's own host controller on it. The the other device connection is connected to a pc. The point being that all USB data travelling through the device (from the device connected to the host controller to the device connected to the first device connection) is reported to the pc.
I'll happily write software to do the logging (in fact I want to) but I can't seem to find a board like this anywhere. Can anyone help?
I have an Ellisys USB analyser, which isn't exactly what you describe internally, but does sit between a peripheral and a host and use a separate PC to collect the data.
(i.e. it has two 'B' and one 'A' connectors on it.)
Excellent product, and very helpful company.
Sniffing the USB shouldn't be too hard if you have the right hardware. And that is the tricky question. I haven't seen anything that describes the USB breakout box that you want. However I can say that this is in the realm of the following two magazines:
Nuts and Volts
Circuit Cellar
If they don't have a USB breakout box project in their archives, then at least they will have advertisements for small cheap single board computers that would have multiple USB ports that you can use for buffering the signals and reporting it back to your PC.
Alternatively is it possible to just wire your PC up to the middle of your two devices and write a custom drive that echos data back and forth while sniffing off a stream for you?
Sorry for the long delay in my reply -- I checked out one of our USB developer's toolchain, and he uses a Beagle USB Sniffer. He seems happy with it.
You're looking for a USB device with two upstream outputs. I think according to the USB spec, this is not possible. You will have two USB hosts trying to send messages and control the USB devices at the same time.
What if you were to look for a device which allowed you to view the data going through a hub via something other than a usb output?
If you're building something custom, take a look at this USB chip site. The chips are programmable via a windows application. Once you define how you want it to operate, it's saved on an EPROM on the dev board ($30-$50).
Sorry if this isn't helpful!

Resources