Skip to main content

spmtool

Read/write Kelly SPM brushed motor controller configuration over serial connection. Tested with:

  • SPM24121

Usage

Test serial connection:

$ spmtool

Show help:

$ spmtool -h
usage: spmtool [-h] [-r | -w | -c] [-v] [-d DEVICE] [-s SETTINGS] [file]

positional arguments:
  file           config file

options:
  -h, --help     show this help message and exit
  -r, --read     read controller memory to file
  -w, --write    write config to controller
  -c, --check    check and compare controller config
  -v, --verbose  show debug log
  -d DEVICE      serial port device
  -s SETTINGS    settings schema preset or file

Read Memory

Connect to controller, read memory, optionally mask settings and then save to nominated file.

Read controller settings into conf.bin using SPM24121 preset:

$ spmtool -r -s SPM24121 conf.bin

Write Memory

Load config from nominated file, connect to controller, update any settings listed in settings schema on controller and save. A settings schema file or preset is mandatory in this mode, see "Settings Schema" below for details.

Write settings from conf.bin to controller using SPM24121 preset:

$ spmtool -w -s SPM24121 conf.bin

Check Memory

Load config file, connect to controller and then list any differences between config and controller memory. Optionally mask config and memory with a settings schema.

Compare controller memory with contents of conf.bin using SPM24121 preset:

$ spmtool -c -s SPM24121 conf.bin

Settings Schema

Controller settings are listed in the settings schema one per line with the whitespace delimited columns:

offset mask description

Where offset is a hexadecimal byte offset in the memory, mask limits the bits that are set/cleared and description is a text description for the setting. See included file SPM24121.txt for an example.

To use a defined preset, use preset name as the schema, eg:

$ spmtool -s SPM24121

Installation

Install with pip, or run script file directly:

$ python3 spmtool.py

Metadata

Release files for spmtool 1.0.0

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

Source distribution (sdist)

Source distribution for spmtool 1.0.0
File Size Uploaded
spmtool-1.0.0.tar.gz 7.7 kB Details

Built distribution (wheel)

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

Total release size: 15.0 kB

Release files / spmtool-1.0.0.tar.gz

Download URL spmtool-1.0.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2d0cdf00fed727afb6672f9377fd40cf0045993a3a8152debd5ad10eb67503a8
BLAKE2b-256 checksum
How to use checksums
3e464d42ad07256ca0bbd6848c907acda5f80f95457eb98db1b9e8a24a170ad5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Release files / spmtool-1.0.0-py3-none-any.whl

Download URL spmtool-1.0.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f0dbd169451e2c34204fd9e1850bd51018d6ddb69d3713d5b47ebd002c581d1
BLAKE2b-256 checksum
How to use checksums
851a9d151e8412bc2e9988192a4c0e5f72821526ee1c078b85d2c9a54937168b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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