Skip to main content
https://img.shields.io/github/last-commit/jfjlaros/arduino-simple-rpc.svg https://github.com/jfjlaros/arduino-simple-rpc/actions/workflows/python-package.yml/badge.svg https://readthedocs.org/projects/simplerpc/badge/?version=latest https://img.shields.io/github/release-date/jfjlaros/arduino-simple-rpc.svg https://img.shields.io/github/release/jfjlaros/arduino-simple-rpc.svg https://img.shields.io/pypi/v/arduino-simple-rpc.svg https://img.shields.io/github/languages/code-size/jfjlaros/arduino-simple-rpc.svg https://img.shields.io/github/languages/count/jfjlaros/arduino-simple-rpc.svg https://img.shields.io/github/languages/top/jfjlaros/arduino-simple-rpc.svg https://img.shields.io/github/license/jfjlaros/arduino-simple-rpc.svg

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.

>>> 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.

>>> 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.

>>> 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.

Release files for arduino-simple-rpc 2.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arduino-simple-rpc 2.4.2
File Size Uploaded
arduino-simple-rpc-2.4.2.tar.gz 8.8 kB Details

Release files / arduino-simple-rpc-2.4.2.tar.gz

Download URL arduino-simple-rpc-2.4.2.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e78632507fd8b15cf33ed0f1be7ddaf720d6dfeccff20a359b022524c05a5c55
BLAKE2b-256 checksum
How to use checksums
a99feca4be918dcf4cba2354649d81f82067b7e97aa6b1ca628904bee4e2158b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.7

Release history Release notifications | RSS feed

This release

2.4.2 This release

1 release file

2.4.1

1 release file

2.4.0

1 release file

2.3.0

1 release file

2.2.0

1 release file

2.1.0

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page