Skip to main content

PyEilik

PyPI Python versions License

Control an Eilik desk robot from Python — its servos, its screen, and video playback with the robot dancing along.

The robot ships sealed, with an app and no documented interface. The protocol this speaks was recovered by reverse engineering and checked against real hardware; it is written up in full at eiliksdk.com/protocol.

A C core with a stable ABI does the work; the Python package is a thin wrapper over it.

macOS only, and deliberately so. The robot runs at 125000 baud, which is not a standard rate: setting it needs an Apple-specific ioctl, and there is no equivalent elsewhere. On another platform the port would open at some default rate and put garbage on the wire, which is worse than not shipping at all.

Install

pip install pyeilik

The distribution is pyeilik; the import is eilik, the way pyserial imports as serial.

One wheel covers Apple silicon and Intel on any Python 3.9 or newer: it carries a plain shared library rather than a CPython extension, so it is not tied to an interpreter version.

Showing a PNG needs a decoder, which Python has none of built in:

pip install 'pyeilik[image]'

Quick start

import eilik

with eilik.connect() as robot:
    robot.arm_left.to(1800)
    robot.head.to(1600)
    robot.commit()          # both joints move together, in one packet

    print(robot.positions())
    robot.rest()

Sides are the robot's own, the way anatomy is normally named: arm_left is the robot's left arm, which is the one you see on your right when facing it.

What it does

Servos. Four joints, with their real travel limits enforced. Targets are staged and then committed, because one packet can carry all four and that is the only way to move them in step.

The screen. 128×64, one bit per pixel, in both directions.

robot.screen.show("face.png")     # scaled, thresholded, rotated for you
saved = robot.screen.read()       # 1024 bytes, the panel's own order
robot.screen.clear()

Video, and dancing to it. Needs ffmpeg on PATH.

robot.play("clip.mp4")                    # picture and sound
robot.play("clip.mp4", dance="simple")    # and the robot moves to it
robot.play("clip.mp4", dance="guitar")

Sound comes out of your computer. The robot has a speaker, but no command exists to send audio to it — not in this protocol, and not in the manufacturer's own software either.

Worth knowing

  • ServoFaultError means a power cycle, not a bug hunt. When every joint reads position 0 the servo controller has stopped. Unplugging USB will not fix it: the robot has an internal battery, so it has to be switched off at the power switch.
  • Only one process can hold the port. A second connection raises PortBusyError. Use the context manager so the port is always released.
  • Every command waits for its acknowledgement. Sending a second command while the firmware is still reading a 1032-byte display frame drops the device off the USB bus. The library waits so you do not have to.

Links

Not affiliated

Eilik is a product of its respective manufacturer. This project is independent, unofficial, and not endorsed by them. The name is used only to say which device the library talks to.

License

MIT.

Development

cmake -S . -B build -DBUILD_SHARED_LIBS=ON && cmake --build build
pip install -e '.[dev]'
ctest --test-dir build     # C, no robot needed
pytest                     # Python, no robot needed
pytest -m hardware         # needs a robot

The documentation site lives in site/.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyeilik-0.3.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyeilik-0.3.0-py3-none-macosx_11_0_universal2.whl (58.9 kB view details)

Uploaded Python 3macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file pyeilik-0.3.0.tar.gz.

File metadata

  • Download URL: pyeilik-0.3.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyeilik-0.3.0.tar.gz
Algorithm Hash digest
SHA256 56acfe68eef64e7333d7efbadcdbf505849f838ae848efa44394e93baf5433e7
MD5 e87a0309b015e9ecd3ec2fb6ef8b54ee
BLAKE2b-256 4ee20e0bf8e1d2107ae1519143c35de21f09263a81e696f5b5eb9950594b661f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyeilik-0.3.0.tar.gz:

Publisher: workflow.yml on aklto/PyEilik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyeilik-0.3.0-py3-none-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for pyeilik-0.3.0-py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 6e19b0975e0f86b96e7009b84c3e889773b4765447373c670c3b6a337216cd2b
MD5 e7d7783cc741700aad302565ffd844f7
BLAKE2b-256 45fba9b99675835b482151cc8a36a472fc9fe0b62ecb23e7c9c8aee4fd4c3f96

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyeilik-0.3.0-py3-none-macosx_11_0_universal2.whl:

Publisher: workflow.yml on aklto/PyEilik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.1

2 files

This release

0.3.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page