USB device programming in Linux, how to R/W to USB DB-9 connector
This post is about a USB device that I bought that connects to the USB port and that has a DB-9 "serial" connector on it. I would like to write some Linux software to be able to read and write to the 9 pins or to whatever pins I can R/W to. I know that Linux has a device for USB, namely /dev/usb, though I would like to find out how I can write code to interact with the usb port that I connect the device to.
Anyone who has done this type of pin R/W for a USB port who can tell me how to get started would be helpful. I found a ton of websites on USB and Linux...just not one that gives answers to how to do this in software on Linux. The device did some with a mini-cd and $$$ drivers. I want to use Linux drivers or Linux utilities to R/W to the USB, and have since tossed the mini-cd into the deep ditch. |
So then you are dealing with a USB to RS-232 adapter? In that case, you should be able to do anything you can do on a real serial port by just addressing the adapter's device node. The adapter is designed to be transparent to software, so you should really be looking into Linux serial port guides, and ignore the fact it is a USB device.
Unless there is something more advanced you are trying to do? |
What MS3FGX says is true only if there is a (Linux) driver installed for the adapter. If not, you would have to locate one (from the device vendor, in all likelihood), write one, or use a different such adapter that does have driver support. Writing your own driver would be difficult at best.
--- rod. |
There is no device driver for the USB device for Linux that I have seen, unless you are aware of one? MS3FGX.
Right now, it does not follow any RS232 communication standard. It is a plain DB-9 pin connector on one end with a USB connector on the other end. So, how can I R/W to the pins on the DB9 from Linux (which would be R/W to the USB if you are understanding the device.) |
Well, again, if it is a standard USB to RS-232 adapter; then these are very common devices and are supported natively in the kernel by a number of chipset-specific drivers.
But from your description it sounds more like you have a USB male end on one side, and a DB-9 female on the other? In that case, this is some proprietary adapter that must be for a specific device which uses USB pinouts in the DB-9 formfactor. You wouldn't be able to do anything with this device, as USB only makes use of 4 wires (VCC, Ground, D+, D-), and doesn't operate on the same principles as a RS-232 port. There is no concept of bringing one of the wires "high" on USB, since the individual lines are not controlled by software; the power lines are constant and the two data lines work together. |
There are several things about this thread that make no sense to me.
|
I imagine he might be interfacing a device with the computer via serial port, and rather than have a complicated digital converter decoding the binary data he would rather bring the lines high to directly trigger relays and the like.
|
Quote:
What are the standard chipset drivers for this device? There are no Linux vendor supplied drivers for it that shipped with the device. |
All times are GMT -5. The time now is 01:38 AM. |