guild icon
Toit
#Problem dhtxx and new version v2.0.0-alpha.182
Thread channel in help
Fernan
Fernan 06/01/2025 07:09 PM
Hi, I,ve just updated to the new version and I,m having the "EXCEPTION error. insufficient signals from DHT" since the update, and don,t find a way to downgrade to the functional version i had before that was the .175
FernanOPFernan
Hi, I,ve just updated to the new version and I,m having the "EXCEPTION error. insufficient signals from DHT" since the update, and don,t find a way to downgrade to the functional ...
floitsch
floitsch 06/02/2025 04:47 PM
Which platform are you on?
If you install an older version you should be able to run again. Maybe you need to downgrade your packages again too, but that isn't hard either.
floitschfloitsch
Which platform are you on? If you install an older version you should be able to run again. Maybe you need to downgrade your packages again too, but that isn't hard either.
Fernan
Fernan 06/02/2025 04:50 PM
I use windows, but I dont find info on how to downgrade to .175 version
floitsch
floitsch 06/02/2025 04:51 PM
In the worst case just use the Windows installer
Fernan
Fernan 06/02/2025 04:52 PM
I tried winget but always get the latest version
floitsch
floitsch 06/02/2025 04:52 PM
Winget probably doesn't (easily) allow that.
floitsch
floitsch 06/02/2025 04:52 PM
But winget is just using the installer.
floitsch
floitsch 06/02/2025 04:52 PM
And good to know for the DHT exceptions.
floitsch
floitsch 06/02/2025 04:53 PM
I will investigate. We upgraded to the new esp-idf APIs. Everything should still work, but who knows... :๐Ÿคทโ€โ™‚๏ธ:
floitsch
floitsch 06/02/2025 04:53 PM
That said: have you tried updating the dhtxx package?
Fernan
Fernan 06/02/2025 04:53 PM
yes
floitsch
floitsch 06/02/2025 04:53 PM
too bad. I would have hoped that the new pkg with the new API would be stable.
floitsch
floitsch 06/02/2025 04:53 PM
I will try to find some time to investigate.
floitschfloitsch
too bad. I would have hoped that the new pkg with the new API would be stable.
Fernan
Fernan 06/02/2025 04:54 PM
I'm using toit-dhtxx 1.8.0
floitsch
floitsch 06/02/2025 04:56 PM
Yes. That one should work with the new API. (It's literally the only commit for that release)
floitsch
floitsch 06/02/2025 04:56 PM
I guess it's not working as well as I hoped... :๐Ÿ˜ฆ:
kaxori
kaxori 06/02/2025 05:18 PM
:๐Ÿ˜ข: I agree - have the same problem with the new version.
(update from v2.0.0-alpha.180 to v2.0.0-alpha.182 without application change)
floitsch
floitsch 06/02/2025 05:19 PM
Good to know. Thanks.
floitsch
floitsch 06/02/2025 05:19 PM
Is it sometimes working or never?
kaxori
kaxori 06/02/2025 05:23 PM
Now I don't get any dhtxx data.
floitsch
floitsch 06/02/2025 05:24 PM
interesting.
floitsch
floitsch 06/02/2025 05:24 PM
We have the dhtxx as part of our tests, and there it seems to work.
floitsch
floitsch 06/02/2025 05:25 PM
Could you download the dhtxx package and use a local version of it?
floitsch
floitsch 06/02/2025 05:25 PM
I would have a few lines that I could add to (maybe) help debugging it.
kaxori
kaxori 06/02/2025 05:25 PM
previously i had only problems with the first read.
floitsch
floitsch 06/02/2025 05:26 PM
That said: I'm currently debugging the ultrasound sensor. So maybe I will find something there.
๐Ÿ‘๐Ÿป1
kaxorikaxori
previously i had only problems with the first read.
floitsch
floitsch 06/02/2025 05:26 PM
I think I figured out why the first read wasn't working.
floitsch
floitsch 06/02/2025 05:26 PM
Let me try to fix the ultrasound sensor first. If I find a more general problem, it might fix the dhtxx.
floitsch
floitsch 06/02/2025 05:27 PM
if not, I will do a bit more experiments with my dhtxx sensors.
floitsch
floitsch 06/02/2025 05:27 PM
If I can't reproduce I will probably need your help, but let's start on my side.
kaxori
kaxori 06/02/2025 05:27 PM
ok - gerne.
kaxori
kaxori 06/02/2025 05:38 PM
:๐Ÿ‘จ๐Ÿปโ€๐Ÿญ: uninstalling and installing the dhtxx pkg removed the problem !
:๐Ÿ—ฃ๏ธ: The sensors data are available again.
floitsch
floitsch 06/02/2025 05:39 PM
On the new version or the old one?
kaxori
kaxori 06/02/2025 05:39 PM
Jaguar version:
Version: v1.52.0
SDK version: v2.0.0-alpha.182
floitsch
floitsch 06/02/2025 05:40 PM
nice.
kaxorikaxori
:๐Ÿ‘จ๐Ÿปโ€๐Ÿญ: uninstalling and installing the dhtxx pkg removed the problem ! :๐Ÿ—ฃ๏ธ: The sensors data are available again.
Fernan
Fernan 06/02/2025 06:25 PM
this did not work in my case
floitsch
floitsch 06/02/2025 06:27 PM
I'm still debugging my ultrasound sensor.
Currently stumped by the behavior. And will upgrade to a newer esp-idf version, to see if the device behaves the same there. Would be stupid to debug an esp-idf issue that has already been fixed. (Wouldn't be the first time...)
floitsch
floitsch 06/03/2025 08:33 AM
@Fernan so far I can't reproduce.
Can you give me/us more information on your setup?
Feel free to send me your code to [email protected] (I will delete it after debugging).
I'm also interested in how things are connected.
Fernan
Fernan 06/03/2025 02:11 PM
Fernan
Fernan 06/03/2025 02:12 PM
This is a prototipe that takes a temperaure meassure with dht22 and sends to an end point, it was workin fine until the ugrade
Fernan
Fernan 06/03/2025 02:16 PM
**
Decoding by jag, device has version <2.0.0-alpha.182>
**
EXCEPTION error.
insufficient signals from DHT
0: Driver.read-data-no-catch <pkg:toit-dhtxx>\driver.toit:129:7
1: Driver.read-data.<block>.<block>.<block>.<block> <pkg:toit-dhtxx>\driver.toit:93:20
2: Driver.read-data.<block>.<block>.<block> <pkg:toit-dhtxx>\driver.toit:91:32
3: Task.with-deadline.<block> <sdk>\core\task.toit:223:16
4: Task.with-deadline <sdk>\core\task.toit:217:3
5: with-timeout <sdk>\core\utils.toit:189:24
6: with-timeout <sdk>\core\utils.toit:181:10
7: Driver.read-data.<block>.<block> <pkg:toit-dhtxx>\driver.toit:91:9
8: catch.<block> <sdk>\core\exceptions.toit:124:10
9: catch <sdk>\core\exceptions.toit:122:1
10: catch <sdk>\core\exceptions.toit:73:10
11: Driver.read-data.<block> <pkg:toit-dhtxx>\driver.toit:90:7
12: SmallInteger.repeat <sdk>\core\numbers.toit:1288:3
13: Driver.read-data
<pkg:toit-dhtxx>\driver.toit:89:14
14: Driver.read <pkg:toit-dhtxx>\driver
.toit:59:13
15: main.<block> temp_ibi_t1.toit:23:20
16: Duration.of <sdk>\core\time.toit:221:10
17: Duration.periodic <sdk>\core\time.toit:276:19
18: main temp_ibi_t1.toit:20:20
**
kaxori
kaxori 06/03/2025 02:17 PM
try to catch the first read error.
kaxori
kaxori 06/03/2025 02:19 PM
that works in my case(edited)
Fernan
Fernan 06/03/2025 02:32 PM
it caches the same error "insufficient signals from DHT"
kaxori
kaxori 06/03/2025 02:33 PM
:๐Ÿค”: strange
floitsch
floitsch 06/03/2025 02:55 PM
@Fernan do you feel comfortable changing the dhtxx package to add some debug lines?
Fernan
Fernan 06/03/2025 02:57 PM
go ahead please
floitschfloitsch
Fernan
Fernan 06/03/2025 03:09 PM
how can I donload the jaguar v1.48.0 version for windows?
floitsch
floitsch 06/03/2025 03:16 PM
Use the installer, or the tar.gz.
floitsch
floitsch 06/03/2025 03:17 PM
Use live reloading over WiFI to turbo-charge developing for your ESP32. - toitlang/jaguar
floitsch
floitsch 06/03/2025 03:17 PM
The latest Jaguar release uses Toit 184.
kaxori
kaxori 06/03/2025 03:25 PM
I use in windows power shell:
- winget install --id=Toit.Jaguar -e
(edited)
kaxori
kaxori 06/03/2025 03:26 PM
- jag setup
kaxori
kaxori 06/03/2025 03:27 PM
- jag firmware update -d <DEVICE>
Fernan
Fernan 06/03/2025 03:28 PM
but it takes me to the latest release I need to downgrade to v1.48.0
kaxori
kaxori 06/03/2025 03:31 PM
winget install --id=Toit.Jaguar -e -v 1.48.0
floitsch
floitsch 06/03/2025 03:31 PM
The releases page has all existing releases.
floitsch
floitsch 06/03/2025 03:31 PM
Even better. Nice.
Fernan
Fernan 06/03/2025 04:02 PM
I downgraded everything (a nightmare) but now is working as before
FernanOPFernan
I downgraded everything (a nightmare) but now is working as before
floitsch
floitsch 06/03/2025 04:03 PM
Eventually we should figure out why newer versions fail with your setup.
floitsch
floitsch 06/03/2025 04:03 PM
But good to hear that you are back up and running
Fernan
Fernan 06/03/2025 04:07 PM
it was a good experience, I've learned a lot, what i dont understand is the difference between Toit and Jaguar, they have to work together ? can i use just one of them?
floitsch
floitsch 06/03/2025 04:09 PM
Jaguar uses Toit underneath. For simplicity it just downloads a specific version.
floitsch
floitsch 06/03/2025 04:09 PM
The latest Jaguar now has a way to use the downloaded toit: jag toit ...
floitsch
floitsch 06/03/2025 04:10 PM
If you don't develop for the esp32, then Jaguar is not necessary and just installing Toit is enough.
Fernan
Fernan 06/03/2025 04:24 PM
but Toit is designed just to develop esp32 or what else can I do with it?
floitsch
floitsch 06/03/2025 04:25 PM
It's a general purpose language as well.
floitsch
floitsch 06/03/2025 04:25 PM
Artemis, for example, is entirely written in Toit.
floitsch
floitsch 06/03/2025 04:25 PM
And a big chunk of toit itself is written in Toit.
floitsch
floitsch 06/03/2025 04:26 PM
You can either run programs with toit foo.toit, or compile them to executables: toit -o foo.exe foo.toit.
floitsch
floitsch 06/03/2025 04:26 PM
When developing for the desktop you often want to install the host, and/or cli package.(edited)
Fernan
Fernan 06/03/2025 04:31 PM
I've tryed to debug and reformulate with AI but I receive a lot of hallucinations and mixes with python
floitsch
floitsch 06/03/2025 04:32 PM
Yes. LLMs are still learning.
My brother told me that the latest claude.ai is getting much better at Toit.
floitsch
floitsch 06/03/2025 04:32 PM
And the more code is out there, the better all of them will get.
Fernan
Fernan 06/03/2025 04:33 PM
Eventually we will get there
floitsch
floitsch 06/03/2025 04:33 PM
It would probably also be helpful to come up with a good "header prompt" that reminds the LLM of Toit properties. What are blocks, how does the syntax look, ...
Fernan
Fernan 06/03/2025 04:34 PM
could you with your experience provide some example promt?
Fernan
Fernan 06/03/2025 04:38 PM
maybe build an exclusive RAG with Toit data
floitsch
floitsch 06/03/2025 05:20 PM
I thought about it, but it's not yet high enough on my (way too long) TODO list.
Fernan
Fernan 06/03/2025 06:29 PM
is there a remote way to install a container when the esp32 is in sleep mode?
FernanOPFernan
is there a remote way to install a container when the esp32 is in sleep mode?
floitsch
floitsch 06/03/2025 06:29 PM
Not with Jaguar
floitsch
floitsch 06/03/2025 06:30 PM
With Artemis the service regularly checks for new firmware and eventually updates itself when it goes out of sleep.(edited)
Fernan
Fernan 06/03/2025 06:32 PM
so I have to program some kind of time window to install the new container when in deep sleep mode?
floitsch
floitsch 06/03/2025 06:34 PM
When the device is in deep sleep it is basically turned off.
Something needs to tell the device that it needs to wake/boot up again.
Jaguar doesn't do that at all.
Artemis uses the max-offline to determine how long it can sleep (at most)
Fernan
Fernan 06/03/2025 06:39 PM
I remember when Toit started that early days that it had a web console that checked when esp32 woked up from sleep and it updated the new container
floitsch
floitsch 06/03/2025 06:41 PM
It also had a max-offline. Same as Artemis
floitsch
floitsch 06/03/2025 06:42 PM
With Artemis if you install a container it will get installed once the device goes online again
Fernan
Fernan 06/03/2025 06:42 PM
so I should change to Artemis to do that?(edited)
floitsch
floitsch 06/03/2025 06:45 PM
Jaguar is the convenient development environment.
Artemis is more professional. With some cost for that. If you have devices "out there" that need updates, then Artemis is for you. If you have only a single device then it's not clear. Could go either way.
floitsch
floitsch 06/03/2025 06:47 PM
With "cost" I mean; "updating the device might require several commands" (but then you have a binary diff that can be applied to many devices...)
And more setup.
๐Ÿ‘1
floitsch
floitsch 06/04/2025 08:59 AM
@Fernan I just realized that you are using the DHT22. So far I only tested the DHT11 with the new API. Will try to find a DHT22 and test with that one later today (in the hope I will find some time).
kaxori
kaxori 06/04/2025 09:12 AM
Some DHTxx devices need a pullup on data pin.
floitsch
floitsch 06/04/2025 09:12 AM
Since it used to work, it's unlikely the issue.
floitsch
floitsch 06/04/2025 09:13 AM
And for the ESP32 I wouldn't use 5V.
floitsch
floitsch 06/04/2025 09:13 AM
But agreed: external pull-ups can sometimes be necessary.
floitsch
floitsch 06/04/2025 09:13 AM
It's a bit strange that the RMT doesn't have support for it.
floitsch
floitsch 06/04/2025 09:14 AM
(at least not easily)
kaxori
kaxori 06/04/2025 09:15 AM
I got a good advice from you to open/read/close for each measurement. That works fine if several DHT's are used.
floitsch
floitsch 06/04/2025 12:37 PM
I just found my dht22, and I can reproduce. Will debug it soon. The oscilloscope shows the response from the DHT, so not completely clear yet what's going wrong, but likely a slower response from the DHT
kaxori
kaxori 06/04/2025 01:33 PM
Using AM2320 and AM2302 (DHT22) on same ESP32-C3 without problems !
Even hot swapping of the devices works.
(edited)
floitsch
floitsch 06/04/2025 01:36 PM
interesting.
floitsch
floitsch 06/04/2025 01:53 PM
hmm. Doesn't help that the DHT can enter a bad state. Didn't realize that... A lot of my testing was useless, as the sensor just went into a bad state...
kaxori
kaxori 06/04/2025 01:54 PM
did you apply a pullup ?
floitsch
floitsch 06/04/2025 02:01 PM
Didn't even need to.
floitsch
floitsch 06/04/2025 02:01 PM
I think the RMT does that automatically when in open-drain mode.
floitsch
floitsch 06/04/2025 02:06 PM
However, I think I found an issue:
- when the RMT is started, it currently seems to pull down the output line. I think that's a bug in the ESP-IDF. Unfortunately, that looks to the DHT as if the device wants to read the data.
If we don't wait a bit after creating the driver object, we are asking for a new conversation while the old transmission is still in progress.
I was able to get my setup working by simply adding a sleep --ms=1000 after creating the driver object.
@Fernan could you try to do the same and see if that works for you?

Independently: In theory the driver needs to be powered up by at least 1s before we are allowed to interact with it. The driver assumes that the instantiation time is when the sensor is powered on, and is supposed to wait if the second wasn't elapsed yet. However, due to an inverted '<', that never triggered. I think I will remove that code, since the sensor is most of the time powered up independently of the esp32.
I will add a warning somewhere, though.
kaxori
kaxori 06/04/2025 03:02 PM
example: only the 1st sample is missing.
import dhtxx import gpio GPIO-PIN-NUM ::= 20 main: pin := gpio.Pin GPIO-PIN-NUM driver := dhtxx.Dht22 pin count := 0 while true: ++count e := catch : print "$(count): "+ driver.read.stringify if e: print "$(count): " sleep --ms=250
floitschfloitsch
However, I think I found an issue: - when the RMT is started, it currently seems to pull down the output line. I think that's a bug in the ESP-IDF. Unfortunately, that looks to the...
Fernan
Fernan 06/04/2025 03:19 PM
OK
floitsch
floitsch 06/04/2025 03:39 PM
For me the DHT22 could get into a bad state, so maybe there are batches where reading in a loop won't recover.
Either way: at the moment adding a sleep after instantiating the driver is a good idea. That should also make the first sample work again.
floitsch
floitsch 06/04/2025 04:14 PM
I filed an issue: https://github.com/espressif/esp-idf/issues/16068
For now the best way to avoid any issues is to sleep for 300ms.
Answers checklist. I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there. I have updated my IDF branch (master or release) to the latest version and checked t...
kaxorikaxori
Some DHTxx devices need a pullup on data pin.
floitsch
floitsch 06/04/2025 04:36 PM
fwiw, I ended up adding a pullup (using the 3.3V). Not completely sure if it was necessary, but my DHT22 didn't have a builtin.
In theory it should be possible to use the ESP32's builtin pull-up, but there is currently no way to configure that (easily).
floitsch
floitsch 06/04/2025 04:56 PM
@Fernan I also looked again at your code.
You already have a loop with a 500ms delay if it doesn't work. Unless the sensor enters a bad state that should be enough to recover.
So you might also need the pull-up that @kaxori was mentioning. It could be that older versions automatically pulled the pin high, whereas the current ESP-IDF doesn't anymore.
If your DHT22 has 4 pins, then it most likely doesn't have any pull-up.
(edited)
kaxori
kaxori 06/04/2025 05:01 PM
In my plant germination monitoring, the pullups have proven to be advantageous for sensors with long leads.
floitschfloitsch
@Fernan I also looked again at your code. You already have a loop with a 500ms delay if it doesn't work. Unless the sensor enters a bad state that should be enough t...(edited)
Fernan
Fernan 06/04/2025 05:08 PM
my sensor has 3 pins and is working good on version alpha.175, I'll try again upgrading with your recomendation
floitsch
floitsch 06/04/2025 05:09 PM
Alpha 175 is using the old deprecated ESP-IDF API. It could be that the old ESP-IDF API automatically pulled the pin high, and the newer API doesn't.
But let's hope that a simple 300ms sleep will be enough to fix things.
floitsch
floitsch 06/05/2025 07:11 AM
Espressif IoT Development Framework. Official development framework for Espressif SoCs. - espressif/esp-idf
floitsch
floitsch 06/05/2025 07:12 AM
that said: I got the impression that wasn't active. Will investigate when upgrading to the newest ESP-IDF.
118 messages in total