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?
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?
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:
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?