D1 Clones

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
ChuckMcM
Posts: 9
Joined: Wed May 20, 2020 2:00 am
Contact:

Re: D1 Clones

Post by ChuckMcM » Sun May 24, 2020 3:36 am

deshipu wrote:
Wed May 20, 2020 11:07 am
You need to specify the flash mode when flashing your firmware — different boards will have the flash connected differently. There are four possible combinations, so you can just try them all and see which one works.
This seems to have ultimately unlocked my issue, thanks! The flash chips on these boards can only be programmed in 'dio' mode. And worse programming them in the default 'qio' mode corrupts things in an odd way. After this change I was able to deploy both the current "release" version of uP for the ESP8266 and my custom version that I had built from source directly.

Now I can go back to trying to figure out why the Wio Link board resets for no apparent reason. Or conversely just build a 'shield' board for the D1 with Grove connectors.

Also I'll check on the deep sleep question.

ChuckMcM
Posts: 9
Joined: Wed May 20, 2020 2:00 am
Contact:

Re: D1 Clones

Post by ChuckMcM » Sun May 24, 2020 5:41 am

kwiley wrote:
Wed May 20, 2020 9:12 pm
When you get your own issues sorted out, I would be very interested to know if you can confirm whether or not your D1 boards successfully wake from deep sleep with the RTC alarm.
Hi kwiley,

On the "back" of my D1 boards there are two pads with a silkscreen label pointing at them that says "sleep". I put a solderbridge here and that connects RST to the D0 (aka GPIO16) line. I then updated boot.py to the following:

Code: Select all

# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
#esp.osdebug(None)
import uos, machine
#uos.dupterm(None, 1) # disable REPL on UART(0)
import gc
#import webrepl
#webrepl.start()
gc.collect()
rtc = machine.RTC()
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)

if (machine.reset_cause() == machine.DEEPSLEEP_RESET) :
    print("Woke from a deep sleep!")

rtc.alarm(rtc.ALARM0, 20000)
print("Going to sleep...")
machine.deepsleep()
When I reset the device I got the regular junk characters on the serial line followed by "Going to sleep ..." and 20 seconds later, same junk on the serial line but got the message "woke from a deep sleep", and then back to "Going to sleep".

So yes, I'd say it works as advertised.

--Chuck

ChuckMcM
Posts: 9
Joined: Wed May 20, 2020 2:00 am
Contact:

Re: D1 Clones

Post by ChuckMcM » Sun May 24, 2020 6:19 am

Be aware that if you load that code into boot.py it can make it challenging to get control back of your board. You have to hit it where it is booting but before it has put itself to sleep. So there's that.

--Chuck

kwiley
Posts: 140
Joined: Wed May 16, 2018 5:53 pm
Contact:

Re: D1 Clones

Post by kwiley » Sun May 24, 2020 7:21 am

All right, so yours is working. Thanks. I have two completely different D1 minis (both clones, I admit) and both suffer a fairly widely experienced problem in this regard. Waking with an alarm just doesn't work. Hard resetting works, and resetting from the "zombie" state of an erroneous alarm wakeup works, but the boards can't just wake themselves up, which of course is a critical feature of this chip and its modules and boards.

Sigh.

Thanks.

Post Reply