Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to read data on esp32c3 #202

Open
flex380 opened this issue Apr 5, 2023 · 2 comments
Open

Unable to read data on esp32c3 #202

flex380 opened this issue Apr 5, 2023 · 2 comments

Comments

@flex380
Copy link

flex380 commented Apr 5, 2023

Failed to read from DHT sensor!

@phybros
Copy link

phybros commented Apr 12, 2023

I have the same issue with an ESP32-C3-WROOM-02 module. I did find this person's repo (https://github.com/mkjanke/ESP32-C3-Fanspeed) which mentions that a change to the InterruptLock class is required to make the DHT readings work, but I haven't tried it:

class InterruptLock {
#if defined(ESP32)
  portMUX_TYPE mutex = portMUX_INITIALIZER_UNLOCKED;
#endif

public:
  InterruptLock() {
#if !defined(ARDUINO_ARCH_NRF52)
    noInterrupts();
#endif
#if defined(ESP32)
    portENTER_CRITICAL(&mutex);
#endif
  }
  ~InterruptLock() {
#if !defined(ARDUINO_ARCH_NRF52)
    interrupts();
#endif
#if defined(ESP32)
    portEXIT_CRITICAL(&mutex);
#endif

  }
};

Maybe we could just PR this to the library?

@phybros
Copy link

phybros commented Apr 25, 2023

I tried this ^^^ and it just makes the esp crash and dump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants