Skip to main content

pyservo42c

This is a library for interfacing to the MKS Servo42C closed-loop stepper motor via UART.

See https://github.com/makerbase-mks/MKS-SERVO42C for details on the hardware.

Note the serial protocol spec claims to include a checksum at the end of response messages. This doesn't seem to be true in practice. Also the set-angle command only accepts two bytes in the "pulse number" field, not the four bytes the spec claims.

Many of the commands are implemented, but not all. Pull requests encouraged!

Modules

servo42c

This provides methods that generate and consume byte arrays for commanding the servo and interpreting results.

servo42cTCPUartBridge

This wraps servo42c and provides an interface to a UART-over-TCP bridge, used for testing.

servo42cUart

This wraps servo42c and provides a direct interface to a UART port.

Implementation notes

TCP UART

For fun, and to avoid trying to map to a windows COM port from WSL, I used an ESP32 running esphome and esphome-stream-server. This gives you a wireless UART port over wifi! Works great.

Raspberry Pi

I tested this interface on an Raspberry Pi 3, but it should work on basically anything. I used raspi-config to enable the /dev/ttyS0 UART port and used pins 6, 8 and 10 for GND, TX and RX.

Metadata

Release files for pyservo42c 0.2.1

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

Source distribution (sdist)

Source distribution for pyservo42c 0.2.1
File Size Uploaded Provenance Actions
pyservo42c-0.2.1.tar.gz 9.8 kB Without provenance Details for pyservo42c-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyservo42c 0.2.1
File Interpreter ABI Platform Actions
pyservo42c-0.2.1-py3-none-any.whl Python 3 none any Details for pyservo42c-0.2.1-py3-none-any.whl

Total release size: 19.1 kB

Release files / pyservo42c-0.2.1.tar.gz

Download URL pyservo42c-0.2.1.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9162ce8dc8969c2caa993d785ce1a7e48ac948c5e1184a64b900915b9afe46e7
BLAKE2b-256 checksum
How to use checksums
a6a97a0e34992b6f4359aa5d73e38c5d44d8b49a15093d53464393b7d9f23fb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / pyservo42c-0.2.1-py3-none-any.whl

Download URL pyservo42c-0.2.1-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea9ef54948398a83545803099b84741b5f340e1100c367c98478fad45f6f8e5e
BLAKE2b-256 checksum
How to use checksums
447f2f0044eced774c703a7d16eef6f669970a468bd343ee012207cf66b72307
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Security for pyservo42c 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

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