The PietteTech_DHT library has always been considered the most reliable library.
I just loaded that library and it seems to work. Occasionally it times out and all data shows -1.0, sometimes -3.0, sometimes -4.0.
Yeah I saw that too, about every 5th reading it looked like it wasn’t reading. I set my delay around 30 seconds between readings.
I’ve debugged it using a digital analyzer and find the culprit. It is an issue with the delayMicroseconds() function that is not looking well here.
It should be reviewed for the mesh firmware.
But anyway, it is a good thing the PietteTech library is working. That make sense as it uses interruption instead of delayMicroseconds().
These are the error codes defined in PietteTech_DHT.h
// error codes
#define DHTLIB_ERROR_CHECKSUM -1
#define DHTLIB_ERROR_ISR_TIMEOUT -2
#define DHTLIB_ERROR_RESPONSE_TIMEOUT -3
#define DHTLIB_ERROR_DATA_TIMEOUT -4
#define DHTLIB_ERROR_ACQUIRING -5
#define DHTLIB_ERROR_DELTA -6
#define DHTLIB_ERROR_NOTSTARTED -7
@lamaral, I have opened an issue for the delayMicroseconds()
behaviour you found and took the liberty to repost your pulse train log.
https://github.com/particle-iot/firmware/issues/1641
Could you be so kind to comment on that issue and elaborate what code you used to take that log and how you acquired it - thanks
@ScruffR Thanks for the error codes.
@pironic Thanks for reporting the issue, can you please try this driver https://go.particle.io/shared_apps/5c1b7e4387c90f53e700018b
It works for me on Xenon, the firmware version is RC27.
The MCU clock on Mesh Device is much slower than Photon/Electron (64MHz vs 120MHz), digitalWrite()
has performance lost because it has safety check inside it, so we suggest you using fastPin API.
@eugene0501, I have tried and it works for me on Argon too.
Good job
A further test is here: https://github.com/particle-iot/firmware/issues/1641
Looks to work!.. (after removing the line that disables the wifi.)
i dont have a serial cable for the particle devices so i altered slightly to take advantage of the Particle.Publish()
function. Thanks for looking into this!
Is your DHT Piette DHT Simple.ino still working with the latest firmware? I’m getting -3 for both the temp and humidity. At first I thought It was the sensor, but I’ve checked it with an Arduino and it worked fine. I’ve moved the Grove shield from the Argon to the Xenon and it works on neither. I loaded the hybrid firmware and system1 firmware using CLI. Maybe I didn’t do it right or load all of it? do I need to flash the new r27 bootloader too?
I’d have to try again, but corrently have no access to my devices.
Too weird. I pulled it up to look at it in the Events log and the first reading looked right, then it’s back to throwing -3s
it worked for me on an Argon after removing the manual mode.
I’m also failing to read about 5-8% of the time with the new code.
I can confirm I see the same thing and have filed an issue about that
Great…err, I think, thank you for the help.
Kelly
Manual mode?
I have just pushed an update to the PietteTech_DHT library (now v0.0.6) to work around this issue
Thank you ScruffR, with your update I was able to successfully run a Xenon overnight with a DHT11 device. I had to change line 42 of the .h file to this:
const char DHTLIB_VERSION[] = “0.0.6”;
Thanks for the heads-up
I’ve corrected that with 0.0.7