[python-uk] Pyserial on Raspberry Pi returning just "\x00" ie NULL characters
sparks.m at gmail.com
Mon Jul 2 14:45:54 CEST 2012
Probably a little off topic, but posting here in the hope that someone
else has tried connecting a Rasp Pi to an arduino using the arduino's
built in usbserial device. (ie like you would with a "normal" linux
Ignoring all the app details, if I have a piece of code that's like this:
ser = serial.Serial("/dev/ttyUSB0", 9600)
Then on a normal linux box, I'm getting back values I'd expect. On the
raspberrypi, I'm simply getting back "\x00" characters.
In my actual code, I'm both sending and receiving data. The curious
oddity here is that I appear to be receiving the correct *number* of
characters, and appear to also be sending the right number (based on
the flashing of the RX light on the arduino).
However, whilst they're the right number of characters, the actual
characters, being NULLs, are clearly wrong.
I'm guessing that this is actually nothing to do with python and more
a driver issue on the Pi, but on the off chance it is a python issue
or something someone else here has seen before I thought it worth
posting and asking.
If anyone's interested, the context of this is using and RFID tag
reader (plugged into the Pi - which I have working to cause motors to
spin on another device. The reason for the arduino here rather than
faffing with the Pi's pins is a) it'd be faff with the Pi's pins b) I
have an arduino with built in servo control circuits - essentially an
Arduino duemilanove clone with a motor shield combined c) I had all
the bits and really didn't expect serial connection to/from the Pi to
be where I'd get issues!
Any suggestions (good or bad :), comments or sympathy welcome :-)
More information about the python-uk