WDT on Lolin D32

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
KJM
Posts: 158
Joined: Sun Nov 18, 2018 10:53 pm
Location: Sydney AU

WDT on Lolin D32

Post by KJM » Wed Jan 12, 2022 10:18 pm

How do I setup a WDT on the Lolin D32? the usual

Code: Select all

from machine import WDT; wdt=WDT(timeout=5000)
throws an error

Code: Select all

TypeError: function doesn't take keyword arguments

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: WDT on Lolin D32

Post by Roberthh » Thu Jan 13, 2022 7:12 am

How about:

from machine import WDT; wdt=WDT(5000)

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: WDT on Lolin D32

Post by davef » Thu Jan 13, 2022 8:52 am

I was going to respond saying it works for me but after reading your comment I realised that I only use WDT on Glenn's ESP-Now ESP32 image.

If your command works then there might be something inconsistent between the two code bases.

Shards
Posts: 39
Joined: Fri Jun 25, 2021 5:14 pm
Location: Milton Keynes, UK

Re: WDT on Lolin D32

Post by Shards » Thu Jan 13, 2022 4:11 pm

The standard wdt = WDT(timeout=5000) works fine for me and Robert's suggested version fails. I'm not testing with a Lolin board but it is an ESP32-WROOM-32 module from AZ-Delivery running the latest stable 1.17 which should be same spec as the Lolin. Is your build up-to-date?

KJM
Posts: 158
Joined: Sun Nov 18, 2018 10:53 pm
Location: Sydney AU

Re: WDT on Lolin D32

Post by KJM » Thu Jan 13, 2022 8:30 pm

Robert's suggestion gives a value error. The D32 arrived with micropython already installed, (sysname='esp32', nodename='esp32', release='1.10.0', version='v1.10-195-gfcace26d8 on 2019-03-12', machine='ESP32 module with ESP32'). I guess March 2019 is a bit old but I haven't yet mastered the art of flashing my own.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: WDT on Lolin D32

Post by Roberthh » Thu Jan 13, 2022 8:36 pm

That's right. On recent firmware, it has to be either WDT(timeout=5000) or WDT(0, 5000). For compatibility with other ports (I guess), there is an id parameter, which has to be 0.

KJM
Posts: 158
Joined: Sun Nov 18, 2018 10:53 pm
Location: Sydney AU

Re: WDT on Lolin D32

Post by KJM » Sat Jan 15, 2022 12:56 pm

The pin HOLD doesn't work either, guess I better have a crack at flashing a more recent micropython.

KJM
Posts: 158
Joined: Sun Nov 18, 2018 10:53 pm
Location: Sydney AU

Re: WDT on Lolin D32

Post by KJM » Sun Jan 16, 2022 12:03 am

I flashed the latest upython onto a Lolin D32 after I started to get OSError 28 trying to flash main.py but I'm worried it will be only a matter of time before the file system falls over again. Is there a way to tell if release='1.17.0' uses FAT or littleFS? Is there a stable upython out there that uses littleFS by default?

Post Reply