-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump gpiodevice version and update examples.
- Loading branch information
Showing
3 changed files
with
40 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,30 +14,46 @@ | |
# Configure the PMS5003 for Enviro+ | ||
# pins and ports may vary for your hardware! | ||
|
||
# Default, try to auto-detect platform | ||
# Default, assume Raspberry Pi compatible, running Raspberry Pi OS Bookworm | ||
pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600) | ||
|
||
# Raspberry Pi 4 (Raspberry Pi OS) | ||
# | ||
# GPIO22 and GPIO27 are enable and reset for Raspberry Pi 4 | ||
# use "raspi-config" to enable serial, or add | ||
# "dtoverlay=uart0" to /boot/config.txt | ||
# | ||
# pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600, pin_enable="GPIO22", pin_reset="GPIO27") | ||
|
||
# Raspberry Pi 5 (Raspberry Pi OS) | ||
# PIN15 and PIN13 are enable and reset for Raspberry Pi 5 | ||
# | ||
# GPIO22 and GPIO27 are enable and reset for Raspberry Pi 5 | ||
# On older versions of Bookworm these might be PIN15 and PIN13 | ||
# use "raspi-config" to enable serial, or add | ||
# "dtoverlay=uart0-pi5" to /boot/firmware/config.txt | ||
# pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600, pin_enable="PIN15", pin_reset="PIN13") | ||
# | ||
# pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600, pin_enable="GPIO22", pin_reset="GPIO27") | ||
|
||
# ROCK 5B | ||
# | ||
# Use "armbian-config" to enable rk3568-uart2-m0 | ||
# Disable console on ttyS2 with: | ||
# sudo systemctl stop [email protected] | ||
# sudo systemctl disable [email protected] | ||
# sudo systemctl mask [email protected] | ||
# add "console=display" to /boot/armbianEnv.txt | ||
# | ||
# pms5003 = PMS5003(device="/dev/ttyS2", baudrate=9600, pin_enable="PIN_15", pin_reset="PIN_13") | ||
|
||
# Other | ||
# | ||
# Use gpiod to request the pins you want, and pass those into PMS5003 as LineRequest, offset tuples. | ||
# | ||
# from pms5003 import OUTL, OUTH | ||
# from gpiod import Chip | ||
# lines = Chip.request_lines(consumer="PMS5003", config={22: OUTH, 27: OUTL}) | ||
# pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600, pin_enable=(lines, 22), pin_reset=(lines, 27)) | ||
|
||
try: | ||
while True: | ||
data = pms5003.read() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,30 +13,47 @@ | |
# Configure the PMS5003 for Enviro+ | ||
# pins and ports may vary for your hardware! | ||
|
||
# Default, try to auto-detect platform | ||
# Default, assume Raspberry Pi compatible, running Raspberry Pi OS Bookworm | ||
pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600) | ||
|
||
# Raspberry Pi 4 (Raspberry Pi OS) | ||
# | ||
# GPIO22 and GPIO27 are enable and reset for Raspberry Pi 4 | ||
# use "raspi-config" to enable serial, or add | ||
# "dtoverlay=uart0" to /boot/config.txt | ||
# | ||
# pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600, pin_enable="GPIO22", pin_reset="GPIO27") | ||
|
||
# Raspberry Pi 5 (Raspberry Pi OS) | ||
# PIN15 and PIN13 are enable and reset for Raspberry Pi 5 | ||
# | ||
# GPIO22 and GPIO27 are enable and reset for Raspberry Pi 5 | ||
# On older versions of Bookworm these might be PIN15 and PIN13 | ||
# use "raspi-config" to enable serial, or add | ||
# "dtoverlay=uart0-pi5" to /boot/firmware/config.txt | ||
# pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600, pin_enable="PIN15", pin_reset="PIN13") | ||
# | ||
# pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600, pin_enable="GPIO22", pin_reset="GPIO27") | ||
|
||
# ROCK 5B | ||
# | ||
# Use "armbian-config" to enable rk3568-uart2-m0 | ||
# Disable console on ttyS2 with: | ||
# sudo systemctl stop [email protected] | ||
# sudo systemctl disable [email protected] | ||
# sudo systemctl mask [email protected] | ||
# add "console=display" to /boot/armbianEnv.txt | ||
# | ||
# pms5003 = PMS5003(device="/dev/ttyS2", baudrate=9600, pin_enable="PIN_15", pin_reset="PIN_13") | ||
|
||
# Other | ||
# | ||
# Use gpiod to request the pins you want, and pass those into PMS5003 as LineRequest, offset tuples. | ||
# | ||
# from pms5003 import OUTL, OUTH | ||
# from gpiod import Chip | ||
# lines = Chip.request_lines(consumer="PMS5003", config={22: OUTH, 27: OUTL}) | ||
# pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600, pin_enable=(lines, 22), pin_reset=(lines, 27)) | ||
|
||
|
||
try: | ||
while True: | ||
data = pms5003.read() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ classifiers = [ | |
] | ||
dependencies = [ | ||
"gpiod", | ||
"gpiodevice", | ||
"gpiodevice>=0.0.4", | ||
"pyserial" | ||
] | ||
|
||
|