Giter Club home page Giter Club logo

adafruit_circuitpython_pm25's Introduction

Introduction

Documentation Status Discord Build Status Code Style: Black

CircuitPython library for PM2.5 Air Quality Sensors

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Installing from PyPI

Note

This library is not available on PyPI yet. Install documentation is included as a standard element. Stay tuned for PyPI availability!

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-pm25

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-pm25

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-pm25

Usage Example

For example usage, see examples/pm25_simpletest.py

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

adafruit_circuitpython_pm25's People

Contributors

dglaude avatar evaherrada avatar foamyguy avatar gamblor21 avatar jposada202020 avatar kattni avatar ladyada avatar process1183 avatar tannewt avatar tekktrik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_circuitpython_pm25's Issues

Library fails on reading the Adafruit PMSA003I

The setup I tested on is:
HW: balenaFin v1.1
OS: Raspbian GNU/Linux 9 (stretch)
SW: Python 3.5.3

The provided example code was failing with:

Traceback (most recent call last):
  File "/home/pi/Desktop/pm25_new/pm25_recreate.py", line 41, in <module>
    pm25 = adafruit_pm25.PM25_I2C(i2c, reset_pin)
  File "/usr/local/lib/python3.5/dist-packages/adafruit_pm25.py", line 145, in __init__
    raise RuntimeError("Unable to find PM2.5 device")
RuntimeError: Unable to find PM2.5 device

The working modified library is here:
adafruit_pm25.py.txt

DisplayIO Example Wanted

Add a Basic DisplayIO Based Example

We would like to have a basic displayio example for this library. The example should be written for microcontrollers with a built-in display. At a minimum it should show a Label on the display and update it with live readings from the sensor.

The example should not be overly complex, it's intended to be a good starting point for displayio based projects that utilize this sensor library. Try to keep all visual content as near to the top left corner as possible in order to best fascilitate devices with small built-in display resolutions.

The new example should follow the naming convention examples/libraryname_displayio_simpletest.py with "libraryname" being replaced by the actual name of this library.

You can find an example of a Pull Request that adds this kind of example here: adafruit/Adafruit_CircuitPython_BME680#72

We have a guide that covers the process of contributing with git and github: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github

If you're interested in contributing but need additional help, or just want to say hi, feel free to join the Discord server to ask questions: https://adafru.it/discord

Add explanation of "standard" and "environmental" sensor values to docs

The library returns two sets of concentrations: "standard" and "environmental" but the docs don't explain the difference between them. After some searching, I figured out that "standard" refers to what the concentration would be at standard pressure (i.e. sea level) whereas "environmental" refers to measured values that depend on ambient pressure. It would be nice to add this info to the docs.

(There's a discussion about this here: https://publiclab.org/questions/samr/04-07-2019/how-to-interpret-pms5003-sensor-values)

RuntimeError: Invalid PM2.5 header

Following this guide https://learn.adafruit.com/pm25-air-quality-sensor/python-and-circuitpython with minor adjustments I keep running into this error...
"Traceback (most recent call last):
File "code.py", line 190, in
File "/lib/adafruit_pm25/init.py", line 83, in read
RuntimeError: Invalid PM2.5 header"

I am using a Teensy4.1 instead of the Feather to control the WiFi Module, Temp sensor, and PM25 Sensor. I am using the UART connection method. What will happen is it will run for a random amount of time, sometimes 5 hours, sometimes 30 minutes before running into this error. I'm unsure how to fix the problem without just looping a reset but that does not solve the problem.

Thanks,
W

Missing Type Annotations

There are missing type annotations for some functions in this library.

The typing module does not exist on CircuitPython devices so the import needs to be wrapped in try/except to catch the error for missing import. There is an example of how that is done here:

try:
    from typing import List, Tuple
except ImportError:
    pass

Once imported the typing annotations for the argument type(s), and return type(s) can be added to the function signature. Here is an example of a function that has had this done already:

def wrap_text_to_pixels(
    string: str, max_width: int, font=None, indent0: str = "", indent1: str = ""
) -> List[str]:

If you are new to Git or Github we have a guide about contributing to our projects here: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github

There is also a guide that covers our CI utilities and how to run them locally to ensure they will pass in Github Actions here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code In particular the pages: Sharing docs on ReadTheDocs and Check your code with pre-commit contain the tools to install and commands to run locally to run the checks.

If you are attempting to resolve this issue and need help, you can post a comment on this issue and tag both @FoamyGuy and @kattni or reach out to us on Discord: https://adafru.it/discord in the #circuitpython-dev channel.

The following locations are reported by mypy to be missing type annotations:

  • adafruit_pm25/uart.py:76
  • adafruit_pm25/i2c.py:80

UART fails to operate with PMS5003

Thanks for this library! Its works great with the I2C PMSA003i device I bought from Adafruit a few weeks ago. :)

Unfortunately, I was having trouble getting this library to work with a PMS5003 connected over UART using the Pimoroni Envirio+ hat on a Pi Zero. It looks like this is being caused by two different but somewhat related problems.

In one case, the PM2.5 sensor was set to "passive" mode when using another library or its default on power-on may actually be to run in "passive" mode. In this case _read_into_buffer() always times out.

In the other case, it looks like _read_into_buffer() is sometimes misreading the UART data stream coming in, leading to "Invalid checksum" errors when read() tries to parse the buffer's data after an otherwise successful _read_into_buffer().

Install on Raspberry pi 3B+ running Manjaro linux fails

It looks like it's failing at RPi.GPIO, I have tried with and without the wheel package installed.

[steven@RPI4 ~]$ sudo pip install adafruit-circuitpython-pm25
Collecting adafruit-circuitpython-pm25
  Using cached adafruit-circuitpython-pm25-2.1.2.tar.gz (27 kB)
Collecting Adafruit-Blinka
  Using cached Adafruit-Blinka-6.3.0.tar.gz (118 kB)
Requirement already satisfied: rpi_ws281x>=4.0.0 in /usr/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-circuitpython-pm25) (4.2.5)
Requirement already satisfied: sysv_ipc>=1.1.0 in /usr/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-circuitpython-pm25) (1.1.0)
Collecting adafruit-circuitpython-busdevice
  Using cached adafruit-circuitpython-busdevice-5.0.5.tar.gz (27 kB)
Collecting Adafruit-PlatformDetect>=3.1.0
  Using cached Adafruit-PlatformDetect-3.2.0.tar.gz (29 kB)
Collecting Adafruit-PureIO>=1.1.7
  Using cached Adafruit_PureIO-1.1.8.tar.gz (26 kB)
Collecting pyftdi>=0.40.0
  Using cached pyftdi-0.52.9-py3-none-any.whl (139 kB)
Requirement already satisfied: pyserial>=3.0 in /usr/lib/python3.9/site-packages (from pyftdi>=0.40.0->Adafruit-Blinka->adafruit-circuitpython-pm25) (3.5)
Requirement already satisfied: pyusb>=1.0.0 in /usr/lib/python3.9/site-packages (from pyftdi>=0.40.0->Adafruit-Blinka->adafruit-circuitpython-pm25) (1.1.1)
Collecting RPi.GPIO
  Using cached RPi.GPIO-0.7.0.tar.gz (30 kB)
Building wheels for collected packages: adafruit-circuitpython-pm25, Adafruit-Blinka, adafruit-circuitpython-busdevice, Adafruit-PlatformDetect, Adafruit-PureIO, RPi.GPIO
  Building wheel for adafruit-circuitpython-pm25 (setup.py) ... done
  Created wheel for adafruit-circuitpython-pm25: filename=adafruit_circuitpython_pm25-2.1.2-py3-none-any.whl size=6329 sha256=f10978fcf351272f775b64c1b563cc59045d789898f42389069175446e9749da
  Stored in directory: /root/.cache/pip/wheels/e6/69/97/2e21ec3853823deda563c99b5dca02e240051f16b2daac0a92
  Building wheel for Adafruit-Blinka (setup.py) ... done
  Created wheel for Adafruit-Blinka: filename=Adafruit_Blinka-6.3.0-py3-none-any.whl size=149317 sha256=ae6202ece801703bf167e8da074ac7a6f3344f1460f504594813e7fabc16372b
  Stored in directory: /root/.cache/pip/wheels/3e/3c/2b/6c67a9ce7af003c326b57e385225c50f3d521aa2323cd6ba41
  Building wheel for adafruit-circuitpython-busdevice (setup.py) ... done
  Created wheel for adafruit-circuitpython-busdevice: filename=adafruit_circuitpython_busdevice-5.0.5-py3-none-any.whl size=6551 sha256=f2fdaf01fef1a5dbd00f9cd7ac658654ad321a7a058a661125c63a9a536d46fe
  Stored in directory: /root/.cache/pip/wheels/cd/04/ff/861162640ee3a45e041dd4a1757c7c0e68589ac12179a498a0
  Building wheel for Adafruit-PlatformDetect (setup.py) ... done
  Created wheel for Adafruit-PlatformDetect: filename=Adafruit_PlatformDetect-3.2.0-py3-none-any.whl size=17560 sha256=b452257c443c20667c1c4427cf5130205f58a76235d8a7f3bc129615a0a7536a
  Stored in directory: /root/.cache/pip/wheels/c1/23/0e/1e32e548df2f4d2184f90042768dc7ee9fe2ebc37b85e864dc
  Building wheel for Adafruit-PureIO (setup.py) ... done
  Created wheel for Adafruit-PureIO: filename=Adafruit_PureIO-1.1.8-py3-none-any.whl size=11566 sha256=5a9eafd0c39066333260f6dc2ca2f71f14134f3253d54965060695978044f09c
  Stored in directory: /root/.cache/pip/wheels/e8/62/80/50c9bde8c708b9e37b221e3981120eb9b881f03bf0ebcd6fea
  Building wheel for RPi.GPIO (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-1r_bb07z
       cwd: /tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/
  Complete output (102 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-3.9
  creating build/lib.linux-aarch64-3.9/RPi
  copying RPi/__init__.py -> build/lib.linux-aarch64-3.9/RPi
  creating build/lib.linux-aarch64-3.9/RPi/GPIO
  copying RPi/GPIO/__init__.py -> build/lib.linux-aarch64-3.9/RPi/GPIO
  running build_ext
  building 'RPi._GPIO' extension
  creating build/temp.linux-aarch64-3.9
  creating build/temp.linux-aarch64-3.9/source
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/c_gpio.c -o build/temp.linux-aarch64-3.9/source/c_gpio.o
  source/c_gpio.c: In function ‘setup’:
  source/c_gpio.c:130:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    130 |     if ((uint32_t)gpio_mem % PAGE_SIZE)
        |         ^
  source/c_gpio.c:131:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    131 |         gpio_mem += PAGE_SIZE - ((uint32_t)gpio_mem % PAGE_SIZE);
        |                                  ^
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/common.c -o build/temp.linux-aarch64-3.9/source/common.o
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/constants.c -o build/temp.linux-aarch64-3.9/source/constants.o
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/cpuinfo.c -o build/temp.linux-aarch64-3.9/source/cpuinfo.o
  source/cpuinfo.c: In function ‘get_rpi_info’:
  source/cpuinfo.c:139:28: warning: format ‘%llx’ expects argument of type ‘long long unsigned int *’, but argument 3 has type ‘uint64_t *’ {aka ‘long unsigned int *’} [-Wformat=]
    139 |       sscanf(revision, "%llx", &rev);
        |                         ~~~^   ~~~~
        |                            |   |
        |                            |   uint64_t * {aka long unsigned int *}
        |                            long long unsigned int *
        |                         %lx
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/event_gpio.c -o build/temp.linux-aarch64-3.9/source/event_gpio.o
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/py_gpio.c -o build/temp.linux-aarch64-3.9/source/py_gpio.o
  source/py_gpio.c: In function ‘PyInit__GPIO’:
  source/py_gpio.c:1046:4: warning: ‘PyEval_ThreadsInitialized’ is deprecated [-Wdeprecated-declarations]
   1046 |    if (!PyEval_ThreadsInitialized())
        |    ^~
  In file included from /usr/include/python3.9/Python.h:145,
                   from source/py_gpio.c:23:
  /usr/include/python3.9/ceval.h:129:36: note: declared here
    129 | Py_DEPRECATED(3.9) PyAPI_FUNC(int) PyEval_ThreadsInitialized(void);
        |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
  source/py_gpio.c:1047:7: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
   1047 |       PyEval_InitThreads();
        |       ^~~~~~~~~~~~~~~~~~
  In file included from /usr/include/python3.9/Python.h:145,
                   from source/py_gpio.c:23:
  /usr/include/python3.9/ceval.h:130:37: note: declared here
    130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
        |                                     ^~~~~~~~~~~~~~~~~~
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/py_pwm.c -o build/temp.linux-aarch64-3.9/source/py_pwm.o
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/soft_pwm.c -o build/temp.linux-aarch64-3.9/source/soft_pwm.o
  gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fno-semantic-interposition -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now build/temp.linux-aarch64-3.9/source/c_gpio.o build/temp.linux-aarch64-3.9/source/common.o build/temp.linux-aarch64-3.9/source/constants.o build/temp.linux-aarch64-3.9/source/cpuinfo.o build/temp.linux-aarch64-3.9/source/event_gpio.o build/temp.linux-aarch64-3.9/source/py_gpio.o build/temp.linux-aarch64-3.9/source/py_pwm.o build/temp.linux-aarch64-3.9/source/soft_pwm.o -L/usr/lib -o build/lib.linux-aarch64-3.9/RPi/_GPIO.cpython-39-aarch64-linux-gnu.so
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:41: multiple definition of `module_setup'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:41: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:40: multiple definition of `setup_error'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:40: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:39: multiple definition of `rpiinfo'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:39: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:38: multiple definition of `gpio_direction'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:38: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:37: multiple definition of `pin_to_gpio'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:37: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:36: multiple definition of `pin_to_gpio_rev3'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:36: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:35: multiple definition of `pin_to_gpio_rev2'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:35: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:34: multiple definition of `pin_to_gpio_rev1'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:34: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:33: multiple definition of `gpio_mode'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:33: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:33: multiple definition of `gpio_mode'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:33: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:40: multiple definition of `setup_error'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:40: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:39: multiple definition of `rpiinfo'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:39: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:38: multiple definition of `gpio_direction'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:38: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:37: multiple definition of `pin_to_gpio'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:37: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:41: multiple definition of `module_setup'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:41: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:36: multiple definition of `pin_to_gpio_rev3'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:36: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:34: multiple definition of `pin_to_gpio_rev1'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:34: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:35: multiple definition of `pin_to_gpio_rev2'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:35: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:42: multiple definition of `both_edge'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:42: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:41: multiple definition of `falling_edge'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:41: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:40: multiple definition of `rising_edge'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:40: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:39: multiple definition of `pud_down'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:39: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:38: multiple definition of `pud_up'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:38: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:37: multiple definition of `pud_off'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:37: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:36: multiple definition of `bcm'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:36: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:35: multiple definition of `board'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:35: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:34: multiple definition of `unknown'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:34: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:33: multiple definition of `spi'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:33: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:32: multiple definition of `i2c'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:32: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:31: multiple definition of `serial'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:31: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:30: multiple definition of `pwm'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:30: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:29: multiple definition of `output'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:29: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:28: multiple definition of `input'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:28: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:27: multiple definition of `low'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:27: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:26: multiple definition of `high'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:26: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:38: multiple definition of `gpio_direction'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:38: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/py_pwm.h:23: multiple definition of `PWMType'; build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/py_pwm.h:23: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:41: multiple definition of `module_setup'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:41: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:40: multiple definition of `setup_error'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:40: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:39: multiple definition of `rpiinfo'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:39: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:37: multiple definition of `pin_to_gpio'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:37: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:36: multiple definition of `pin_to_gpio_rev3'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:36: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:35: multiple definition of `pin_to_gpio_rev2'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:35: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:34: multiple definition of `pin_to_gpio_rev1'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:34: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:33: multiple definition of `gpio_mode'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:33: first defined here
  /usr/bin/ld: build/temp.linux-aarch64-3.9/source/soft_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/soft_pwm.c:28: multiple definition of `threads'; build/temp.linux-aarch64-3.9/source/event_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/event_gpio.c:60: first defined here
  collect2: error: ld returned 1 exit status
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for RPi.GPIO
  Running setup.py clean for RPi.GPIO
Successfully built adafruit-circuitpython-pm25 Adafruit-Blinka adafruit-circuitpython-busdevice Adafruit-PlatformDetect Adafruit-PureIO
Failed to build RPi.GPIO
Installing collected packages: RPi.GPIO, pyftdi, Adafruit-PureIO, Adafruit-PlatformDetect, Adafruit-Blinka, adafruit-circuitpython-busdevice, adafruit-circuitpython-pm25
    Running setup.py install for RPi.GPIO ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-bpq3au1x/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.9/RPi.GPIO
         cwd: /tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/
    Complete output (102 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-aarch64-3.9
    creating build/lib.linux-aarch64-3.9/RPi
    copying RPi/__init__.py -> build/lib.linux-aarch64-3.9/RPi
    creating build/lib.linux-aarch64-3.9/RPi/GPIO
    copying RPi/GPIO/__init__.py -> build/lib.linux-aarch64-3.9/RPi/GPIO
    running build_ext
    building 'RPi._GPIO' extension
    creating build/temp.linux-aarch64-3.9
    creating build/temp.linux-aarch64-3.9/source
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/c_gpio.c -o build/temp.linux-aarch64-3.9/source/c_gpio.o
    source/c_gpio.c: In function ‘setup’:
    source/c_gpio.c:130:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      130 |     if ((uint32_t)gpio_mem % PAGE_SIZE)
          |         ^
    source/c_gpio.c:131:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      131 |         gpio_mem += PAGE_SIZE - ((uint32_t)gpio_mem % PAGE_SIZE);
          |                                  ^
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/common.c -o build/temp.linux-aarch64-3.9/source/common.o
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/constants.c -o build/temp.linux-aarch64-3.9/source/constants.o
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/cpuinfo.c -o build/temp.linux-aarch64-3.9/source/cpuinfo.o
    source/cpuinfo.c: In function ‘get_rpi_info’:
    source/cpuinfo.c:139:28: warning: format ‘%llx’ expects argument of type ‘long long unsigned int *’, but argument 3 has type ‘uint64_t *’ {aka ‘long unsigned int *’} [-Wformat=]
      139 |       sscanf(revision, "%llx", &rev);
          |                         ~~~^   ~~~~
          |                            |   |
          |                            |   uint64_t * {aka long unsigned int *}
          |                            long long unsigned int *
          |                         %lx
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/event_gpio.c -o build/temp.linux-aarch64-3.9/source/event_gpio.o
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/py_gpio.c -o build/temp.linux-aarch64-3.9/source/py_gpio.o
    source/py_gpio.c: In function ‘PyInit__GPIO’:
    source/py_gpio.c:1046:4: warning: ‘PyEval_ThreadsInitialized’ is deprecated [-Wdeprecated-declarations]
     1046 |    if (!PyEval_ThreadsInitialized())
          |    ^~
    In file included from /usr/include/python3.9/Python.h:145,
                     from source/py_gpio.c:23:
    /usr/include/python3.9/ceval.h:129:36: note: declared here
      129 | Py_DEPRECATED(3.9) PyAPI_FUNC(int) PyEval_ThreadsInitialized(void);
          |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
    source/py_gpio.c:1047:7: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
     1047 |       PyEval_InitThreads();
          |       ^~~~~~~~~~~~~~~~~~
    In file included from /usr/include/python3.9/Python.h:145,
                     from source/py_gpio.c:23:
    /usr/include/python3.9/ceval.h:130:37: note: declared here
      130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
          |                                     ^~~~~~~~~~~~~~~~~~
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/py_pwm.c -o build/temp.linux-aarch64-3.9/source/py_pwm.o
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv8-a -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv8-a -O3 -pipe -fno-plt -march=armv8-a -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c source/soft_pwm.c -o build/temp.linux-aarch64-3.9/source/soft_pwm.o
    gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fno-semantic-interposition -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now build/temp.linux-aarch64-3.9/source/c_gpio.o build/temp.linux-aarch64-3.9/source/common.o build/temp.linux-aarch64-3.9/source/constants.o build/temp.linux-aarch64-3.9/source/cpuinfo.o build/temp.linux-aarch64-3.9/source/event_gpio.o build/temp.linux-aarch64-3.9/source/py_gpio.o build/temp.linux-aarch64-3.9/source/py_pwm.o build/temp.linux-aarch64-3.9/source/soft_pwm.o -L/usr/lib -o build/lib.linux-aarch64-3.9/RPi/_GPIO.cpython-39-aarch64-linux-gnu.so
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:41: multiple definition of `module_setup'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:41: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:40: multiple definition of `setup_error'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:40: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:39: multiple definition of `rpiinfo'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:39: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:38: multiple definition of `gpio_direction'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:38: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:37: multiple definition of `pin_to_gpio'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:37: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:36: multiple definition of `pin_to_gpio_rev3'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:36: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:35: multiple definition of `pin_to_gpio_rev2'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:35: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:34: multiple definition of `pin_to_gpio_rev1'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:34: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:33: multiple definition of `gpio_mode'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:33: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:33: multiple definition of `gpio_mode'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:33: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:40: multiple definition of `setup_error'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:40: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:39: multiple definition of `rpiinfo'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:39: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:38: multiple definition of `gpio_direction'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:38: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:37: multiple definition of `pin_to_gpio'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:37: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:41: multiple definition of `module_setup'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:41: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:36: multiple definition of `pin_to_gpio_rev3'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:36: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:34: multiple definition of `pin_to_gpio_rev1'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:34: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:35: multiple definition of `pin_to_gpio_rev2'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:35: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:42: multiple definition of `both_edge'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:42: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:41: multiple definition of `falling_edge'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:41: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:40: multiple definition of `rising_edge'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:40: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:39: multiple definition of `pud_down'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:39: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:38: multiple definition of `pud_up'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:38: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:37: multiple definition of `pud_off'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:37: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:36: multiple definition of `bcm'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:36: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:35: multiple definition of `board'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:35: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:34: multiple definition of `unknown'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:34: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:33: multiple definition of `spi'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:33: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:32: multiple definition of `i2c'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:32: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:31: multiple definition of `serial'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:31: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:30: multiple definition of `pwm'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:30: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:29: multiple definition of `output'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:29: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:28: multiple definition of `input'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:28: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:27: multiple definition of `low'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:27: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:26: multiple definition of `high'; build/temp.linux-aarch64-3.9/source/constants.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/constants.h:26: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:38: multiple definition of `gpio_direction'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:38: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/py_pwm.h:23: multiple definition of `PWMType'; build/temp.linux-aarch64-3.9/source/py_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/py_pwm.h:23: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:41: multiple definition of `module_setup'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:41: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:40: multiple definition of `setup_error'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:40: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:39: multiple definition of `rpiinfo'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:39: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:37: multiple definition of `pin_to_gpio'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:37: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:36: multiple definition of `pin_to_gpio_rev3'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:36: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:35: multiple definition of `pin_to_gpio_rev2'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:35: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:34: multiple definition of `pin_to_gpio_rev1'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:34: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/py_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:33: multiple definition of `gpio_mode'; build/temp.linux-aarch64-3.9/source/common.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/common.h:33: first defined here
    /usr/bin/ld: build/temp.linux-aarch64-3.9/source/soft_pwm.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/soft_pwm.c:28: multiple definition of `threads'; build/temp.linux-aarch64-3.9/source/event_gpio.o:/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/source/event_gpio.c:60: first defined here
    collect2: error: ld returned 1 exit status
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ef6pvlnt/rpi-gpio_77fa2ef6a304408c801233c80ed1003a/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-bpq3au1x/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.9/RPi.GPIO Check the logs for full command output.

In serial, recover poorly from glitch/error/...

I tested this library with a serial sensor like this: https://www.adafruit.com/product/3686

Within one or two minutes, the code fail (mostly on if b != 0x42:) and does not seems to recover. Some tricks to empty the buffer, re-read or reset should be implemented for more reliability.

The code from the learn guide ( https://learn.adafruit.com/pm25-air-quality-sensor/python-and-circuitpython ) of the product behave much better, even when temporary removing the cable.

Here is the way it fail (and never seems to recover):

Concentration Units (standard)

PM 1.0: 10 PM2.5: 13 PM10: 13
Concentration Units (environmental)

PM 1.0: 10 PM2.5: 13 PM10: 13

Particles > 0.3um / 0.1L air: 1938
Particles > 0.5um / 0.1L air: 518
Particles > 1.0um / 0.1L air: 62
Particles > 2.5um / 0.1L air: 4
Particles > 5.0um / 0.1L air: 0
Particles > 10 um / 0.1L air: 0

Unable to read from sensor, retrying...
Unable to read from sensor, retrying...
Unable to read from sensor, retrying...

HEX printing to Console?

I'm running a BME680, PM25, and SCD41X, however i believe its the PM25 thats writing to console. (total guess).

I start my sensor script, which does a read from each of the sensors and I see all this being printed to console.
Is this something I inadvertantly turned on or is this a bug in the software somewhere?

Also hitting the checksum problem intermittently.
I'm unable to see anything that could explain the behavior.
Thanks,

$1D => ['0xa0', '0x0', '0x4c', '0xd4', '0xa0', '0x7b', '0xf2', '0x70', '0x4c', '0x35', '0x80', '0x0', '0x0', '0xac', '0xf5', '0x0', '0x4']
	$08 <= []
	$8C <= []
	$02 <= []
	$10 <= []
	$74 => ['0x8c']
	$8D <= []

The code looks like the following:

	def getPM25Data(self, t=datetime.now().strftime("%m/%d/%Y, %H:%M:%S")):
		try:
			aqdata = self.pm25.read()
			# Prepare the data row
			pm25_data = {
				"pm10_std": aqdata["pm10 standard"],
				"pm25_std": aqdata["pm25 standard"],
				"pm100_std": aqdata["pm100 standard"],
				"pm10_env": aqdata["pm10 env"],
				"pm25_env": aqdata["pm25 env"],
				"pm100_env": aqdata["pm100 env"],
				"part_gt_03um": aqdata["particles 03um"],
				"part_gt_05um": aqdata["particles 05um"],
				"part_gt_10um": aqdata["particles 10um"],
				"part_gt_25um": aqdata["particles 25um"],
				"part_gt_50um": aqdata["particles 50um"],
				"part_gt_100um": aqdata["particles 100um"]
			}

			return pm25_data
		except Exception as e:
			logger.error(f"Unable to read from PM25 sensor")

Non necessary import of I2C if using an UART sensor

When using the UART sensor, you don't need the adafruit_bus_device library.

However, the following line in the library import what is required for the I2C version:
from adafruit_bus_device.i2c_device import I2CDevice

No big deal, and I have no clue how to do things better because all my idea seems to be worse that current situation (like putting the import on the I2C side or separating the two).
Also I don't have the I2C version to test, so I could not really test a change on that side.

But it could be an improvement for user of UART sensor.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.