cjn-PiTools 1.2.2__tar.gz → 2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cjn_pitools-2.0/PKG-INFO +149 -0
- cjn_pitools-2.0/README.md +124 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/pyproject.toml +22 -16
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/ADC121C.py +71 -83
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/DS18B20.py +24 -12
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/HTU21D.py +128 -89
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/MCP23008.py +19 -24
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/PCA9548.py +38 -39
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/PiBlinky.py +59 -31
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/PiOLED.py +11 -8
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/SHT3x.py +79 -76
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/deployment_files/PiOLED_server.service +4 -0
- cjn_pitools-2.0/src/cjn_PiTools/deployment_files/initW1buses.cfg +18 -0
- cjn_pitools-2.0/src/cjn_PiTools/deployment_files/initW1buses.service +24 -0
- cjn_pitools-2.0/src/cjn_PiTools/deployment_files/rgpio_shared_gpios.cfg +24 -0
- cjn_pitools-2.0/src/cjn_PiTools/deployment_files/rgpio_shared_gpios.service +15 -0
- cjn_pitools-2.0/src/cjn_PiTools/initW1buses.py +314 -0
- cjn_pitools-2.0/src/cjn_PiTools/rgpio_shared_gpios.py +723 -0
- cjn_pitools-2.0/src/cjn_PiTools/shared.py +865 -0
- cjn_pitools-2.0/src/cjn_PiTools.egg-info/PKG-INFO +149 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools.egg-info/SOURCES.txt +4 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools.egg-info/entry_points.txt +1 -0
- cjn_pitools-2.0/src/cjn_PiTools.egg-info/requires.txt +12 -0
- cjn_pitools-1.2.2/PKG-INFO +0 -113
- cjn_pitools-1.2.2/README.md +0 -90
- cjn_pitools-1.2.2/src/cjn_PiTools/deployment_files/initW1buses.service +0 -22
- cjn_pitools-1.2.2/src/cjn_PiTools/initW1buses.py +0 -128
- cjn_pitools-1.2.2/src/cjn_PiTools/shared.py +0 -467
- cjn_pitools-1.2.2/src/cjn_PiTools.egg-info/PKG-INFO +0 -113
- cjn_pitools-1.2.2/src/cjn_PiTools.egg-info/requires.txt +0 -10
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/LICENSE +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/setup.cfg +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/__init__.py +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/deployment_files/PiOLED_server.cfg +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/C&C Red Alert [INET].ttf +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/ChiKareGo.ttf +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/FreePixel.ttf +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/GLECB.TTF +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/ProggyTiny.ttf +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/README [INET].txt +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/Volter__28Goldfish_29.ttf +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/code2000.ttf +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/creep.bdf +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/fontawesome-webfont.ttf +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/miscfs_.ttf +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/pixelmix.ttf +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools/fonts/tiny.ttf +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools.egg-info/dependency_links.txt +0 -0
- {cjn_pitools-1.2.2 → cjn_pitools-2.0}/src/cjn_PiTools.egg-info/top_level.txt +0 -0
cjn_pitools-2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cjn_PiTools
|
|
3
|
+
Version: 2.0
|
|
4
|
+
Summary: cjn's library of Raspberry Pi functions, drivers, tools, ...
|
|
5
|
+
Author-email: Chris Nelson <github@cjnaz.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: repository, https://github.com/cjnaz/cjn_PiTools
|
|
8
|
+
Keywords: cjnaz,cjnfuncs,Raspberry,Raspberry Pi,RPi,luma,luma.oled,OLED,LED,blinky,DS18B20,w1_therm,ADC,ADC121C,ADC101C,ADC081C,HTU21D,MCP23008,PCA9548,TCA9548,PCA9548A,TCA9548A,SHT3,SHT30,SHT31,SHT35,Trixie,rgpio,lgpio,smbus,smbus2
|
|
9
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: cjnfuncs>=3.2.4
|
|
14
|
+
Requires-Dist: lgpio>=0.2.2.0
|
|
15
|
+
Requires-Dist: luma.oled>=3.14
|
|
16
|
+
Requires-Dist: luma.core[gpio]>=2.5.1
|
|
17
|
+
Requires-Dist: pillow>=13.0.0
|
|
18
|
+
Requires-Dist: spidev>=3.8
|
|
19
|
+
Requires-Dist: smbus2>=0.6.1
|
|
20
|
+
Requires-Dist: crc>=8.0.0
|
|
21
|
+
Requires-Dist: RPi.GPIO>=0.7.1
|
|
22
|
+
Provides-Extra: rgpio
|
|
23
|
+
Requires-Dist: rgpio>=0.2.2.0; extra == "rgpio"
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# cjn_PiTools - A collection of modules for Raspberry Pi projects
|
|
27
|
+
|
|
28
|
+
## cjn_PiTools is comprised of several modules (follow links to respective documentation)
|
|
29
|
+
|
|
30
|
+
NOTE: These links point to the github repo since relative links to other .md files do not work on PyPI.
|
|
31
|
+
|
|
32
|
+
Module | Description/Purpose
|
|
33
|
+
--|--
|
|
34
|
+
[PiBlinky](https://github.com/cjnaz/cjn_PiTools/blob/main/PiBlinky.md) | A multiple threaded LED driver for Raspberry Pi
|
|
35
|
+
[rgpio_shared_gpios](https://github.com/cjnaz/cjn_PiTools/blob/main/rgpio_shared_gpios.md) | Central owner of GPIO pins for sharing across tool scripts
|
|
36
|
+
[PiOLED](https://github.com/cjnaz/cjn_PiTools/blob/main/PiOLED.md) | Display multi-line messages on a shared Raspberry Pi connected OLED display
|
|
37
|
+
[DS18B20](https://github.com/cjnaz/cjn_PiTools/blob/main/DS18B20.md) | DS18B20 temperature sensor library using the w1_therm kernel driver
|
|
38
|
+
[initW1buses](https://github.com/cjnaz/cjn_PiTools/blob/main/initW1buses.md) | Initialize the W1 buses and set write permission on found therm_bulk_read file(s)
|
|
39
|
+
[ADC121C](https://github.com/cjnaz/cjn_PiTools/blob/main/ADC121C.md) | ADC121C* 12-bit ADC library for Raspberry Pi
|
|
40
|
+
[SHT3x](https://github.com/cjnaz/cjn_PiTools/blob/main/SHT3x.md) | SHT3x Temperature/RH sensor library for Raspberry Pi
|
|
41
|
+
[HTU21D](https://github.com/cjnaz/cjn_PiTools/blob/main/HTU21D.md) | HTU21D Temperature/RH sensor library for Raspberry Pi
|
|
42
|
+
[MCP23008](https://github.com/cjnaz/cjn_PiTools/blob/main/MCP23008.md) | MCP23008 8-Bit I/O Expander library for Raspberry Pi
|
|
43
|
+
[PCA9548](https://github.com/cjnaz/cjn_PiTools/blob/main/PCA9548.md) | PCA9548A/TCA9548A I2C port expander library for Raspberry Pi
|
|
44
|
+
[shared](https://github.com/cjnaz/cjn_PiTools/blob/main/shared.md) | Classes and functions used across cjn_PiTools
|
|
45
|
+
|
|
46
|
+
These drivers work with `RPi.GPIO` / `smbus2` and `lgpio` / `rgpio` apis. Using the `rgpio` api enables remote operation of GPIOs, I2C and SPI (PiOLED)
|
|
47
|
+
|
|
48
|
+
Tested on Python 3.13, Trixie (Linux 6.18.60+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.18.60-1+rpt1 (2026-11-03) aarch64 GNU/Linux)
|
|
49
|
+
|
|
50
|
+
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.
|
|
51
|
+
|
|
52
|
+
<br/>
|
|
53
|
+
|
|
54
|
+
## Installation and usage
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### If using only the RPi.GPIO and smbus2 (or lgpio) drivers (not rgpio):
|
|
58
|
+
|
|
59
|
+
pip install cjn_PiTools
|
|
60
|
+
|
|
61
|
+
- lgpio is pulled from PyPI by this install. If that fails see the official install instructions.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### If using the rgpio driver:
|
|
65
|
+
|
|
66
|
+
There is no downside to using rgpio, other than a bit more setup complexity.
|
|
67
|
+
|
|
68
|
+
`rgpio` is required for the `rgpio_shared_gpios` module to own GPIO pins and share them across tool script processes (not possible with `smbus` or `lgpio`).
|
|
69
|
+
These modules are dependent on `rgpio_shared_gpios` (thus `rgpio`):
|
|
70
|
+
|
|
71
|
+
- `initW1buses` - only if GPIOs need to be sequenced before discovering `DS18B20` devices _and_ `Use_rgpio_shared_gpios` is set True in the config file
|
|
72
|
+
- `PiBlinky` - only if more than one process needs access to the same LED(s)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
`rgpio` also optionally enables a tool script to run on one machine and access GPIO resources on another machine via a socket interface.
|
|
76
|
+
These file are enabled for rgpio remote access:
|
|
77
|
+
|
|
78
|
+
- PCA9548.py - Provides a CLI for setting/getting the port select register on local or remote PCA9548 chips
|
|
79
|
+
- PCA9548-demo.py
|
|
80
|
+
- PiBlinky-demo.py
|
|
81
|
+
- shared-demo.py
|
|
82
|
+
- SHT3x-demo.py
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
To install the rgpiod daemon:
|
|
86
|
+
|
|
87
|
+
apt install rgpiod
|
|
88
|
+
|
|
89
|
+
Here's a systemd service file for starting rgpiod at boot, if needed (the above apt install may install a rgpiod.service file):
|
|
90
|
+
|
|
91
|
+
[Unit]
|
|
92
|
+
Description= Remote GPIO Daemon
|
|
93
|
+
After= network.target
|
|
94
|
+
|
|
95
|
+
[Service]
|
|
96
|
+
Type=simple
|
|
97
|
+
EnvironmentFile= -/etc/default/rgpiod
|
|
98
|
+
ExecStart= /usr/bin/rgpiod -c ${DAEMON_CONF} -w ${DAEMON_WORK} ${DAEMON_OPTS}
|
|
99
|
+
TimeoutStopSec= 20
|
|
100
|
+
|
|
101
|
+
[Install]
|
|
102
|
+
WantedBy= multi-user.target
|
|
103
|
+
|
|
104
|
+
If you wish to allow remote access, enable it in the rgpiod configuration
|
|
105
|
+
|
|
106
|
+
Edit /etc/default/rgpiod:
|
|
107
|
+
Comment out the line DAEMON_OPTS="-l"
|
|
108
|
+
Set up the DAEMON_OPTS="-x" permits and users features, as needed
|
|
109
|
+
|
|
110
|
+
Restart the rgpiod daemon
|
|
111
|
+
|
|
112
|
+
sudo systemctl restart rgpiod
|
|
113
|
+
|
|
114
|
+
Finally, install `cjn_PiTools` with rgpio support:
|
|
115
|
+
|
|
116
|
+
pip install cjn_PiTools[rgpio]
|
|
117
|
+
|
|
118
|
+
<br/>
|
|
119
|
+
|
|
120
|
+
## Key changes since the prior major public release (1.2.2)
|
|
121
|
+
|
|
122
|
+
V2.0 Changes
|
|
123
|
+
- Upgrade to Trixie and rgpio/lgpio (pigpio removed)
|
|
124
|
+
- Expanded i2c methods and reworked all I2C-based modules
|
|
125
|
+
- Added rgpio_shared_gpios to provide a gpio sharing workaround for the kernel enforcement of single process access
|
|
126
|
+
- Reworked initW1buses, enabling non-root access for all DS18B20 api
|
|
127
|
+
|
|
128
|
+
A fundamental change in more recent kernels is that GPIOs can be _claimed_ and by only one process at a time. This plays havoc in having more than one tool script using PiBlinky and/or receiving notifications of button pushes, for example. The provided solution is via the `rgpio_shared_gpios` module, which, coordinating with rgpiod, takes ownership of specified GPIOs and shares them with multiple tool scripts. Note that I2C and SPI ports don't have the same single-owner requirement, it seems.
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
<br/>
|
|
132
|
+
|
|
133
|
+
## Revision history
|
|
134
|
+
- 2.0 261127 - Upgrade to Trixie and rgpio/lgpio (pigpio removed), expanded i2c methods, rgpio_shared_gpios, rework initW1buses
|
|
135
|
+
- 1.2.2 260828 - Corrected PiOLED logging of IPC handle names
|
|
136
|
+
- 1.2.1 260526
|
|
137
|
+
- HTU21D dummy user reg reads for measurement reads stability
|
|
138
|
+
- PCA9548 monitor_ch
|
|
139
|
+
- ADC121C read_conversion_result force_address switch added
|
|
140
|
+
- PiOLED tweaks
|
|
141
|
+
- HTU21D init changed do_soft_reset > do_reset, consistent with SHT3x
|
|
142
|
+
- 1.2 260506
|
|
143
|
+
- PiOLED uses shared memory, changed from display_file - cjnfuncs 3.2 dependency
|
|
144
|
+
- PiOLED add toolname to pioled_display_driver pioled_shm_lock and pioled_go_flag .get_lock() calls
|
|
145
|
+
- PiOLED taillog command
|
|
146
|
+
- Debug logging of MCP23008 set_register() and set_bits() values
|
|
147
|
+
- 1.1.1 260401 - pyproject.toml cleanup, keywords
|
|
148
|
+
- 1.1 260401 - Added ADC121C, HTU21D, MCP23008, PCA9548, and SHT3x drivers
|
|
149
|
+
- 1.0 260207 - New. Bundled PiBlinky, PiOLED, initW1buses, and DS18B20 modules
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# cjn_PiTools - A collection of modules for Raspberry Pi projects
|
|
2
|
+
|
|
3
|
+
## cjn_PiTools is comprised of several modules (follow links to respective documentation)
|
|
4
|
+
|
|
5
|
+
NOTE: These links point to the github repo since relative links to other .md files do not work on PyPI.
|
|
6
|
+
|
|
7
|
+
Module | Description/Purpose
|
|
8
|
+
--|--
|
|
9
|
+
[PiBlinky](https://github.com/cjnaz/cjn_PiTools/blob/main/PiBlinky.md) | A multiple threaded LED driver for Raspberry Pi
|
|
10
|
+
[rgpio_shared_gpios](https://github.com/cjnaz/cjn_PiTools/blob/main/rgpio_shared_gpios.md) | Central owner of GPIO pins for sharing across tool scripts
|
|
11
|
+
[PiOLED](https://github.com/cjnaz/cjn_PiTools/blob/main/PiOLED.md) | Display multi-line messages on a shared Raspberry Pi connected OLED display
|
|
12
|
+
[DS18B20](https://github.com/cjnaz/cjn_PiTools/blob/main/DS18B20.md) | DS18B20 temperature sensor library using the w1_therm kernel driver
|
|
13
|
+
[initW1buses](https://github.com/cjnaz/cjn_PiTools/blob/main/initW1buses.md) | Initialize the W1 buses and set write permission on found therm_bulk_read file(s)
|
|
14
|
+
[ADC121C](https://github.com/cjnaz/cjn_PiTools/blob/main/ADC121C.md) | ADC121C* 12-bit ADC library for Raspberry Pi
|
|
15
|
+
[SHT3x](https://github.com/cjnaz/cjn_PiTools/blob/main/SHT3x.md) | SHT3x Temperature/RH sensor library for Raspberry Pi
|
|
16
|
+
[HTU21D](https://github.com/cjnaz/cjn_PiTools/blob/main/HTU21D.md) | HTU21D Temperature/RH sensor library for Raspberry Pi
|
|
17
|
+
[MCP23008](https://github.com/cjnaz/cjn_PiTools/blob/main/MCP23008.md) | MCP23008 8-Bit I/O Expander library for Raspberry Pi
|
|
18
|
+
[PCA9548](https://github.com/cjnaz/cjn_PiTools/blob/main/PCA9548.md) | PCA9548A/TCA9548A I2C port expander library for Raspberry Pi
|
|
19
|
+
[shared](https://github.com/cjnaz/cjn_PiTools/blob/main/shared.md) | Classes and functions used across cjn_PiTools
|
|
20
|
+
|
|
21
|
+
These drivers work with `RPi.GPIO` / `smbus2` and `lgpio` / `rgpio` apis. Using the `rgpio` api enables remote operation of GPIOs, I2C and SPI (PiOLED)
|
|
22
|
+
|
|
23
|
+
Tested on Python 3.13, Trixie (Linux 6.18.60+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.18.60-1+rpt1 (2026-11-03) aarch64 GNU/Linux)
|
|
24
|
+
|
|
25
|
+
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.
|
|
26
|
+
|
|
27
|
+
<br/>
|
|
28
|
+
|
|
29
|
+
## Installation and usage
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### If using only the RPi.GPIO and smbus2 (or lgpio) drivers (not rgpio):
|
|
33
|
+
|
|
34
|
+
pip install cjn_PiTools
|
|
35
|
+
|
|
36
|
+
- lgpio is pulled from PyPI by this install. If that fails see the official install instructions.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### If using the rgpio driver:
|
|
40
|
+
|
|
41
|
+
There is no downside to using rgpio, other than a bit more setup complexity.
|
|
42
|
+
|
|
43
|
+
`rgpio` is required for the `rgpio_shared_gpios` module to own GPIO pins and share them across tool script processes (not possible with `smbus` or `lgpio`).
|
|
44
|
+
These modules are dependent on `rgpio_shared_gpios` (thus `rgpio`):
|
|
45
|
+
|
|
46
|
+
- `initW1buses` - only if GPIOs need to be sequenced before discovering `DS18B20` devices _and_ `Use_rgpio_shared_gpios` is set True in the config file
|
|
47
|
+
- `PiBlinky` - only if more than one process needs access to the same LED(s)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
`rgpio` also optionally enables a tool script to run on one machine and access GPIO resources on another machine via a socket interface.
|
|
51
|
+
These file are enabled for rgpio remote access:
|
|
52
|
+
|
|
53
|
+
- PCA9548.py - Provides a CLI for setting/getting the port select register on local or remote PCA9548 chips
|
|
54
|
+
- PCA9548-demo.py
|
|
55
|
+
- PiBlinky-demo.py
|
|
56
|
+
- shared-demo.py
|
|
57
|
+
- SHT3x-demo.py
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
To install the rgpiod daemon:
|
|
61
|
+
|
|
62
|
+
apt install rgpiod
|
|
63
|
+
|
|
64
|
+
Here's a systemd service file for starting rgpiod at boot, if needed (the above apt install may install a rgpiod.service file):
|
|
65
|
+
|
|
66
|
+
[Unit]
|
|
67
|
+
Description= Remote GPIO Daemon
|
|
68
|
+
After= network.target
|
|
69
|
+
|
|
70
|
+
[Service]
|
|
71
|
+
Type=simple
|
|
72
|
+
EnvironmentFile= -/etc/default/rgpiod
|
|
73
|
+
ExecStart= /usr/bin/rgpiod -c ${DAEMON_CONF} -w ${DAEMON_WORK} ${DAEMON_OPTS}
|
|
74
|
+
TimeoutStopSec= 20
|
|
75
|
+
|
|
76
|
+
[Install]
|
|
77
|
+
WantedBy= multi-user.target
|
|
78
|
+
|
|
79
|
+
If you wish to allow remote access, enable it in the rgpiod configuration
|
|
80
|
+
|
|
81
|
+
Edit /etc/default/rgpiod:
|
|
82
|
+
Comment out the line DAEMON_OPTS="-l"
|
|
83
|
+
Set up the DAEMON_OPTS="-x" permits and users features, as needed
|
|
84
|
+
|
|
85
|
+
Restart the rgpiod daemon
|
|
86
|
+
|
|
87
|
+
sudo systemctl restart rgpiod
|
|
88
|
+
|
|
89
|
+
Finally, install `cjn_PiTools` with rgpio support:
|
|
90
|
+
|
|
91
|
+
pip install cjn_PiTools[rgpio]
|
|
92
|
+
|
|
93
|
+
<br/>
|
|
94
|
+
|
|
95
|
+
## Key changes since the prior major public release (1.2.2)
|
|
96
|
+
|
|
97
|
+
V2.0 Changes
|
|
98
|
+
- Upgrade to Trixie and rgpio/lgpio (pigpio removed)
|
|
99
|
+
- Expanded i2c methods and reworked all I2C-based modules
|
|
100
|
+
- Added rgpio_shared_gpios to provide a gpio sharing workaround for the kernel enforcement of single process access
|
|
101
|
+
- Reworked initW1buses, enabling non-root access for all DS18B20 api
|
|
102
|
+
|
|
103
|
+
A fundamental change in more recent kernels is that GPIOs can be _claimed_ and by only one process at a time. This plays havoc in having more than one tool script using PiBlinky and/or receiving notifications of button pushes, for example. The provided solution is via the `rgpio_shared_gpios` module, which, coordinating with rgpiod, takes ownership of specified GPIOs and shares them with multiple tool scripts. Note that I2C and SPI ports don't have the same single-owner requirement, it seems.
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<br/>
|
|
107
|
+
|
|
108
|
+
## Revision history
|
|
109
|
+
- 2.0 261127 - Upgrade to Trixie and rgpio/lgpio (pigpio removed), expanded i2c methods, rgpio_shared_gpios, rework initW1buses
|
|
110
|
+
- 1.2.2 260828 - Corrected PiOLED logging of IPC handle names
|
|
111
|
+
- 1.2.1 260526
|
|
112
|
+
- HTU21D dummy user reg reads for measurement reads stability
|
|
113
|
+
- PCA9548 monitor_ch
|
|
114
|
+
- ADC121C read_conversion_result force_address switch added
|
|
115
|
+
- PiOLED tweaks
|
|
116
|
+
- HTU21D init changed do_soft_reset > do_reset, consistent with SHT3x
|
|
117
|
+
- 1.2 260506
|
|
118
|
+
- PiOLED uses shared memory, changed from display_file - cjnfuncs 3.2 dependency
|
|
119
|
+
- PiOLED add toolname to pioled_display_driver pioled_shm_lock and pioled_go_flag .get_lock() calls
|
|
120
|
+
- PiOLED taillog command
|
|
121
|
+
- Debug logging of MCP23008 set_register() and set_bits() values
|
|
122
|
+
- 1.1.1 260401 - pyproject.toml cleanup, keywords
|
|
123
|
+
- 1.1 260401 - Added ADC121C, HTU21D, MCP23008, PCA9548, and SHT3x drivers
|
|
124
|
+
- 1.0 260207 - New. Bundled PiBlinky, PiOLED, initW1buses, and DS18B20 modules
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = 'cjn_PiTools'
|
|
3
|
-
version = "
|
|
3
|
+
version = "2.0"
|
|
4
|
+
# 2.0 261127 Release - Upgrade to Trixie and rgpio/lgpio (pigpio removed), expanded i2c methods, rgpio_shared_gpios, rework initW1buses
|
|
5
|
+
# 1.2.3 - Debug log from MCP23008.read_reg
|
|
4
6
|
# 1.2.2 - Corrected PiOLED logging of IPC handle names, missing crc dependency
|
|
5
7
|
# 1.2.1
|
|
6
8
|
# HTU21D dummy user reg reads for measurement reads stability
|
|
@@ -24,14 +26,16 @@ readme = "README.md"
|
|
|
24
26
|
requires-python = ">=3.9"
|
|
25
27
|
authors = [ {name = "Chris Nelson", email = "github@cjnaz.com"} ]
|
|
26
28
|
license = "MIT"
|
|
27
|
-
dependencies = [
|
|
28
|
-
'cjnfuncs
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
29
|
+
dependencies = [ # sudo apt install python3_lgpio
|
|
30
|
+
'cjnfuncs >= 3.2.4',
|
|
31
|
+
'lgpio >= 0.2.2.0',
|
|
32
|
+
'luma.oled >= 3.14',
|
|
33
|
+
'luma.core[gpio] >= 2.5.1',
|
|
34
|
+
'pillow >= 13.0.0',
|
|
35
|
+
'spidev >= 3.8',
|
|
36
|
+
'smbus2 >= 0.6.1',
|
|
37
|
+
'crc >= 8.0.0', # SHT3x
|
|
38
|
+
'RPi.GPIO >= 0.7.1', # Luma / PiOLED, initW1buses
|
|
35
39
|
]
|
|
36
40
|
keywords = ['cjnaz', 'cjnfuncs', 'Raspberry', 'Raspberry Pi', 'RPi',
|
|
37
41
|
'luma', 'luma.oled', 'OLED',
|
|
@@ -41,7 +45,8 @@ keywords = ['cjnaz', 'cjnfuncs', 'Raspberry', 'Raspberry Pi', 'RPi',
|
|
|
41
45
|
'HTU21D',
|
|
42
46
|
'MCP23008',
|
|
43
47
|
'PCA9548', 'TCA9548', 'PCA9548A', 'TCA9548A',
|
|
44
|
-
'SHT3', 'SHT30', 'SHT31', 'SHT35'
|
|
48
|
+
'SHT3', 'SHT30', 'SHT31', 'SHT35',
|
|
49
|
+
'Trixie', 'rgpio', 'lgpio', 'smbus', 'smbus2'
|
|
45
50
|
]
|
|
46
51
|
classifiers = [ # https://pypi.org/classifiers/
|
|
47
52
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
@@ -49,8 +54,8 @@ classifiers = [ # https://pypi.org/classifiers/
|
|
|
49
54
|
|
|
50
55
|
|
|
51
56
|
[project.optional-dependencies]
|
|
52
|
-
|
|
53
|
-
"
|
|
57
|
+
rgpio = [
|
|
58
|
+
"rgpio>=0.2.2.0",
|
|
54
59
|
]
|
|
55
60
|
|
|
56
61
|
|
|
@@ -60,10 +65,11 @@ build-backend = "setuptools.build_meta"
|
|
|
60
65
|
|
|
61
66
|
|
|
62
67
|
[project.scripts]
|
|
63
|
-
PiOLED =
|
|
64
|
-
DS18B20 =
|
|
65
|
-
initW1buses =
|
|
66
|
-
PCA9548 =
|
|
68
|
+
PiOLED = 'cjn_PiTools.PiOLED:cli'
|
|
69
|
+
DS18B20 = 'cjn_PiTools.DS18B20:cli'
|
|
70
|
+
initW1buses = 'cjn_PiTools.initW1buses:cli'
|
|
71
|
+
PCA9548 = 'cjn_PiTools.PCA9548:cli'
|
|
72
|
+
rgpio_shared_gpios= 'cjn_PiTools.rgpio_shared_gpios:cli'
|
|
67
73
|
|
|
68
74
|
|
|
69
75
|
[project.urls]
|