Raspberry Pi raspi-io server
-
Require Python3.5+
-
Support I2C (pylibi2c)
-
Support SPI (Spidev)
-
Support Serial (pyserial)
-
Support GPIO, Software PWM (RPi.GPIO)
-
Support TVService, HDMI video settings interface (pylibmmal.TVService)
-
Support MmalGraph, display graph on HDMI or LCD via Multi-Media Abstraction Layer (pylibmmal.MmalGraph)
-
First install Python3.5, refer: Installing Python 3.5 on Raspbian
-
Second install requires: raspi_io:
# Install raspi-io $ sudo pip3.5 install git+https://github.com/amaork/raspi-io.git # Install pylibi2c $ sudo pip3.5 install git+https://github.com/amaork/libi2c.git # Install pylibmmal $ sudo pip3.5 install git+https://github.com/amaork/pylibmmal.git
-
Finally install raspi_ios:
$ sudo python3.5 setup.py install
or
$ sudo pip3.5 install git+https://github.com/amaork/raspi-ios.git
raspi_ios
default listen on port 9876
, you can change it like this:
from raspi_ios import RaspiIOServer
server = RaspiIOServer(port=xxxx)
from raspi_ios import RaspiIOServer, RaspiGPIOHandle, RaspiQueryHandle, RaspiSerialHandle
# Create a raspi io server
server = RaspiIOServer()
# Register gpio handle (GPIO, SoftPWM support)
server.register(RaspiGPIOHandle)
# Register information query handle (raspi_io.Query)
server.register(RaspiQueryHandle)
# Register serial port handle (raspi_io.Serial)
server.register(RaspiSerialHandle)
# Running server
server.run_forever()
$ python3.5 -m raspi_ios.io_server