Skip to content
Advertisement

Tag: serial-port

How to find out which USB-RS232 device is on which tty?

I have two different USB devices based on the same USB-RS232 chips. When I plug those in the USB they are mounted to /dev/ttyUSB0…3 My problem is how, inside a script, I can find out which one is on what tty? Using lsusb I can differentiate them: And using dmesg I can tell where they were mounted: But “usb 4-1”

How to open serial port in linux without changing any pin?

Posix requires changing RTS pin on port opening. I want a way to avoid it. Answer Having the same problem, I’d give it a try by patching the ftdi_sio kernel driver. You just need to uncomment a small piece of code in ftdi_dtr_rts() like this: and the RTS handshake line is not longer changed upon open() call. Note, that the

C write() doesn’t send data until close(fd) is called

So I have this test code to send “HELLO” over a USB serial port: The program executes fine and “HELLO” is sent but there is one problem. “HELLO” doesn’t seem to be sent when the write() function is called, but rather when the file descriptor is closed. I added the sleep(5) line above to test out this theory and sure

Advertisement