Trouble flashing the image

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
Tillmario
Posts: 18
Joined: Mon Nov 19, 2018 2:06 pm

Trouble flashing the image

Post by Tillmario » Mon Nov 19, 2018 3:15 pm

Hello,
i bought a NodeMCU ESP8266 and wanted to try MicroPyhton, since I am familiar with Python on my Raspberry Pi.

The ESP8266 is connected via USB to my PC (Windows 10).

I'm using this Tutorial. http://docs.micropython.org/en/latest/e ... html#intro
But I'm stuck at 1.4

Is "esptool" a way to get the Firmware from my PC to the ESP8266?
Or is it something i need to do after I allready flashed the firmware.

Allthough not mentioned in the Tutorial, I used the nodemcu-flasher and the flashing process worked. After connecting with putty however i just saw a green cursor and couldn't type anything. Pushing "reset" on the board led to quickly changing short text. According to this video, which I followed, something else was supposed to happen. https://youtu.be/yVU1wdHwIlQ?t=278

Can anyone help me?
Greetings, Tom

HermannSW
Posts: 197
Joined: Wed Nov 01, 2017 7:46 am
Contact:

Re: Trouble flashing the image

Post by HermannSW » Mon Nov 19, 2018 5:16 pm

> Pushing "reset" on the board led to quickly changing short text.
>
How did you connect to the module?
MicroPython runs by default with 115200 baud.
Under Linux I start serial session with this command:

Code: Select all

$ screen /dev/ttyUSB0 115200
Pico-W Access Point static file webserver:
https://github.com/Hermann-SW/pico-w

Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454

webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell

Tillmario
Posts: 18
Joined: Mon Nov 19, 2018 2:06 pm

Re: Trouble flashing the image

Post by Tillmario » Mon Nov 19, 2018 5:30 pm

>"How did you connect to the module?"
via Putty

>"MicroPython runs by default with 115200 baud."
That's how i did it with Putty, the video explained it like that as well.

I have more than one board. I figured out, that with another one I can connect. After connecting I get the following text, but i still can't type anything.

▒▒▒cl▒br$r
NodeMCU custom build by frightanic.com
branch: master
commit: 4095c408e6a8cc9718cb06007b408d0aad15d9cd
SSL: false
modules: file,gpio,net,node,tmr,uart,wifi
build created on 2018-11-12 11:51
powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9)
lua: cannot open credentials.lua
stack traceback:
[C]: in function 'dofile'
init.lua:2: in main chunk
[C]: ?

HermannSW
Posts: 197
Joined: Wed Nov 01, 2017 7:46 am
Contact:

Re: Trouble flashing the image

Post by HermannSW » Mon Nov 19, 2018 6:44 pm

The messages you se are definitely lua and not MicroPython.
Your flashing of MicroPython image did fail.

Which image did you try to flash?
How much flash does your module have?

I use ESP-01 (512KB) and ESP-01s (1MB) ESP8266 modules, and only the 1MB MicroPython images make sense to me.
Last edited by HermannSW on Mon Nov 19, 2018 6:47 pm, edited 1 time in total.
Pico-W Access Point static file webserver:
https://github.com/Hermann-SW/pico-w

Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454

webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell

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

Re: Trouble flashing the image

Post by Christian Walther » Mon Nov 19, 2018 6:45 pm

Tillmario wrote:
Mon Nov 19, 2018 3:15 pm
Is "esptool" a way to get the Firmware from my PC to the ESP8266?
Or is it something i need to do after I allready flashed the firmware.
esptool runs on your PC, not on the MicroPython board, and yes, it is a tool to flash the firmware onto the board.
After connecting with putty however i just saw a green cursor
This is normal even in the successful case – you are at the REPL but can’t see the prompt because it was sent before you connected. Press return to see the prompt on the next line, or just start typing.
and couldn't type anything.
This however is not – apparently something didn’t work. I suggest you try flashing with esptool, and if that does not work either, report back with what command line you used and what its output was.
Pushing "reset" on the board led to quickly changing short text.
This is also normal, the boot output is sent at a different baud rate (I don’t know the exact number offhand, look it up), so it only appears as gibberish when connected at 115200.
I have more than one board. I figured out, that with another one I can connect. After connecting I get the following text, but i still can't type anything.
This is obviously Lua output, not Python, so MicroPython was not installed at all there. I’m not sure if you should be able to type at this point, Lua seems to have some error too and may not have arrived at its REPL yet.

Tillmario
Posts: 18
Joined: Mon Nov 19, 2018 2:06 pm

Re: Trouble flashing the image

Post by Tillmario » Mon Nov 19, 2018 10:01 pm

Thanks for the help so far. This sheds light on some things.

I now succesfully flashed the MicroPython firmware. Afterwards i connected via Putty to my COM5 Port @115200 Speed. This is shown.

Code: Select all

{l$ܞ|▒l▒|
▒
d▒b|▒▒▒{▒#▒
#▒▒o▒lNn▒▒cbp▒▒#$`rlp▒o▒
▒
$
B
o▒|▒l$
#▒|~▒o▒l▒▒$`▒o▒{lnr▒▒▒n
Bl p▒n▒
r▒ܜ▒▒
#
o▒|$l
b▒▒on▒▒$`▒nl`N{▒▒▒o
▒l▒$p▒o▒
r▒▒▒▒▒
▒{▒
"
N▒|섌▒▒c▒▒No▒
l ▒o
▒lor▒ےn
ld`rےn
ld`▒l▒▒|▒r{Nb▒▒l▒p▒
c▒lc䌜▒▒▒l䏀b▒bd`$
dܾ▒▒▒{Nb▒▒l$▒d
B▒
c䌜▒▒b▒c▒
▒#$`▒$ܞ|▒2▒▒rNc▒▒▒▒▒
"▒
c䌜▒▒
▒c▒l#l▒▒▒▒N▒▒p▒▒n|▒
lldl`c▒▒▒▒|r▒l▒N▒▒n▒l ▒▒r▒d▒▒▒
$`▒▒{▒l▒$2▒
l ▒�o▒$
▒▒▒
l$`rl▒▒o▒▒c
▒▒#|
$b▒▒#|▒▒▒▒llB▒▒N▒no▒▒$n▒▒
▒
d▒$l▒▒▒▒
$`▒n▒▒▒c$l䌎▒
#▒▒#l
▒brl{ls▒N▒▒▒▒▒oܞ#▒▒B▒b▒܄▒▒|▒l▒▒lrl▒▒$o▒ps$▒l▒▒|▒▒{r▒#4 ets_task(40100130, 3, 3fff83ec, 4)
OSError: [Errno 2] ENOENT

MicroPython v1.9.4-8-ga9a3caad0 on 2018-05-11; ESP module with ESP8266
Type "help()" for more information.
>>>
However i still got the problem, that I can't type anything. I tried the "help()" but nothing happenes. The green cursor stays where it is.
I can set "Local echo" to "Force on" in the Putty/Terminal Settings and then I can type but still after "help()" there is no help.

Tillmario
Posts: 18
Joined: Mon Nov 19, 2018 2:06 pm

Re: Trouble flashing the image

Post by Tillmario » Mon Nov 19, 2018 11:35 pm

Update:
Putty -> Connections -> Serial
I set Flow-Control to "None", now I can write. :)

HermannSW
Posts: 197
Joined: Wed Nov 01, 2017 7:46 am
Contact:

Re: Trouble flashing the image

Post by HermannSW » Tue Nov 20, 2018 1:26 pm

Good that you finally found solution.
What does "gc.mem_free()" show on your module just after power on?
Pico-W Access Point static file webserver:
https://github.com/Hermann-SW/pico-w

Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454

webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell

Tillmario
Posts: 18
Joined: Mon Nov 19, 2018 2:06 pm

Re: Trouble flashing the image

Post by Tillmario » Tue Nov 20, 2018 5:19 pm

HermannSW wrote:
Tue Nov 20, 2018 1:26 pm
What does "gc.mem_free()" show on your module just after power on?
25920

I think there was some "lua" firmware preinstalled :roll:

Thanks for all the help.

Post Reply