Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jfjlaros/arduino-simple-rpc
Python client for the Arduino simpleRPC protocol.
https://github.com/jfjlaros/arduino-simple-rpc
arduino discovery remote-procedure-call rpc rpc-api rpc-client rpc-framework simple
Last synced: about 1 month ago
JSON representation
Python client for the Arduino simpleRPC protocol.
- Host: GitHub
- URL: https://github.com/jfjlaros/arduino-simple-rpc
- Owner: jfjlaros
- License: mit
- Created: 2019-03-03T14:21:07.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-19T19:05:15.000Z (3 months ago)
- Last Synced: 2024-12-15T07:47:22.436Z (about 1 month ago)
- Topics: arduino, discovery, remote-procedure-call, rpc, rpc-api, rpc-client, rpc-framework, simple
- Language: Python
- Homepage:
- Size: 168 KB
- Stars: 24
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Arduino simpleRPC API client library and CLI
============================================.. image:: https://img.shields.io/github/last-commit/jfjlaros/arduino-simple-rpc.svg
:target: https://github.com/jfjlaros/arduino-simple-rpc/graphs/commit-activity
.. image:: https://github.com/jfjlaros/arduino-simple-rpc/actions/workflows/python-package.yml/badge.svg
:target: https://github.com/jfjlaros/arduino-simple-rpc/actions/workflows/python-package.yml
.. image:: https://readthedocs.org/projects/arduino-simple-rpc/badge/?version=stable
:target: https://arduino-simple-rpc.readthedocs.io
.. image:: https://img.shields.io/github/release-date/jfjlaros/arduino-simple-rpc.svg
:target: https://github.com/jfjlaros/arduino-simple-rpc/releases
.. image:: https://img.shields.io/github/release/jfjlaros/arduino-simple-rpc.svg
:target: https://github.com/jfjlaros/arduino-simple-rpc/releases
.. image:: https://img.shields.io/pypi/v/arduino-simple-rpc.svg
:target: https://pypi.org/project/arduino-simple-rpc/
.. image:: https://img.shields.io/github/languages/code-size/jfjlaros/arduino-simple-rpc.svg
:target: https://github.com/jfjlaros/arduino-simple-rpc
.. image:: https://img.shields.io/github/languages/count/jfjlaros/arduino-simple-rpc.svg
:target: https://github.com/jfjlaros/arduino-simple-rpc
.. image:: https://img.shields.io/github/languages/top/jfjlaros/arduino-simple-rpc.svg
:target: https://github.com/jfjlaros/arduino-simple-rpc
.. image:: https://img.shields.io/github/license/jfjlaros/arduino-simple-rpc.svg
:target: https://raw.githubusercontent.com/jfjlaros/arduino-simple-rpc/master/LICENSE.md----
This library provides a simple way to interface to Arduino_ functions exported
with the simpleRPC_ protocol. The exported method definitions are communicated
to the host, which is then able to generate an API interface using this
library.**Features:**
- User friendly API library.
- Command line interface (CLI) for method discovery and testing.
- Function and parameter names are defined on the Arduino.
- API documentation is defined on the Arduino.
- Support for disconnecting and reconnecting.
- Support for serial and ethernet devices.Please see ReadTheDocs_ for the latest documentation.
Quick start
-----------Export any function e.g., ``digitalRead()`` and ``digitalWrite()`` on the
Arduino, these functions will show up as member functions of the ``Interface``
class instance.First, we make an ``Interface`` class instance and tell it to connect to the
serial device ``/dev/ttyACM0``... code:: python
>>> from simple_rpc import Interface
>>>
>>> interface = Interface('/dev/ttyACM0')We can use the built-in ``help()`` function to see the API documentation of any
exported method... code:: python
>>> help(interface.digital_read)
Help on method digital_read:digital_read(pin) method of simple_rpc.simple_rpc.Interface instance
Read digital pin.:arg int pin: Pin number.
:returns int: Pin value.
All exposed methods can be called like any other class method.
.. code:: python
>>> interface.digital_read(8) # Read from pin 8.
0
>>> interface.digital_write(13, True) # Turn LED on.Further reading
---------------For more information about the host library and other interfaces, please see
the Usage_ and Library_ sections... _Arduino: https://www.arduino.cc
.. _simpleRPC: https://simpleRPC.readthedocs.io
.. _ReadTheDocs: https://arduino-simple-rpc.readthedocs.io
.. _Usage: https://arduino-simple-rpc.readthedocs.io/en/stable/usage.html
.. _Library: https://arduino-simple-rpc.readthedocs.io/en/stable/library.html