Here's the code in my Boot.py
Code: Select all
import network
import time
wlan = network.WLAN(network.STA_IF) # create station interface
wlan.active(True) # activate the interface
print("trying to connect to WiFi")
if not wlan.isconnected(): wlan.connect('#####', '######') # connect to an AP
start_time = time.time()
while not wlan.isconnected():
if time.time() - start_time > 5:
print("failed to connect")
break
if wlan.isconnected():
print (wlan.ifconfig()) # get the interface's IP/netmask/gw/DNS addresses
import webrepl
webrepl.start()
Code: Select all
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:5656
load:0x40078000,len:12696
load:0x40080400,len:4292
entry 0x400806b0
trying to connect to WiFi
('192.168.0.146', '255.255.255.0', '192.168.0.1', '192.168.0.1')
WebREPL daemon started on ws://192.168.0.146:8266
Started webrepl in normal mode
hellow world from main.py
MicroPython v1.17 on 2021-09-02; ESP32 module with ESP32
Type "help()" for more information.
>>>