pimoroni / flotilla-python

Python library for the Pimoroni Flotilla plug-and-play electronics ecosystem
MIT License
25 stars 15 forks source link

pyserial required #2

Closed RogueM closed 8 years ago

Itxaka commented 8 years ago

should link it to "pyserial<3.0"

on pyserial 2.7 the method of identifying the port may work: https://github.com/pimoroni/flotilla-python/blob/master/library/flotilla/__init__.py#L67-L71

But on pyserial>=3 the hwid is on uppercase:

{'subsystem': 'usb', 'product': 'Flotilla Dock', 'device_path': '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0', 'name': 'ttyACM0', 'vid': 5840, 'hwid': 'USB VID:PID=16D0:08C3 LOCATION=1-1', 'pid': 2243, 'usb_device_path': '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1', 'interface': None, 'location': '1-1', 'device': '/dev/ttyACM0', 'serial_number': None, 'manufacturer': 'Pimoroni Ltd', 'description': 'Flotilla Dock'}

So it will never work.

Also, it will fail when trying to get the port as pyserial2 returns tuples while pyserial3 returns dictionaries.

Cheers

Gadgetoid commented 8 years ago

Might be worth refactoring for pyserial>=3, presumable it's generally available? I've got some serious tweaking to do to the Python library so that's a small addition.

Gadgetoid commented 8 years ago

Just tested against Pyserial 3.0.1 and fixed for now: ed8c89e93c8e4438f1814bf9e7de58f83bc01c80

It's not an elegant fix, but it appears to work. I've got an updated Dock ( v1.1 ) so a whole lot of other stuff immediately breaks for me. I'm eager to get ShipShape out so I can continue Python API dev against a v1.1 release.