Flotilla-python on a Mac?


#1

Should flotilla-python work on a Mac? I’ve tried it with the updated firmware I found a line with a 9600 baud rate and changed that to 112500 to suit the change in speed, and rebuilt but not getting it to work.


#2

There are several issues you will encounter:

First of all the API currently (possibly not temporarily in fact) supports Python3 only. Mac OS X provides Python 2.x out of the box. Of course, it’s possible to install a Python 3.x environment. But…

(currently) the code tries to detect if the Flotilla daemon is running, using tools that are not installed by default (and hard to install) on a Mac. Not insurmountable. But…

The API hasn’t been tested with pyserial 3, which is what you’ll pull from the pip repo. I’m sure there are workarounds. But…

The shipshape firmware is not going to work - at least not properly - with the current API, most notably the port numbering has been revamped. Stick to the original firmware if you want to persevere with Flotilla-python on a Mac.

That said, I did get it to work a week or so back, so t’s possible but my advice is to wait until the API has been rewritten and exact steps to make it work on a Mac can be outlined in a less confusing fashion than I just did.


#3

actually, let me try nonetheless to give you a clearer overview of what’s required to get flotilla-python going on a Mac:

  • stick with original 9600 firmware
  • install python3, for example using brew
  • install pyserial using pip
  • comment out line 57 to 66 in /init.py

this ~should~ work. YMMV.


#4

I’ve been working on Flotilla Python today, ran into some of the problems that @RogueM mentions, and fixed them, If you grab the ShipShape edition of the library and run it against the latest firmware it should do you proud: https://github.com/pimoroni/flotilla-python/tree/shipshape

It should work with both Python 2 and Python 3, using PySerial 2.7 to 3.01. I recommend Python 3 and PySerial 3.0.1 anyway, but I can’t remember the steps I performed to get that up and running.

So now it’s:

  • Tested and working in Python 2 ( although there might be some holdout bugs somewhere )
  • Tested against and tweaked to run with PySerial 3.0.1
  • Tweaked so failure to run pidof is ignored
  • Tested and working with ShipShape firmware - mostly the remapping of port numbers

#5

Thanks. I’ll check it out.