skillfed

pymata-express

A Python Protocol Abstraction Library For Arduino Firmata using Python asyncio

pymata-express v1.21 73.9K downloads/30d#14,905 on PyPI44
AGPL license GNU Affero General Public License v3 or later (AGPLv3+) Abandoned released

What it is and what it does

Pymata-Express is an asyncio-based Firmata protocol client that lets you control Arduino boards from Python by reading and writing digital and analog pins, interfacing with sensors like HC-SR04 ultrasonic and DHT temperature/humidity modules, and driving stepper motors. It communicates with an Arduino running the FirmataExpress sketch (an enhanced version of StandardFirmata 2.5.8) over a serial connection, translating Python method calls into Firmata protocol messages.

The library uses an event-driven model: you set a pin mode and either attach a callback function to be invoked when the pin's value changes, or poll the pin's last recorded state. Each event is timestamped and logged. The single runtime dependency is pyserial for serial communication. However, the project has been archived and unmaintained since 2022-03-24, so it is suitable only for maintaining existing Arduino automation projects or educational use where you control the firmware version.

Use it for:

  • Monitor digital input pins (buttons, switches) on an Arduino and trigger Python callbacks when state changes occur.
  • Read analog sensor values (potentiometers, light sensors) and log or process them in real time.
  • Control stepper motors or piezo speakers connected to an Arduino from a Python asyncio application.
  • Build educational robotics or home automation projects that integrate Arduino hardware with Python logic.
  • Integrate HC-SR04 ultrasonic distance sensors or DHT humidity/temperature sensors into a Python data collection pipeline.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

An asyncio-based Python client for controlling Arduino boards via the Firmata protocol, supporting digital/analog I/O, sensors, and motors through callback-driven or polled event handling.

No, unless you are maintaining an existing codebase. The project is archived and abandoned since 2022-03-24 with no active maintenance. While it has low install friction and no known vulnerabilities, the lack of updates means it will not receive bug fixes or compatibility improvements for newer Python or Arduino versions. For new Arduino–Python projects, consider actively maintained alternatives or direct serial communication with pyserial.

Install

pymata-express on PyPI

pip

pip install pymata-express

uv

uv add pymata-express

poetry

poetry add pymata-express

Installing pymata-express

Before you install

Low install friction with a single runtime dependency (pyserial). However, the project is archived and abandoned since 2022-03-24, with no maintenance for an extended period—use only if you need to maintain existing code or are certain the FirmataExpress sketch on your Arduino is stable.

License in practice

Licensed under GNU Affero General Public License v3 or later (AGPLv3+), which requires that any modifications or derivative works be released under the same license and that source code be made available to users. This is a copyleft obligation that may restrict commercial or proprietary use.

Quickstart

import asyncio
from pymata_express import pymata_express

async def main():
    board = pymata_express.PymataExpress()
    await board.set_pin_mode_digital_input(12, callback=my_callback)
    await asyncio.sleep(1)
    await board.shutdown()

asyncio.run(main())

Requires an Arduino running the FirmataExpress sketch (or compatible StandardFirmata) and a serial connection; pyserial must be able to detect and open the device port.

Verify before relying

  • Whether the FirmataExpress sketch remains compatible with current Arduino hardware and IDE versions
  • Current state of the GitHub repository and whether community forks are actively maintained
  • Compatibility with Python versions beyond 3.7 (classifiers list 3.7 but requires_python is unspecified)

Package facts

License GNU Affero General Public License v3 or later (AGPLv3+) (agpl)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — pyserial
Maintenance abandoned — 1,834 days since the last release
Last repo commit (repository archived)
First released
Downloads 73,938/month — #14,905 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pymata_express-1.21-py2.py3-none-any.whl

Keywords: Firmata, Arduino, Protocol, Python, asyncio

Development Status :: 5 - Production/StableEnvironment :: Other EnvironmentIntended Audience :: DevelopersIntended Audience :: EducationLicense :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)Operating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.7Topic :: EducationTopic :: Home AutomationTopic :: Utilities

Tags

arduino control python asynciofirmata protocol clientarduino digital analog pinsarduino sensor integrationpython hardware automationfirmata express sketcharduino event callbacks
arduino-hardwareasyncio-ioabandoned

More Utilities packages