ESP01 1M Flash 512 and 1M MicroPython Neither Responds?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

ESP01 1M Flash 512 and 1M MicroPython Neither Responds?

Post by Jibun no kage » Thu Aug 04, 2022 4:12 pm

ESP01 1M Flash 512 and 1M MicroPython Neither Responds? I have used Tasmotizer in Windows 11, and even esp-tool in Linux, and multiple ESP01 modules, and everything works, Tasmota, esp-tool loading tasmota lite. But I can't see to get MicroPython on an ESP01 to respond after flash? Repeated the same steps in Thonny flashing to a generic ESP8266 1M module, works, in Thonny. But same steps on ESP01 MicroPython not connected or responding. What am I mssing? I know the ESP01 is limited but it should work with the 512kiB variant if not the 1Mbit variant right? The generic ESP8266 only has 1Mbit like the ESP01. I am using a USB loader for the ESP01, but it has a UART vs. programming switch. Wondered if it was the CH340 driver in Windows, but both the ESP01 and the generic ESP8266 use CH340. So I finally tried to use 'screen' in Linux, it would not connect to /dev/ttyUSB0, even though it was present and used for flashing.

Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Re: ESP01 1M Flash 512 and 1M MicroPython Neither Responds?

Post by Jibun no kage » Thu Aug 04, 2022 4:47 pm

I did not resolved this... the firmware USB loader, can't communicate or Thonny or screen in Linux? I pulled a USB-to-UART board, connected the power, GND, TX, and RX pins as applicable (all 3.3 given it was a ESP01) and neither Thonny nor screen (iin Linux) saw the ESP01 module as expected, just as it can't see the bootloader USB board. So, I am not sure what am missing. I have tried the 1Mbit build, the 512kiB build, both stable and nightly images. But I know the ESP01 module is good, because I can flash it with Tasmota, works fine. I can flash it, with the Arduino IDE and run C compiled code.

Here is the 512kiB image test... Maybe someone will spot something I am missing?

# esptool.py --port /dev/ttyUSB1 flash_id
esptool.py v4.2
Serial port /dev/ttyUSB1
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 34:94:54:62:00:66
Uploading stub...
Running stub...
Stub running...
Manufacturer: 5e
Device: 3214
Detected flash size: 1MB
Hard resetting via RTS pin...

# esptool.py --port /dev/ttyUSB1 flash_id
esptool.py v4.2
Serial port /dev/ttyUSB1
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 34:94:54:62:00:66
Uploading stub...
Running stub...
Stub running...
Manufacturer: 5e
Device: 3214
Detected flash size: 1MB
Hard resetting via RTS pin...

# esptool.py --port /dev/ttyUSB1 erase_flash
esptool.py v4.2
Serial port /dev/ttyUSB1
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 34:94:54:62:00:66
Stub is already running. No upload is necessary.
Erasing flash (this may take a while)...
Chip erase completed successfully in 1.7s
Hard resetting via RTS pin...

# esptool.py --port /dev/ttyUSB1 write_flash --flash_size=detect 0 ./esp8266-512k-20220802-unstable-v1.19.1-229-g579f33050.bin
esptool.py v4.2
Serial port /dev/ttyUSB1
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 34:94:54:62:00:66
Stub is already running. No upload is necessary.
Configuring flash size...
Auto-detected Flash size: 1MB
Flash will be erased from 0x00000000 to 0x00078fff...
Flash params set to 0x0020
Compressed 494360 bytes to 331251...
Writing at 0x00039e15... (52 %)
...

Wrote 494360 bytes (331251 compressed) at 0x00000000 in 29.3 seconds (effective 135.1 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...

# screen /dev/ttyUSB1 115200
[No Connection... Nothing]

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

Re: ESP01 1M Flash 512 and 1M MicroPython Neither Responds?

Post by davef » Thu Aug 04, 2022 6:18 pm

It has been a year or more since I played with the ESP-01, maybe this helps:

Hold GPIO0 low
Plug in USB
sudo esptool.py --chip esp8266 --port /dev/ttyUSB0 erase_flash

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

Re: ESP01 1M Flash 512 and 1M MicroPython Neither Responds?

Post by Roberthh » Thu Aug 04, 2022 7:23 pm

You could also try the various flash modes. And if by chance you use putty: set flow control to none.

Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Re: ESP01 1M Flash 512 and 1M MicroPython Neither Responds?

Post by Jibun no kage » Thu Aug 04, 2022 9:58 pm

Will give it go... I have not been using PuTTY but can of course. Been using Thonny shell, and Linux screen so far.

Flash modes dio, dout both failed to connect. keep, qio, and qout all flashed, but none resulted in connection. Still can't get to REPL of device.
Last edited by Jibun no kage on Fri Aug 05, 2022 12:40 am, edited 1 time in total.

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

Re: ESP01 1M Flash 512 and 1M MicroPython Neither Responds?

Post by scruss » Thu Aug 04, 2022 11:46 pm

as I mentioned elsewhere, ESP01s are no fun with MicroPython. Use any other ESP8266 board but those

Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Re: ESP01 1M Flash 512 and 1M MicroPython Neither Responds?

Post by Jibun no kage » Fri Aug 05, 2022 12:39 am

Unapologetic paraphrase, "It tasks me. It tasks me and I shall have It!"

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

Re: ESP01 1M Flash 512 and 1M MicroPython Neither Responds?

Post by Roberthh » Fri Aug 05, 2022 6:27 am

I have not been using PuTTY but can of course.
For Linux I use picocom and in rare cases tio (which has a nice timestamp feature).

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

Re: ESP01 1M Flash 512 and 1M MicroPython Neither Responds?

Post by scruss » Fri Aug 05, 2022 4:09 pm

So the last flash you did gave every indication of being successful. The last time I (grudgingly) flashed these things I had to remember to a) remove the GPIO0 - GND jumper or connection required to put it into flash mode; b) physically disconnect and reconnect the device to USB for the ESP01 to reset properly. I have forgotten to do a) several times.

If you get a REPL, you could try reflashing with the ESP8266 with 1MiB flash binary, as your board reports it's an ESP01s with Detected flash size: 1MB. This is a slightly less un-fun configuration

Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Re: ESP01 1M Flash 512 and 1M MicroPython Neither Responds?

Post by Jibun no kage » Sat Aug 06, 2022 7:37 pm

Thanks guys, I know this is crazy path, but I just have to try to do it, it has gotten under my skin. I will try what you suggest. I have been trying to use the UART mode of the flash loader, and your suggestion mirrors my gut feeling that the flash is actually good but the ESP is not booting correctly.

I realized the boot sequence might be at issue, (thank you capt. obvious where ever you are) because when I was playing around with an ESP01 in the Arduino IDE, had a sketch which compiled and downloaded, but after reset nothing happened. I had to burn/install the boot loader via the Arduino IDE. That was not something I recalled having to do, but given I had done a full erase before with esptool, then full firmware load, it seemed like a clue with the boot sequence, either the code or invocation of said code.

As a counter point, the goal was to use ESP01 as WiFI (modem) but not use AT command set, with an original Pico. This I did get working using Arduino IDE, created a simple ESP WiFi/MQTT sketch, that forwards to Pico UART, and receives from Pico UART, applicable results, which then the ESP sketch communicates in turn.

So I have a working scenario, but if I can get the entire solution based on MicroPython what would be cool! If my ESP01 was not 1M, I think the sketch would be only realistic option. And it may still be, but until I get MicroPython working on the ESP01, no validation.

Post Reply