pierrerust / apigpio Goto Github PK
View Code? Open in Web Editor NEWapigpio - an asyncio-based python client for pigpio
License: MIT License
apigpio - an asyncio-based python client for pigpio
License: MIT License
When running on the raspberry pi, apigpio should use pigpiod's pipe interface instead of the socket interface.
File "/usr/local/lib/python3.7/dist-packages/mpf/core/machine.py", line 212, in initialise
yield from self.initialise_core_and_hardware()
File "/usr/local/lib/python3.7/dist-packages/mpf/core/machine.py", line 197, in initialise_core_and_hardware
self._load_hardware_platforms()
File "/usr/local/lib/python3.7/dist-packages/mpf/core/machine.py", line 497, in _load_hardware_platforms
self.add_platform(hardware_platform)
File "/usr/local/lib/python3.7/dist-packages/mpf/core/machine.py", line 614, in add_platform
hardware_platform = Util.string_to_class(self.config['mpf']['platforms'][name])
File "/usr/local/lib/python3.7/dist-packages/mpf/core/utility_functions.py", line 588, in string_to_class
m = __import__(module)
File "/usr/local/lib/python3.7/dist-packages/mpf/platforms/rpi/rpi.py", line 20, in <module>
import apigpio
File "/usr/local/lib/python3.7/dist-packages/apigpio/__init__.py", line 2, in <module>
from .apigpio import Pi
I then go on to try to import apigpio from python2 and python3 and get :
pi@pizerow:~/mpf $ python3
Python 3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import apigpio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/apigpio/__init__.py", line 2, in <module>
from .apigpio import Pi
File "/usr/local/lib/python3.7/dist-packages/apigpio/apigpio.py", line 390
asyncio.async(self._wait_for_notif())
^
SyntaxError: invalid syntax
>>>
pi@pizerow:~/mpf $ python
Python 2.7.16 (default, Apr 6 2019, 01:42:57)
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import apigpio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/apigpio/__init__.py", line 2, in <module>
from .apigpio import Pi
File "/usr/local/lib/python2.7/dist-packages/apigpio/apigpio.py", line 388
yield from self._loop.sock_connect(self.s, address)
^
SyntaxError: invalid syntax
>>>
Seeing from .apigpio import Pi
I was looking for a Pi.py in /usr/local/lib/python3.7/dist-packages/apigpio/
but couldn't fit it :
ls /usr/local/lib/python3.7/dist-packages/apigpio/
__init__.py __pycache__ apigpio.py ctes.py utils.py
ls /usr/local/lib/python2.7/dist-packages/apigpio/
__init__.py __init__.pyc apigpio.py ctes.py ctes.pyc utils.py utils.pyc
# pip install apigpio
Collecting apigpio
Downloading apigpio-0.0.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-lrcpnl9o/apigpio/setup.py", line 4, in <module>
with open('README.md', 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'README.md'
You should add a MANIFEST.in to be sure the file README.md is included in the package.
Note that PyPI doesn't render markdown. You might want to use a README.rst instead. There are some workarounds with pandoc otherwise: https://stackoverflow.com/questions/26737222/pypi-description-markdown-doesnt-work
We would like up use apigpio in https://github.com/missionpinball/mpf/ which heavily relies on asyncio to support the RPi as some kind of port extender. However, we need a convenient way for our users to install it. Can you upload it to pypi? We only need python 3+ (currently 3.4 to 3.6).
I need to add some cleanups for callbacks registration.
Maybe implement a context manager to handle all cleanup operations.
Hello @PierreRust,
Many thanks for your work. Please is it possible to kindly add support for the Serial interface? I went via the doc on the pigpio library, and it seems to support serial.
I have a serial interface at “/dev/ttyAMA0”, and was hoping to be able to access it asynchronously using your code. Also support for RS485 will be great as mine is on “/dev/ttyRS485”.
Thanks and regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.