I am trying to have a Raspberry Pi Zero emulate a Cisco USB console interface (non-FTDI version). At a high level this is actually not that difficult:
The g_serial driver running on the Pi can accept Cisco idvendor and idproduct parameters, so it will look roughly the same on a lsusb output
The Linux host uses the same driver, cdc_acm, to connect to the Pi and the Cisco Device
The one problem I am having is that the kernel device path is slightly different between the two.
Cisco: /sys/bus/usb/devices/1-1.4.2:1.0
Raspberry Pi: /sys/bus/usb/devices/1-1.4.2:2.0
The Cisco's device path ends in :1.0 and the Raspberry Pi's ends in :2.0. I know 1-1.4.2 comes from the USB hubs I am using on the host, but I do not know how the numbers after the : are assigned.
So my questions are:
how is the last number assigned in the devpath? does it come from the host or attached device?
is there anything I can do to the g_serial driver to make it better emulate the Cisco device and appear as :1.0
Note: I am not trying to fix this with a udev rule. My goal is to completely emulate the Cisco device with the Pi.
Related
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.
I'm trying to use CSR BlueFlash to dump the firmware/upload new firmware to a JBL Flip 3 speaker. I've put the speaker into DFU mode and it shows up in the OSX ioregistry (see below):
but when I try to run BlueFlash, no USB devices are found. Looking in ~/.wine/dosdevices, there are no COM<number> symlinks. In fact, I don't believe there are any /dev/tty devices corresponding to the USB device. I've tried many different USB port numbers (like idProduct and bcdDevice) but BlueFlash finds no USB devices with that number.
I have seen a project where someone got BlueFlash to recognize the device with a JBL Flip 4 so I am fairly certain that what I am trying to do is possible.
Does anyone know how to get Wine on OSX to recognize a USB device?
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.
I am trying find out how and with which program for OSX (10.5.8) I can configure serial ports? I am trying to establish a wireless connection between two Xbee´s (RF modules) and cannot figure out how to use ZTerm nor screen under Terminal. The setup I am using is: an Arduino+Xbeeshield+Xbee with external power supply, and an xbee on the xbee explorer connected to the Computer via USB.
I am trying to gather information on this through various forums, but most of them cover the configuration issue for PC using X-CTU (which I tried with CrossOver but it doesn´t recognize ny of my ports). According to one source, using screen under Terminal should show me all my serial ports, particularly /dev/tty.KeySerial1 - but it doesn´t show, even though I´ve plugged in both my arduino+xbee shield and the xbee on the explorer.
/dev/tty.KeySerial1 is incorrect.
First step is to get the FTDI USB driver installed if it has not yet been installed. The fastest way to determine if it is installed or not is to connect the XBee Explorer board. Then go look in /dev for a device named tty.usbserial-XXXXXXXX (Xs will be a unique hex ID). If you see multiple devices like this, then you probably have the Arduino plugged in too and you will need to disconnect it to determine what the device name is for the XBee Explorer board.
Once you know the device name, all you need to do is the command "screen /dev/tty.usbserial-XXXXXXXXX 9600". That should do it for you.
You can configure the tty device itself using stty. Be sure to redirect input from the terminal you want to configure, as stty operates on it's input. For instance, to set a serial port to 9600, no parity, 8 data bits, and 1 stop bit, aka "9600N81" in Windows parlance, try:
stty 9600 cs8 -cstopb -parenb < /dev/tty.usbserial-xxxxxxxx
Programmatically, you do this by opening the serial port and using the termios(4) ioctls on the device. See the termios(4) man page for more assistance.
I need to create a application that will allow a Windows PC (XP/Vista) to emulate a thumbdrive. That is, when the PC is plugged into either another Windows system, or in this case, a piece of hardware that allows for USB thumbdrives to be plugged in, a folder on the computer looks like a giant thumbdrive. Any thoughts on where a guy would start to investigate this?
Update (more specific description):
I need to connect my PC to one of the newer multifuction devices that support scanning to a USB thumbdrive that is inserted into the front of the device. These units do not support WIA or TWAIN via the rear USB connector that you'd typically use for connectivity to a PC.
Most USB controllers in regular pc's dont have the possibility to function as an USB slave. So I'd start with investigating what kind of hardware you're going to use.
Another way to go: there are USB Link cables to link up 2 pc's over USB, maybe that's usable for you?
You cannot do this in an application. At the lowest level, the USB ports on your computer are controlled by an Host Controller Interface. This chip will manage up to 127 slave USB devices. You would need to seriously reprogram this chip before it implements the slave side of the USB protocol. Of course, at that point any USB hub in your PC will break down - those 8 USB ports you probably have are usually implemented by 2 smart USB hubs connecting to both USB1 and USB2 host controllers. Next, your USB keyboard and mouse will stop working.
Take an MCU with two Slave USBs. Write a simple frimware which makes one USB act as a Special Device Class and wait until PC on this USB provides mandatory data (including Device Class, of course) for the other USB. Write a PC program which connects to the Special Device (your MCU), uploads Mass Storage Device Class and redirects I/O to a dedicated partition. The other USB on the MCU will become an emulated Mass Storage Device.
Some of those code can be taken from Linux.