Skip to main content

mr-rfr-tools

Common Python utilities shared across Modular Robotics platforms (GoPiGo3, BrickPi3, GrovePi, PivotPi).

Modules

auto_detect_robot

Detects which Modular Robotics board(s) are connected to the Raspberry Pi. Supports: GoPiGo3, GoPiGo, BrickPi3, BrickPi+, GrovePi, PivotPi.

import auto_detect_robot

robot = auto_detect_robot.autodetect()
print(robot)  # e.g. "GoPiGo3"

auto_detect_rpi

Identifies the Raspberry Pi model by reading /proc/device-tree/model — no lookup table required, works with all current and future Pi hardware.

import auto_detect_rpi

print(auto_detect_rpi.getRPIGenerationCode())   # e.g. "RPI4"
print(auto_detect_rpi.getRPIHardwareRevCode())  # e.g. "Raspberry Pi 4 Model B Rev 1.5"

Generation codes returned: RPI0, RPI0-2, RPI1, RPI2, RPI3, RPI3B+, RPI3A+, RPI4, RPI5, RPI-COMPUTE-MODULE, RPI-COMPUTE-MODULE3, RPI-COMPUTE-MODULE4.

di_i2c

I2C abstraction layer supporting multiple bus backends:

Bus name Hardware
"RPI_1" Raspberry Pi hardware I2C (/dev/i2c-1) via python-periphery
"RPI_1SW" Redirected to RPI_1 (software I2C / wiringpi removed on Trixie)
"GPG3_AD1" GoPiGo3 Grove port AD1
"GPG3_AD2" GoPiGo3 Grove port AD2
"BP3_1" … "BP3_4" BrickPi3 sensor ports 1–4
from di_i2c import DI_I2C

bus = DI_I2C(bus="RPI_1", address=0x29)
bus.write_reg_8(0x00, 0x01)
value = bus.read_16(0x01)

Multiple sensors on different ports share a single underlying controller instance automatically — no risk of SPI bus conflicts from duplicate GoPiGo3() constructors.

di_mutex / I2C_mutex

File-based inter-process mutexes that prevent concurrent I2C bus access across multiple Python processes.

di_mutex.DI_Mutex is used internally by di_i2c. I2C_mutex.Mutex is a compatible alternative used by some legacy tools.


Installation

On the robot (Raspberry Pi)

pip install mr_rfr-tools

Or install directly from the repository for development:

git clone https://github.com/DexterInd/RFR_Tools
cd RFR_Tools/miscellaneous
pip install -e .

Dependencies

Package Purpose
python-periphery Hardware I2C on /dev/i2c-1 (Trixie / Debian 12+)
pyserial Serial port scanning in auto_detect_robot

I2C must be enabled on the Pi before using di_i2c with "RPI_1":

sudo raspi-config   # Interface Options → I2C → Enable
# or add dtparam=i2c_arm=on to /boot/firmware/config.txt and reboot

Requirements

  • Python 3.7+
  • Raspberry Pi running Raspberry Pi OS (Trixie / Debian 12 recommended)

License

MIT — see LICENSE or https://choosealicense.com/licenses/mit/

Metadata

Release files for mr-rfr-tools 2.0.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 mr-rfr-tools 2.0.2
File Size Uploaded Provenance Actions
mr_rfr_tools-2.0.2.tar.gz 15.4 kB Without provenance Details for mr_rfr_tools-2.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mr-rfr-tools 2.0.2
File Interpreter ABI Platform Actions
mr_rfr_tools-2.0.2-py3-none-any.whl Python 3 none any Details for mr_rfr_tools-2.0.2-py3-none-any.whl

Total release size: 31.0 kB

Release files / mr_rfr_tools-2.0.2.tar.gz

Download URL mr_rfr_tools-2.0.2.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2593dc6abda2942ab8f1f45391855de7e31eb2a8db84352e82234f7a95b49241
BLAKE2b-256 checksum
How to use checksums
caa57504b47c437bd0f300bba9a8f19e2e3368e4ff42aaa3b21de0449cb957cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / mr_rfr_tools-2.0.2-py3-none-any.whl

Download URL mr_rfr_tools-2.0.2-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c1ca45ebdcbbb5c6b7c1707a32f448ce39d5ad3612d173254169150815e7fa7
BLAKE2b-256 checksum
How to use checksums
db0cbed45231a270b98029d34bc72a90292fd146ceb69444f47b5c9ef299a6d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for mr-rfr-tools 2.0.2

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

2.0.2 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