Thanks I did the erase:
Code: Select all
c:\>esptool.py --port COM3 erase_flash
esptool.py v2.8
Serial port COM3
Connecting........_
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: a0:20:a6:08:71:54
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 2.6s
Hard resetting via RTS pin...
c:\>
Then uploaded the .bin:
Code: Select all
c:\>esptool.py --port COM3 --baud 460800 write_flash --flash_size=detect 0 C:\Users\perigalacticon\Documents\Arduino\esp8266-20191220-v1.12.bin
esptool.py v2.8
Serial port COM3
Connecting........_____.
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: a0:20:a6:08:71:54
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 1MB
Flash params set to 0x0020
Compressed 619828 bytes to 404070...
Wrote 619828 bytes (404070 compressed) at 0x00000000 in 9.1 seconds (effective 545.1 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
c:\>
Then I reset the board, actually, it needs a power cycle to start it. I can run the MP command prompt normally from serial. Now, I already see the hotspot network: "MicroPython-067154" is available in the wireless networks list on my PC. I connect to it and I can ping 192.168.1.4.
I cannot connect to the WebREPL at this point using the local html file or the MP website, the response is "disconnected."
When I list files using uPyLoader I see boot.py now. When I get the file, this is the contents viewing from Notepad++:
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()
I uncomment the 2 webrepl lines, save the file and transfer the file back to the ESP. Now when I connect over serial I run:
Code: Select all
08:11:08.113 -> >>> help()
08:11:15.684 -> Welcome to MicroPython!
08:11:15.684 ->
08:11:15.684 -> For online docs please visit http://docs.micropython.org/en/latest/esp8266/ .
08:11:15.785 -> For diagnostic information to include in bug reports execute 'import port_diag'.
08:11:15.785 ->
08:11:15.785 -> Basic WiFi configuration:
08:11:15.785 ->
08:11:15.785 -> import network
08:11:15.785 -> sta_if = network.WLAN(network.STA_IF); sta_if.active(True)
08:11:15.785 -> sta_if.scan() # Scan for available access points
08:11:15.785 -> sta_if.connect("<AP_name>", "<password>") # Connect to an AP
08:11:15.785 -> sta_if.isconnected() # Check for successful connection
08:11:15.785 -> # Change name/password of ESP8266's AP:
08:11:15.785 -> ap_if = network.WLAN(network.AP_IF)
08:11:15.785 -> ap_if.config(essid="<AP_NAME>", authmode=network.AUTH_WPA_WPA2_PSK, password="<password>")
08:11:15.785 ->
08:11:15.785 -> Control commands:
08:11:15.785 -> CTRL-A -- on a blank line, enter raw REPL mode
08:11:15.785 -> CTRL-B -- on a blank line, enter normal REPL mode
08:11:15.785 -> CTRL-C -- interrupt a running program
08:11:15.785 -> CTRL-D -- on a blank line, do a soft reset of the board
08:11:15.785 -> CTRL-E -- on a blank line, enter paste mode
08:11:15.785 ->
08:11:15.785 -> For further help on a specific object, type help(obj)
08:11:15.785 -> >>> import webrepl
08:12:12.731 -> >>> webrepl.start()
08:12:32.481 -> WebREPL is not configured, run 'import webrepl_setup'
08:12:32.481 -> >>> import webrepl_setup
08:12:53.780 -> WebREPL daemon auto-start status: enabled
08:12:53.780 ->
08:12:53.780 -> Would you like to (E)nable or (D)isable it running on boot?
08:12:53.780 -> (Empty line to quit)
08:12:53.780 -> > E
08:13:03.393 -> To enable WebREPL, you must set password for it
08:13:03.393 -> New password (4-9 chars): python
08:13:11.660 -> Confirm password: python
08:13:18.025 -> No further action required
08:13:18.025 -> >>>
Now I can still ping 192.168.4.1, but the response at the WebREPL webpage is still "disconnected".
file:///C:/Users/perigalacticon/Documents/Arduino/webrepl-master/webrepl.html#192.168.4.1:8266/
or
http://micropython.org/webrepl/#192.168.4.1:8266/
even after refreshing the pages. Now if I reset the ESP, I get:
Code: Select all
WebREPL daemon started on ws://192.168.4.1:8266
08:26:14.861 -> Started webrepl in normal mode
08:26:14.861 ->
08:26:14.861 -> MicroPython v1.12 on 2019-12-20; ESP module with ESP8266
08:26:14.861 -> Type "help()" for more information.
08:26:14.861 -> >>>
Now at this point I am able to login to the WebREPL webpages and it runs correctly.
I think a few more board resets were necessary in my case to get through the procedures correctly. Thanks for the help.