Adafruit Library - temperature monitoring AM2302

  • Hi,

    I am trying to monitor temperature with the Adafruit AM2302 sensor.

    The sensor is connected to my LibreELEC 10.0.2 RPi4. For monitoring i setup icinga2 with check_by_ssh. This works for raspbian10/11.

    Testing temperature read AdafruitDHT.py on my libreelec fails; I added libpath from this forum post but no luck:

    I also tried pythonwrapper.sh and pasting different scripts to the Adafruit_DHT directory, but still no luck.

    My python knowlegde is very limited, I am no developer. I can not tell if it's the library, a python2/3 problem or whatever else.

    Could the library be updated or is there anything I can do?

  • Tried replacing it:

  • You are correct with:

    Code
    import sys
    sys.path.append('/storage/.kodi/addons/virtual.adafruit-libraries/lib')
    import Adafruit_DHT

    You get the error, because you try to run the Python 2 version of Adafruit DHT:

    Code
    ImportError: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

    Use "pip3" instead of "pip" to download the Python 3 version: pip3 install Adafruit_DHT

  • I installed Adafruit_DHT as addon. How can I use pip3 on my libreelec10?

    • uninstall that add-on, it's not compatible
    • create the folder /storage/.kodi/userdata/library/Adafruit_DHT
    • copy this files into that folder (use wget <URL>) : Click!
    • then you can use the above method to access the libs in that folder