PySerial seems to be required for python libraries. Which version do we need?


#1

I am trying to run the python library examples and I get an error in init.py when it tries to import the serial module. I gather from a pull request on the git site that the PySerial library is required and there is some discussion on what version is required but I did not fully understand it. What version of this library do we need and where can we find it if it’s not the current version?

Thanks,
Mark


#2

the Raspbian repo currently only feature version 0.2.5 if I recall correctly, which is what you need. To install:

sudo apt-get python-serial python3-serial

#3

Thanks, RogueM.

I saw that the project had been updated to work with the latest pyserial and I did a git pull and used the latest pyserial from github. When I try to run the blink-matrix.py I get this error:

File “examples/blink-matrix.py”, line 12, in
c = flotilla.Client()
File “/home/pi/.local/lib/python3.2/site-packages/flotilla/init.py”, line 74, in init
raise AttributeError(“No port specified and none found!”)
AttributeError: No port specified and none found!

I’m afraid I am new to pyserial so I am not sure what this means. Can you help me get past this problem?

Thanks,
Mark


#4

In case it helps I have a Pi 1 model B. When I run uname -a I get:

Linux raspberrypi 3.1.9+ #272 PREEMPT Tue Aug 7 22:51:44 BST 2012 armv6l GNU/Linux


#5

What do you mean by using the latest pyserial from github? What is the output of:

pip3-2 list

(look for the pyserial entry)


#6

I tried using apt-get to install pyserial but that package of pyserial was missing the tools modules so it did not work for me. I then installed the latest pyserial by cloning the git repo at https://github.com/pyserial/pyserial.git and then installing manually. That got me the tools modules and it seems to work when I run it on its own. I just installed the pip-3.2 tool to see what it says and here is the output:

pyserial - Python Serial Port Extension
INSTALLED: 3.1a0
LATEST: 3.0.1

When I run the pyserial tools utility function below I can see the two ports which I assume are my two USB ports:

pi@raspberrypi ~ $ python3 -m serial.tools.list_ports
/dev/ttyACM0
/dev/ttyAMA0
2 ports found


#7

I was able to solve my problem. I had forgotten to install the latest flotilla after I did a git pull. So with the latest flotilla as of yesterday I was able to talk to the dock and sensors with pyserial 3.1a0.

One thing I noticed is that the “weather” sensor does not seem to be supported. It is the one labeled barometer/temp. The entry for that sensor is commented out in init.py and I was wondering why. Is there some reason that sensor is not supported or should I just uncomment that line?


#8

the weather module file is complely empty at the moment, several modules are WIP, and the entire API is due for a serious overhaul.