Using a NodeMCU-mini with Thonny

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
MMliam
Posts: 121
Joined: Mon May 07, 2018 1:08 pm

Using a NodeMCU-mini with Thonny

Post by MMliam » Wed Jul 13, 2022 3:15 pm

I've flashed micropython to two NodeMCU-mini's using Thonny, but have been unable to get the REPL. Repeating error messages keep occuring in the Shell.

FOR EXAMPLE:
load 0x3ffe8400, len 664, room 0
tail 8
chksum 0x01
csum 0x01
Fatal exception 0(IllegalInstructionCause):
�pc1=0x4020a04c, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000001, depc=0x00000000
ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 32652, room 16
tail 12
chksum 0x19
ho 0 tail 12 room 4
load 0x3ffe8000, len 1012, room 12
tail 8
chksum 0x15
load 0x3ffe8400, len 664, room 0
tail 8
chksum 0x01
csum 0x01
Fatal exception 0(IllegalInstructionCause):
�pc1=0x4020a04c, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000001, depc=0x00000000
ets Jan 8 2013,rst cause:2, boot mode:(3,6)

Has anyone on this forum had success with a NodeMCU-min using Thonny?

Mike

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: Using a NodeMCU-mini with Thonny

Post by scruss » Wed Jul 13, 2022 5:23 pm

Are you sure you've flashed the right firmware? Boot messages that include Fatal exception 0(IllegalInstructionCause) suggest the firmware doesn't match the hardware.

There are a couple of boards I've seen sold as "NodeMCU Mini": one looks like a regular NodeMCU board, the other more like the WEMOS Lolin D1 mini or Adafruit HUZZAH ESP8266. Which one do you have?

MMliam
Posts: 121
Joined: Mon May 07, 2018 1:08 pm

Re: Using a NodeMCU-mini with Thonny

Post by MMliam » Wed Jul 13, 2022 6:55 pm

Hi,
This is what I'm investigating now. I've be using builds created by Glenn20 quite successfully in ESP-01, 01S, 12E & 12F modules. The NodeMCU-mini uses a 12F. But, I'm about to download a version recommended for the NodeMCU.

Thanks for the reply, I would appreciate any other thoughts you have.
The board is referred to as a NodeMCU-mini wireless D1.

Mike

UPDATE:
Loaded the build various sites recommend for the NodeMCU-min (esp8266-1m-20220618-v1.19.1.bin)i; here's the result from the Thonny shell:

load 0x40100000, len 30720, room 16
tail 0
chksum 0x90
load 0x3ffe8000, len 996, room 8
tail 12
chksum 0x80
ho 0 tail 12 room 4
load 0x3ffe83f0, len 1080, room 12
tail 12
chksum 0xf5
csum 0xf5
Fatal exception 0(IllegalInstructionCause):
�pc1=0x4020a04c, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
ets Jan 8 2013,rst cause:2, boot mode:(3,7)

As you can see not much difference. It's possible the boards I currently have are just NodeMCU-mini knockoff's and are defective.

Mike

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: Using a NodeMCU-mini with Thonny

Post by scruss » Wed Jul 13, 2022 9:49 pm

The fact you're getting something hints there's a microprocessor behind there.

Have you tried completely erasing the flash first? Also, I find using esptool.py a little more useful for uploading firmware to esp8266 boards than Thonny: the latter hides too many error messages.

It sounds like it's a D1 Mini clone (is it squarish? If so, it's a D1 Mini clone). I've lost count of how many of these I've programmed successfully. Maybe your one is unwell?

MMliam
Posts: 121
Joined: Mon May 07, 2018 1:08 pm

Re: Using a NodeMCU-mini with Thonny

Post by MMliam » Wed Jul 13, 2022 10:19 pm

Hi,

Thonny actually uses the esptool for flashing and programming. I have loaded the esptool on my PC, but as yet haven't used it.

The module does have D1 stamped on it (for what ever that's worth); it measures 1.4" x 1" (or 3.5cm x 2.5cm).

BTW: I have another interesting issue. I have ESP-01 and ESP-01S modules, both have 1M Flash. I can have the 01S flash it LED that's on pin 2 (GPIO2), but if I try the exact same code [with the exception of changing the pin to 1 (Tx)] on the 01 it trashes the flash. I have to re-flash microPython to the board. Have you ever come across that issue?

Mike
Last edited by MMliam on Thu Jul 14, 2022 1:49 pm, edited 2 times in total.

Christian Walther
Posts: 169
Joined: Fri Aug 19, 2016 11:55 am

Re: Using a NodeMCU-mini with Thonny

Post by Christian Walther » Thu Jul 14, 2022 7:11 am

Have you tried different flash modes? Some boards and flash chips need a different setting than the default.

MMliam
Posts: 121
Joined: Mon May 07, 2018 1:08 pm

Re: Using a NodeMCU-mini with Thonny

Post by MMliam » Thu Jul 14, 2022 12:53 pm

Yes, I tried all four flash-modes offered by Thonny; it didn't make any difference.
BTW: I also tried nodemcu-pyflasher; https://github.com/marcelstoer/nodemcu- ... r/releases

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: Using a NodeMCU-mini with Thonny

Post by scruss » Thu Jul 14, 2022 3:23 pm

MMliam wrote:
Wed Jul 13, 2022 10:19 pm
Thonny actually uses the esptool for flashing and programming. I have loaded the esptool on my PC, but as yet haven't used it.
Yes, I know, but it hides most of the error messages. Running from a terminal allows you to see the full horrors. Plus (iirc) it shows you the detected flash size. At the very least, it'll give you some error messages to search for.

MMliam
Posts: 121
Joined: Mon May 07, 2018 1:08 pm

Re: Using a NodeMCU-mini with Thonny

Post by MMliam » Thu Jul 14, 2022 3:55 pm

scruss,
Referring to the D1 mini, you said:
I've lost count of how many of these I've programmed successfully.
Did you use Thonny to flash them; or just the esptool?

BTW: Some boards have a switch that puts it in to flash-mode; the mini only has a reset. How is the unit put in flash-mode? Also I've used this device:
Image

It has a flash momentary-switch, but I've never had to use it with Thonny to flash any ESP8266 modules.

Why do some information sites refer to putting a unit in flash-mode, when it doesn't seem required in all cases; how is the D1 mini put in flash mode?

Mike

MMliam
Posts: 121
Joined: Mon May 07, 2018 1:08 pm

Re: Using a NodeMCU-mini with Thonny

Post by MMliam » Thu Jul 14, 2022 8:54 pm

scruss,

Well, I tried reprogramming the NodeMCU-mini using the esptool; it erased without errors, it programmed in v1.19.1 of micropython. I then ran Thonny to see if I get the REPL. All I got was the same repeating garbage, then Thonny tries several times for REPL, then disconnects.

Basically, I got the same results with using standalone esptool as I got with Thonny.

Mike

Post Reply