guild icon
Toit
#exception DHT22 => needs update to dhtxx V1.4.0 (solved)
Thread channel in help
kaxori
kaxori 09/11/2023 01:15 PM
kaxori
kaxori 09/11/2023 01:17 PM
Version: v1.11.2
SDK version: v2.0.0-alpha.99
Build date: 2023-09-06T05:08:05Z

ESP32 development board

PKG: dhtxx V 1.3.1
floitsch
floitsch 09/11/2023 01:33 PM
Is this reproducible?
floitsch
floitsch 09/11/2023 01:34 PM
And if you downgrade to the previous version, does it work again?
kaxori
kaxori 09/11/2023 04:59 PM
how does the downgrade work ?
kaxori
kaxori 09/11/2023 05:06 PM
it worked with previous release
kaxoriOPkaxori
how does the downgrade work ?
floitsch
floitsch 09/11/2023 07:38 PM
You would just download an older Jaguar from the release page of the github repository.
kaxoriOPkaxori
it worked with previous release
floitsch
floitsch 09/11/2023 07:38 PM
Ok. I will try to find a dht22 and try to reproduce.
floitsch
floitsch 09/11/2023 07:38 PM
Do you know which release still worked?
kaxori
kaxori 09/12/2023 08:05 AM
I downloaded the toit-dhtxx on 18.08.20023 and the example worked.
floitsch
floitsch 09/12/2023 08:06 AM
Ok. I will see which SDK version was current at that time.
I have a dht22 with me and will try to reproduce at work.
kaxori
kaxori 09/12/2023 08:15 AM
Version: v1.10.2
SDK version: v2.0.0-alpha.94
Build date: 2023-08-09T14:57:38Z

works fine
👍1
floitsch
floitsch 09/12/2023 08:16 AM
That's before we migrated to esp-idf V5. Maybe something went wrong during the upgrade
kaxori
kaxori 09/12/2023 09:17 AM
Is there a function/command to force a reset of ESP32 programmatically ?

(I want to use same behaviour with/without deep sleep)
(edited)
floitsch
floitsch 09/12/2023 10:46 AM
deep-sleep 0 is basically a reset.
I don't think there is no way to reboot that also resets the RTC memory.
You could try to pull down/up the reset pin by just writing to it from a different pin. Feels a bit weird, but might actually work.
floitsch
floitsch 09/12/2023 10:56 AM
I can reproduce with a DHT11.
It gets one sensor reading and then crashes with the same error.
Investigating (although I'm not sure I can fully solve it here, because I'm missing an oscilloscope).
kaxori
kaxori 09/12/2023 11:06 AM
deep-sleep 0 is basically a reset. :👍🏻:
Thank you, that will do.
floitsch
floitsch 09/12/2023 12:00 PM
So the 1-wire protocol still works, but the DHT one doesn't. And it's not even close. (It should see 40? events, but only gets 2).
Looking now, whether the 1-wire RMT peripheral is initialized differently than the DHT.
floitschfloitsch
I can reproduce with a DHT11. It gets one sensor reading and then crashes with the same error. Investigating (although I'm not sure I can fully solve it here, because I'm missing a...
floitsch
floitsch 09/12/2023 12:00 PM
I was wrong: with the latest SDK I don't get any valid reading. Not even one.
floitsch
floitsch 09/12/2023 12:40 PM
It looks like the new RMT (from esp-idf v5) reports 1-0 signals when there are transitions that happen, but that are over the threshold duration.
This wasn't the case before, and it throws the driver.
I'm trying to figure out what the easiest way to work around this is.
(edited)
floitsch
floitsch 09/12/2023 12:51 PM
I will release a new version once it's reviewed and checked in.
floitsch
floitsch 09/12/2023 12:56 PM
Released, and should soon make it to the package registry.
floitsch
floitsch 09/12/2023 12:56 PM
Let me know if it doesn't fix your issue.
kaxori
kaxori 09/12/2023 02:31 PM
:🎯: good shot
it works !
Thank you.
👍1
floitsch
floitsch 09/12/2023 02:31 PM
thanks for reporting.
kaxoriOPkaxori
deep-sleep 0 is basically a reset. :👍🏻: Thank you, that will do.
kaxori
kaxori 09/20/2023 10:30 AM
How to save states over restarts ( if no PSRAM is installed, standard ESP32 Dev board) ?
Do I have to use flash memory (bucket store ) ?
(edited)
floitsch
floitsch 09/20/2023 10:53 AM
You have two options:
1. write into flash, or
2. write into RTC memory
floitsch
floitsch 09/20/2023 10:54 AM
In both cases you would use a bucket.
floitsch
floitsch 09/20/2023 10:57 AM
// Flash-storage: flash-bucket := storage.Bucket.open --flash "toit.io/flash-example" // RAM-storage: ram-bucket := storage.Bucket.open --ram "toit.io/ram-example"
These can then be accessed like a map:
ram-bucket["foo"] = [1, 2, 3] ram-bucket.get "foo" ram-bucket.remove "foo"
kaxori
kaxori 09/21/2023 07:19 AM
:👍🏻: Thank you, (it works)
👍1
kaxori
kaxori 09/21/2023 07:24 AM
I would ask the "oracle of toit" :😉: why the resize is used in the map_ implemention:
kaxori
kaxori 09/21/2023 07:28 AM
I assume, the argument target is a List of the right size and cannot see, why resize is then used.
floitsch
floitsch 09/21/2023 07:30 AM
Most of the time the target list is just the empty list. But it would make more sense to already provide a list with the correct size.
kaxori
kaxori 09/21/2023 07:24 PM
map: is calling map_ with [] empty "target/List".
kaxori
kaxori 09/21/2023 07:26 PM
... reason I dive into this is to understand blocks. I didnt spend time enough in the past ...(edited)
kaxori
kaxori 09/21/2023 07:27 PM
so the good understanding of the toit language is the basis of understanding of all the examples.
kaxori
kaxori 09/21/2023 07:28 PM
and the more I learn and understand the more gemstones i find :🙂:
kaxori
kaxori 09/21/2023 07:32 PM
One year ago my attempts to walk with toit were not very successful. This year the long run tests are successful ! And it is fun to develop with jaguar.(edited)
floitsch
floitsch 09/21/2023 07:36 PM
Glad to hear!
kaxori
kaxori 09/22/2023 08:03 AM
I dont want to irritate you with irrelevants...
But i find the "bool=" unclear. Is it intended to suppress "false"?
floitsch
floitsch 09/22/2023 08:04 AM
It's just saying that the parameter is optional.
floitsch
floitsch 09/22/2023 08:04 AM
Unfortunately it's not straight-forward to actually show what the default value is.
floitsch
floitsch 09/22/2023 08:05 AM
I need to refactor the compiler/toitdoc-generator to make this possible, and that would require some work.
floitsch
floitsch 09/22/2023 08:05 AM
I don't like it either...
kaxori
kaxori 09/22/2023 08:07 AM
... bad look for me - born as a muggle :😢:
47 messages in total