Page 1 of 1

NodeMCU V2 Dev. Board

Posted: Tue Aug 25, 2015 9:10 pm
by thehose
Hey folks,

Trying Micropython on my NodeMCU V2 (ESP8266 12-E) development board. Playing with the REPL is fine but when I use main.py and a finite loop it never stops...

Code: Select all

import pyb
pin = pyb.Pin(14, pyb.Pin.OUT_PP)
for i in range(10):
    pin.low()
    pyb.delay(1000)
    pin.high()
    pyb.delay(1000)
    
I would expect this script to blink 10 times and return control to REPL.
Also when I connect the virtual terminal to the board I get this repeated with every blink...

Code: Select all

load 0x40100000, len 30800, room 16 
tail 0
chksum 0xd8
load 0x3ffe8000, len 1388, room 8 
tail 4
chksum 0xa3
load 0x3ffe8570, len 19964, room 4 
tail 8
chksum 0xd6
csum 0xd6
...C MEM CHECK FAIL!!!
drl..rl....b....n...nn......l.p......ll.ll.........l..n......b..l..b.......b...b..lrlr.n.......n...
 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 30800, room 16 
tail 0
chksum 0xd8
load 0x3ffe8000, len 1388, room 8 
tail 4
chksum 0xa3
load 0x3ffe8570, len 19964, room 4 
tail 8
chksum 0xd6
csum 0xd6
...C MEM CHECK FAIL!!!
drl..rl....b....n...nn......l.p......ll.ll.........l..n......b..l..b.......b...b..lrlr.n.......n...
Is as if the board reboots after every iteration.

What am I missing ????
Thanks....

Re: NodeMCU V2 Dev. Board

Posted: Wed Aug 26, 2015 2:44 pm
by SweetPeas
Looks like you are being bitten by the watch dog.
I'm not sure if there is a yield command int the esp class, that would be needed to make the ESP8266 run smoothly.

Re: NodeMCU V2 Dev. Board

Posted: Wed Aug 26, 2015 5:01 pm
by thehose
Can you elaborate (for my education) about the watch dog (timer I presume) issue. Is it causing the ESP8266 to reboot randomly (since I see the MEM CHECK failures) ??
Is this an issue with MP on ALL ESP8266s or specific to this Chinese dev. board.

Re: NodeMCU V2 Dev. Board

Posted: Sat Sep 05, 2015 12:36 am
by mianos
It would be best to use the ESP scheduler for this. It has to service the wifi in the background so you can't really spin in a loop for 1 second. I'll try and put some code up for my ESP timer module.