Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Using a DHT11 with a LoPy works with old firmware version but not new firmware?

    Scheduled Pinned Locked Moved Discussion
    dht11firmwarelopy
    5 Posts 3 Posters 1.4k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      Robin
      last edited by

      I am constructing a demo-kit for use in education. The cheap DHT11 sensor is ideal. If a kid breaks it, it's only €3. After reading several posts and links to python libraries for the DHT11 temperature and humidity sensor i copied some code liberally from here Pure Python library for reading DHT sensor on Pycom boards and came up with a sample program for the LoPy.

      My code is here: https://github.com/puthli/meet-de-klas/tree/master/micropython/demo-kit
      It reads the DHT11 sensor and forwards the readings to 'the things network' over LoRa. If you don't have the things network coverage you can remove lines 34-37 and 61 and just view the DHT11 readings every 20 seconds.

      The code works for LoPy's straight out of the box on firmware version 1.8.6-237, but when i upgraded the firmware to the latest version with the pycom firmware update tool, the driver for the DHT11 no longer works. Now it only produces zeroes for the temperature and humidity readings. We have reproduced this on two separate LoPy's.

      Downgrading LoPy firmware is complicated it seems and i am hesitant to go down that route.
      But it is unclear why the DHT11 code no longer yields any data.
      Any clues are welcome. It you have a LoPy and a DHT11, you can try out the code yourself.

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @Robin
        last edited by

        @robin Please use in __collectinput() the method pycom.pulses_get(pin, timeout), which is more stable. There is also a DHT11 lib by @Jurassic-Pork which uses pulses_get. https://github.com/JurassicPork/DHT_PyCom/tree/pulses_get

        R 1 Reply Last reply Reply Quote 0
        • R Offline
          Robin @robert-hh
          last edited by

          Thanks @robert-hh
          JurassicPork's library did not work for me.
          I will try the pycom.pulses_get(pin, timeout) this evening.

          robert-hhR Jurassic PorkJ 2 Replies Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @Robin
            last edited by

            @robin The link I gave is a new version of @Jurassic-Pork library, which worked for me. Confusingly, his code is now called dth.py. To be honest, I did not try it with 1.9.0 yet. It it does not work, there may be another problem.

            1 Reply Last reply Reply Quote 0
            • Jurassic PorkJ Offline
              Jurassic Pork @Robin
              last edited by Jurassic Pork

              hello,
              @robin said in Using a DHT11 with a LoPy works with old firmware version but not new firmware?:

              JurassicPork's library did not work for me.

              What code ?
              I have two branches in my library :
              master with the old method to collect the data .
              and pulses_get using the new function pulses_get
              Be careful in this branch the constructor has changed (see new examples)

              Friendly, J.P

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post

              Pycom on Twitter

              Pycom