Instructions for flashing ESP8266
This commit is contained in:
		
							
								
								
									
										11
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								README.md
									
									
									
									
									
								
							| @@ -15,3 +15,14 @@ Some KiCad screenshots: | |||||||
|  |  | ||||||
| <img src="nixiesp.png"/> | <img src="nixiesp.png"/> | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ##Install | ||||||
|  |  | ||||||
|  | Boot ESP8266 with program pin held low and flash MicroPython: | ||||||
|  |  | ||||||
|  | ```bash | ||||||
|  | esptool.py --port /dev/ttyUSB0 --baud 460800 erase_flash | ||||||
|  | esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 esp8266-20170612-v1.9.1.bin  | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | Upload main.py and boot.py and adjust network configuration in boot.py accordingly. | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								boot.py
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								boot.py
									
									
									
									
									
								
							| @@ -8,26 +8,11 @@ import network | |||||||
| sta_if = network.WLAN(network.STA_IF) | sta_if = network.WLAN(network.STA_IF) | ||||||
| sta_if.active(True) | sta_if.active(True) | ||||||
| sta_if.connect("Robootikaklubi", "u4HNj3sgYK") | sta_if.connect("Robootikaklubi", "u4HNj3sgYK") | ||||||
| print("Copy paste following to WebREPL client:") |  | ||||||
| print("ws://%s:8266/" % sta_if.ifconfig()[0]) |  | ||||||
|  |  | ||||||
| # Synchronize clock | # Synchronize clock | ||||||
| import ntptime | import ntptime | ||||||
| ntptime.settime() | ntptime.settime() | ||||||
|  |  | ||||||
| # Start WebREPL server |  | ||||||
| import webrepl |  | ||||||
| webrepl.start(password="salakala") |  | ||||||
|  |  | ||||||
| # Derive hostname |  | ||||||
| import ubinascii |  | ||||||
| MAC_SUFFIX=ubinascii.hexlify(sta_if.config("mac")[-3:]) |  | ||||||
| HOSTNAME="ESP_%s" % MAC_SUFFIX.decode("ascii").upper() |  | ||||||
|  |  | ||||||
| # Perform HTTP POST request |  | ||||||
| #import urequests |  | ||||||
| #urequests.post("http://sumo.koodur.com/pub/", data=HOSTNAME) |  | ||||||
|  |  | ||||||
| # Clean up | # Clean up | ||||||
| import gc | import gc | ||||||
| gc.collect() | gc.collect() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user