Thursday, June 19, 2014

Why USB to RS-232 suck in windows, but don't in Linux

Hello all,

Well, as Hans, PD0AC, is quite busy lately, I did not get my usb2rs232 cable back from him yet
As i kind of expected him to use it for a while I already had ordered the cheapest ones I could find on eBay.....

And yesterday they arrived.... a bit late cause of the postal services between China and the Netherlands , but... ohh well, they arrived...


So just to be clear... this is the CHEAPEST one i could find on ebay.... including free shipping....
Then you may ask how cheap... well...1.81 USD including shipping...... yes that cheap...


So.... lets get started.... lets plug it in....

Lets check if we already have a ttyUSB port.....
open a command shell and become root with the command su
when root do: ls /dev/ttyUSB*  (this roughly means list all serial tty usb devices )



hooray!!! we have a serial device

NOTE: I did not, i repeat did NOT install any f*cked up driver at all!!!!

So, next we already know what device we need to use, but what if I would plug in all , and hook up 1..
Then it would look like this.....


Not much to go by to figure out what is what.....

Well, another command we can do is this...... cat /proc/tty/driver/usbserial


Now, i have 4 identical cables plugged in, but if you have several different you should be able to see different vendors and product numbers...
The first number is the number is the number you will see at /dev/ttyUSB?


In the first terminal screen shot you see "root dialout¨  , and that's the last part what is REALLY important, and i forgot to mention this in the previous post....
Root is the owner of the device.... this is usually root, so this is not weird and should never be your user! Dialout is the group who has rights to this device.

make sure you added yourself to this group....
With this command: addgroup <your user name> dialout
see screen shot below.


This makes sure you have rights to this device.


Now, what makes this better the how windows works....

  • Works out of the box, no installing drivers that don work
    Every windows version has his own crappy driver version....
  • No weird com numbers, linux does not use them, instead they use /device/devicename structure
    The com numbers seem to change a lot as well when you plug them into different usb ports.
    If you only have 1 usb cable, linux will always make this /dev/ttyUSB0
I have heard about people running into problems with these cables, I am not one of them, the cable works like a charm.
Now if you are one of those people who run into some problems, please let me know as I would love to look into this, and try to find a solution.


73's for now...

Alex
PA1SBM

4 comments:

  1. Have you actually heard from Hans? I hope he is just busy.

    Cheers,
    B

    ReplyDelete
    Replies
    1. Hi Brick,

      Yeah, i talk to Hans once or twice a week at least on a local repeater during the drive to or from work... we live about a kilometre form each other... Also have seen him about 2 weeks ago at meeting of the local chapter of our ham club.....
      He's really busy with getting people from crappy windows xp to use Linux Mint in stead...
      With great succes i might say :)
      I'll tell him you asked about him , he will like that...

      Cheers,
      Alex

      Delete
    2. That's great! I was getting a little worried.

      Delete
  2. The reason PL2303 is so problematic in Windows is because Prolific takes a big effort in their drivers to block counterfeit PL2303 chips. These chips are no more than a custom microcontroller that mimics a real PL2303 chip pin by pin.

    These counterfeit chips only work with old Prolific drivers. (up to version 3 or so). Newer drivers or the ones available at Windows update detects the counterfeit chip and issues an error code 10.

    Even if you use old drivers (the ones that work with real and counterfeit parts) you need to block PL2303 driver on Windows Update to don't update this driver. If this driver gets updated, reverto to the old working version is not easy in many cases, giving a lot of problems.

    Linux does not suffer this problem because it does not check for counterfeit chips. Both chips works fine under Linux.

    Google for "counterfeit PL2303" and you will see...

    73!

    ReplyDelete