PL2303 serial port.


12 posts
by rew » Sat May 26, 2012 4:14 pm
Hi,

I'm adding a GPS unit to my pi (it's training for becoming my car-computer).

The PL2303 serial adapter however seems to not-work when I plug it into my 'pi directly but it does work when I plug it into a hub (whose powersupply is also powering my raspi.).

Do you think my polyfuse is blowing? Would the 2303 require more than 100mA?

I'd say that is quite a lot of current for such a device. I also don't see any large caps that would draw a current peak maybe above 100mA.

Here is my kernel log:
Code: Select all
May 26 16:47:44 raspberrypi kernel: usb 1-1.3: new full speed USB device number 10 using dwc_otg
May 26 16:47:44 raspberrypi kernel: usb 1-1.3: device not accepting address 10, error -32
May 26 16:47:44 raspberrypi kernel: usb 1-1.3: new full speed USB device number 11 using dwc_otg
May 26 16:47:45 raspberrypi kernel: usb 1-1.3: device not accepting address 11, error -32
May 26 16:47:45 raspberrypi kernel: hub 1-1:1.0: unable to enumerate USB device on port 3
May 26 16:47:56 raspberrypi kernel: usb 1-1.2: new full speed USB device number 12 using dwc_otg
May 26 16:47:56 raspberrypi kernel: usb 1-1.2: device descriptor read/64, error -32
May 26 16:47:56 raspberrypi kernel: usb 1-1.2: device descriptor read/64, error -32
May 26 16:47:56 raspberrypi kernel: usb 1-1.2: new full speed USB device number 13 using dwc_otg
May 26 16:47:57 raspberrypi kernel: usb 1-1.2: device descriptor read/64, error -32
May 26 16:47:57 raspberrypi kernel: usb 1-1.2: device descriptor read/64, error -32
May 26 16:47:57 raspberrypi kernel: usb 1-1.2: new full speed USB device number 14 using dwc_otg
May 26 16:47:57 raspberrypi kernel: usb 1-1.2: device not accepting address 14, error -32
May 26 16:47:57 raspberrypi kernel: usb 1-1.2: new full speed USB device number 15 using dwc_otg
May 26 16:47:58 raspberrypi kernel: usb 1-1.2: device not accepting address 15, error -32
May 26 16:47:58 raspberrypi kernel: hub 1-1:1.0: unable to enumerate USB device on port 2
Check out our raspberry pi addons: http://www.bitwizard.nl/catalog/
User avatar
Posts: 396
Joined: Fri Aug 26, 2011 3:25 pm
by Gert van Loo » Sat May 26, 2012 10:39 pm
It probably uses a lot of power.
Don't forge the USB ports where always intended for mouse and keyboard.
The board was never designed for all the exotic devices which people want to plug in.
User avatar
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2112
Joined: Tue Aug 02, 2011 7:27 am
by rew » Sun May 27, 2012 4:49 am
There is a MAX211 on there, which uses "max 20mA" (datasheet, p4).
There is a PL2303 (compatible) chip on there. The original uses "max 24mA". (it's a bare chip under one of those black blobs. Prolific claims they don't make those).

How this adds up to more than 100mA is a mystery to me.
Check out our raspberry pi addons: http://www.bitwizard.nl/catalog/
User avatar
Posts: 396
Joined: Fri Aug 26, 2011 3:25 pm
by error404 » Sun May 27, 2012 5:50 am
Sounds like a power problem to me, though probably you've done nothing wrong and it's just a result of the poor dimensioning of the polyfuses. Perhaps compounded by the counterfeit Prolific chip maybe having less tolerance for undervoltage.
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm
by rew » Sun May 27, 2012 6:05 am
I'll go grab myself a decent micro-USB cable. I have only 4.49V on the 'PI.
(USB devices are supposed to work down to something like 4.2V, but you might be right that this one doesn't. )
Check out our raspberry pi addons: http://www.bitwizard.nl/catalog/
User avatar
Posts: 396
Joined: Fri Aug 26, 2011 3:25 pm
by xChris » Sat Jun 02, 2012 1:36 pm
I connected one of these http://www.rltechnology.co.uk/ (ebay has a lot) on the GPIO header and works like charm!
Posts: 9
Joined: Sat Jun 02, 2012 1:31 pm
by stevewardell » Sat Jun 09, 2012 12:12 pm
I've been having problems with USB/Serial adapters, one works find with PC but hangs RPi, other works fine with RPi and Psion5 terminal app but not with my Weather Station. Going to try a powered USB hub in the hope it eliminates power as the problem (USB/Serial should be fine both are rated at less than 24ma)
Steve
@stevewardell
stevewardell.wordpress.com
Posts: 16
Joined: Thu Jun 07, 2012 9:15 pm
by hizzle » Thu Jul 05, 2012 8:41 pm
I had the same problem with my pl2303.

First I thought it was a power issue. But when it didn't work on my mac or other linux laptops I got suspicious.

The "default" driver does not seem to work if you have the pl2303X version. This can be checked by typing: lsusb -v -d 067b:2303. If the reply contains bMaxPacketSize0 64 you are likely to have the X version (?). There is a patch somewhere.

However. There is a strange work around. I did:
# sudo modprobe -r pl2303
# sudo modprobe pl2303

And simsalabim, it works. My simple python program now does what I expect it to do.

import sys
import serial
ser = serial.Serial("/dev/ttyUSB0", 115200)
ser.write(argv[1])
ser.close()
Posts: 11
Joined: Wed May 23, 2012 4:57 pm
by csomerlot » Sun Jul 22, 2012 2:36 am
Good tip, I do have the PL2303X version. I tried disabling and re-enabling the module, but sadly no simsalabim for me. So I started debugging using the steps here: http://gpsd.berlios.de/troubleshooting.html

I found that gpsmon reported data, so something is working, but "tail -f /var/log/syslog" reports:

Jul 21 21:15:04 rpi gpsd.hotplug: add /dev/ttyUSB0
Jul 21 21:15:04 rpi gpsdctl: gpsd_control(action=add, arg=/dev/ttyUSB0)
Jul 21 21:15:04 rpi gpsdctl: reached a running gpsd
Jul 21 21:17:01 rpi /USR/SBIN/CRON[2381]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 21 21:18:50 rpi gpsd[277]: gpsd:ERROR: device open failed: Permission denied - retrying read-only
Jul 21 21:18:50 rpi gpsd[277]: gpsd:ERROR: read-only device open failed: Permission denied
Jul 21 21:18:50 rpi gpsd[277]: gpsd:ERROR: /dev/ttyUSB0: device activation failed.
Jul 21 21:18:50 rpi gpsd[277]: gpsd:ERROR: device open failed: Permission denied - retrying read-only

ls -lha shows crw-rw---T 1 root dialout 188, 0 Dec 31 1969 /dev/ttyUSB0

So I did "chmod a+rwx /dev/ttyUSB0" and now cpgs shows data. Great! But, on reboot it goes right back to the same permissions. How do I fix the permissions permanently?

Also, FTR, this BU-353 GPS unit is plugged directly into the RPi, not a hub, I do not seem to have power issues.
Posts: 2
Joined: Tue May 29, 2012 6:43 pm
by prokrypt » Wed Aug 15, 2012 4:02 am
csomerlot wrote:So I did "chmod a+rwx /dev/ttyUSB0" and now cpgs shows data. Great! But, on reboot it goes right back to the same permissions. How do I fix the permissions permanently?

If anyone is still having this problem:
In the file /usr/lib/udev/gpsd.hotplug
add "chmod a+rw $DEVNAME" before "gpsdctl $ACTION $DEVNAME" near the end of the file.
Posts: 3
Joined: Thu Aug 09, 2012 4:15 am
by pmagnus2 » Sat Sep 08, 2012 12:49 pm
prokrypt wrote:If anyone is still having this problem:
In the file /usr/lib/udev/gpsd.hotplug
add "chmod a+rw $DEVNAME" before "gpsdctl $ACTION $DEVNAME" near the end of the file.


Great tip. This made it all work for me. Though on my system the file is located at "/lib/udev/gpsd.hotplug".
Posts: 5
Joined: Thu Aug 23, 2012 12:56 am
by Harrisonheli » Sat Oct 27, 2012 9:47 pm
If anyone is still having this problem:
In the file /usr/lib/udev/gpsd.hotplug
add "chmod a+rw $DEVNAME" before "gpsdctl $ACTION $DEVNAME" near the end of the file.


Adding the line to "/lib/udev/gpsd.hotplug" worked for me.
Thanks for the info.
Posts: 1
Joined: Sat Oct 27, 2012 9:36 pm