You can't just replace the pinMode(ht.pin,'input_pullup'); with a digitalPulse (which it seems you've done). It'll mean the DHT22 is fighting against the Espruino board to pull the signal line low and something might get damaged.
As far as I can tell, the marker isn't fired late. It should immediately set the pin low, then set it to 'input_pullup' after 1ms. It then waits 5ms for the response.
My guess is that on ESP8266, it often messes up the timing (maybe WiFi needs to process something for a few ms) and executes the pinMode and the other timeout right after each other, so there is no time for the result to appear.
I guess you could work around this by just nesting the timeouts?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
You can't just replace the
pinMode(ht.pin,'input_pullup');
with a digitalPulse (which it seems you've done). It'll mean the DHT22 is fighting against the Espruino board to pull the signal line low and something might get damaged.As far as I can tell, the marker isn't fired late. It should immediately set the pin low, then set it to 'input_pullup' after 1ms. It then waits 5ms for the response.
My guess is that on ESP8266, it often messes up the timing (maybe WiFi needs to process something for a few ms) and executes the pinMode and the other timeout right after each other, so there is no time for the result to appear.
I guess you could work around this by just nesting the timeouts?
to: