boot.py
Code: Select all
# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
#esp.osdebug(None)
import time
import network
yourWifiSSID = "xxx"
yourWifiPassword = "xxx"
def connect():
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print('connecting to network...')
sta_if.active(True)
sta_if.connect(yourWifiSSID, yourWifiPassword)
while not sta_if.isconnected():
pass
def showip():
sta_if = network.WLAN(network.STA_IF)
print('network config:', sta_if.ifconfig())
connect()
time.sleep(5)
showip()
import webrepl
webrepl.start()
print("waiting 5s...")
time.sleep(5)
print("boot completed...")
Code: Select all
while True:
try:
message = CAN.read_message()
if message:
print_frame(message["id"],message["data"])
if message["id"] not in IDS:
IDS.append(message["id"])
print(message["id"], message["data"])
print(IDS)
except OSError as E:
print("ERROR_IN_MAIN_LOOP",E)
machine.reset()
serial repl
Code: Select all
ets Jun 8 2016 00:22:57
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:4
load:0x3fff0034,len:5652
load:0x40078000,len:12696
load:0x40080400,len:4292
entry 0x400806b0
connecting to network...
Brownout detector was triggered
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_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:4
load:0x3fff0034,len:5652
load:0x40078000,len:12696
load:0x40080400,len:4292
entry 0x400806b0
connecting to network...
network config: ('192.168.1.152', '255.255.255.0', '192.168.1.1', '192.168.1.1')
WebREPL daemon started on ws://192.168.1.152:8266
Started webrepl in normal mode
waiting 5s...
boot completed...
Entering configuration mode...
mode already set
calulating BRP and setting configuration registers 1, 2 and 3
Entering normal mode...
mode sucessfully set
MicroPython v1.17-20-g0a5107372-dirty on 2021-09-11; ESP32 GENERIC-7789 with ESP32
Type "help()" for more information.
>>>
WebREPL connection from: ('192.168.1.249', 63110)
dupterm: EOF received, deactivating ------------------>enter wrong password
WebREPL connection from: ('192.168.1.249', 51843) --------------------------->enter correct password
webrepl interface downloaded from github
Code: Select all
Welcome to MicroPython!
Password:
Access denied
Disconnected
Welcome to MicroPython!
Password:
WebREPL connected
>>> ------------------->cannot enter any input
Any fix for my problem. Thanks!