2010年7月31日 星期六

dirve PL2303 in Linux

source: http://ubuntuforums.org/showthread.php?t=190124
Under 6.06 the USB device number corresponds to the USB device number -1. (i.e USB0 = 1st USB port) Therefore if you use dev/ttyUSB0 as a comms port, then you haev to be plugged into the first USB port on your machine.

e.g. I have 4 USB port (as per device manager listing). I plugged my USB serial cable into port 1 (the lowest and first port) and minicom worked. I then plugged it into the 4th port. Minicom failed.

I then added a tty device called USB3. I plugged in th serial cable into port 4 and bingo it work. It is quite reminiscent of the old way windows used to work with comm ports.

Anyway problem resolved for me. Hope this tip helps somebofy else.

I have read your post "upgd breezy -> dapper. now I cannot open ttyUSB0 via MINICOM"

and I have the same problem than you.

If I open "minicom" using ttyS0 then it works
If I open "minicom" using ttyUSB0 then I get "cannot open /dev/ttyUSB0: No such device" even if "ttyUSB0" appears in my /dev list.

Reading your post, you say that plugging your USB serial cable into one of the USB then you are able to make it works. I do not have yet any USB serial cable to connect into the USB and to test what you did, but I am wondering that if "minicom using ttyS0" works without any cable connected into the RS232 interfaz, why "minicom using ttyUSB0 does not work if there is not any cable connected".

I ask this, because I am doing an application where I need to connect two devices into the 2 serial ports, but my laptop has only one, so the second one has to be used through the USB (so I need to buy the cable to convert RS232 into USB).
Before having the cable I have tested this:
open("/dev/ttyS0",O_RDWR|O_NOCTTY|O_NDELAY|O_NONBLOCK); //works
open("/dev/ttyUSB0",O_RDWR|O_NOCTTY|O_NDELAY|O_NONBLOCK); //receiving "open error 2 no such file or directory"

So after that I tried minicom resulting the above of the post.

So my question is: "ttyUSB0" can be only opened when there is something connected on it?
(because with ttyS0 you can open even if there is nothing connected on it)

沒有留言:

張貼留言