That's before we migrated to esp-idf V5. Maybe something went wrong during the upgrade
kaxori09/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)
floitsch09/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.
floitsch09/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).
kaxori09/12/2023 11:06 AM
deep-sleep 0 is basically a reset. Thank you, that will do.
floitsch09/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.
floitsch
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...
floitsch09/12/2023 12:00 PM
I was wrong: with the latest SDK I don't get any valid reading. Not even one.
floitsch09/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)
I will release a new version once it's reviewed and checked in.
floitsch09/12/2023 12:56 PM
Released, and should soon make it to the package registry.
floitsch09/12/2023 12:56 PM
Let me know if it doesn't fix your issue.
kaxori09/12/2023 02:31 PM
good shot it works ! Thank you.
1
floitsch09/12/2023 02:31 PM
thanks for reporting.
OPkaxori
deep-sleep 0 is basically a reset. Thank you, that will do.
kaxori09/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)
floitsch09/20/2023 10:53 AM
You have two options: 1. write into flash, or 2. write into RTC memory
floitsch09/20/2023 10:54 AM
In both cases you would use a bucket.
floitsch09/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"
kaxori09/21/2023 07:19 AM
Thank you, (it works)
1
kaxori09/21/2023 07:24 AM
I would ask the "oracle of toit" why the resize is used in the map_ implemention:
kaxori09/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.
floitsch09/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.
kaxori09/21/2023 07:24 PM
map: is calling map_ with [] empty "target/List".
kaxori09/21/2023 07:26 PM
... reason I dive into this is to understand blocks. I didnt spend time enough in the past ...(edited)
kaxori09/21/2023 07:27 PM
so the good understanding of the toit language is the basis of understanding of all the examples.
kaxori09/21/2023 07:28 PM
and the more I learn and understand the more gemstones i find
kaxori09/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)
floitsch09/21/2023 07:36 PM
Glad to hear!
kaxori09/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"?
floitsch09/22/2023 08:04 AM
It's just saying that the parameter is optional.
floitsch09/22/2023 08:04 AM
Unfortunately it's not straight-forward to actually show what the default value is.
floitsch09/22/2023 08:05 AM
I need to refactor the compiler/toitdoc-generator to make this possible, and that would require some work.