DHT22 sensor get stuck with Spark Core on pin 5 and pin 6 [SOLVED]

After struggling a bit I decided to switch from D3 to D2 and now it works!

Maybe D3 (on Photon) doesn’t support:

attachInterrupt(_sigPin, isrCallback_wrapper, FALLING);

because in a debug session I checked that it was always returning: -7 and -2

DHTLIB_ERROR_NOTSTARTED    -7
DHTLIB_ERROR_ISR_TIMEOUT   -2

Now on D2 everything works as expected.

1 Like