Skip to main content

cjn_PiTools - A collection of modules for Raspberry Pi projects

cjn_PiTools is comprised of several modules (follow links to respective documentation)

NOTE: These links point to the github repo since relative links to other .md files do not work on PyPI.

Module Description/Purpose
PiBlinky A multiple threaded LED driver for Raspberry Pi
PiOLED Display multi-line messages on a shared Raspberry Pi connected OLED display
DS18B20 DS18B20 temperature sensor library using the w1_therm kernel driver
initW1buses Initialize the W1 buses and set write permission on found therm_bulk_read file(s)
ADC121C ADC121C* 12-bit ADC library for Raspberry Pi
SHT3x SHT3x Temperature/RH sensor library for Raspberry Pi
HTU21D HTU21D Temperature/RH sensor library for Raspberry Pi
MCP23008 MCP23008 8-Bit I/O Expander library for Raspberry Pi
PCA9548 PCA9548A/TCA9548A I2C port expander library for Raspberry Pi
shared Classes and functions used across cjn_PiTools

These drivers work with both RPi.GPIO / smbus2 (for local control) and pigpio for (local and remote control).

Developed and tested on Raspbian GNU/Linux 11 (bullseye) and Python 3.9.2, and supported on all higher versions.

In this documentation, "tool script" refers to a Python project that imports and uses cjn_PiTools. Some may be simple scripts, and others may themselves be installed packages.


Installation and usage

If using the RPi.GPIO and/or smbus2 drivers:

pip install cjn_PiTools

If using the pigpio driver:

pip install cjn_PiTools[pigpio]
  • And you will also need to install the pigpiod daemon (sudo apt install pigpiod) and start it manually or at boot. Here's a systemd service file for starting pigpiod at boot:

      [Unit]
      Description=Daemon required to control GPIO pins via pigpio
    
      [Service]
      ExecStart=/usr/local/bin/pigpiod -l
      Type=forking
      TimeoutStopSec=20
    
      [Install]
      WantedBy=multi-user.target
    

Key changes since the prior major public release (1.1)

V1.2.2 Changes

  • Minor tweak on PiOLED logging of IPC handle names V1.2.1 Changes
  • HTU21D dummy user reg reads for measurement reads stability, init changed do_soft_reset > do_reset, consistent with SHT3x.
  • PCA9548 monitor_ch feature
  • ADC121C read_conversion_result force_address switch added to address issue when a second process accesses the device and leaves the address register set elsewhere

V1.2 Changes

  • PiOLED uses shared memory, changed from display_file - cjnfuncs 3.2 dependency
  • PiOLED add toolname to pioled_display_driver pioled_shm_lock and pioled_go_flag .get_lock() calls
  • PiOLED taillog command
  • Debug logging of MCP23008 set_register() and set_bits() values

Revision history

  • 1.2.2 260828 - Corrected PiOLED logging of IPC handle names
  • 1.2.1 260526
    • HTU21D dummy user reg reads for measurement reads stability
    • PCA9548 monitor_ch
    • ADC121C read_conversion_result force_address switch added
    • PiOLED tweaks
    • HTU21D init changed do_soft_reset > do_reset, consistent with SHT3x
  • 1.2 260506
    • PiOLED uses shared memory, changed from display_file - cjnfuncs 3.2 dependency
    • PiOLED add toolname to pioled_display_driver pioled_shm_lock and pioled_go_flag .get_lock() calls
    • PiOLED taillog command
    • Debug logging of MCP23008 set_register() and set_bits() values
  • 1.1.1 260401 - pyproject.toml cleanup, keywords
  • 1.1 260401 - Added ADC121C, HTU21D, MCP23008, PCA9548, and SHT3x drivers
  • 1.0 260207 - New. Bundled PiBlinky, PiOLED, initW1buses, and DS18B20 modules

Metadata

Release files for cjn-PiTools 1.2.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 cjn-PiTools 1.2.2
File Size Uploaded
cjn_pitools-1.2.2.tar.gz 4.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for cjn-PiTools 1.2.2
File Interpreter ABI Platform
cjn_pitools-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 MB

Release files / cjn_pitools-1.2.2.tar.gz

Download URL cjn_pitools-1.2.2.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
696935cc9787c51757fb2ab7551ceb79bd8616f6f1b4db848f69c533cb810602
BLAKE2b-256 checksum
How to use checksums
56c753b550cdd7e9fe22e26308e736807d519e07d5d076c4e5da9c034fd30a0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release files / cjn_pitools-1.2.2-py3-none-any.whl

Download URL cjn_pitools-1.2.2-py3-none-any.whl
Size 4.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
bd4cbe05cc0cc7b5928b6e5aba923b3ce6b7550930c295dffa7d1614377507b1
BLAKE2b-256 checksum
How to use checksums
cbd5729691f2c95800da2a4f1c69076f9ed8e1ba1811b83dafd5362850b53ed3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.2

2 release files

1.1.1

2 release files

1.1

2 release files

1.0.1

2 release files

1.0

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