ESP32S v1.1 NodeMcu board, can't connect to WiFi if usb is connected
Posted: Fri Oct 25, 2024 3:36 pm
Code: Untitled.txt Select all
Hi, I have a simple code in MicrpPython to connect to Wi-Fi, just to reproduce the error.
import network, requests, json
from machine import Pin
import time
ssid="branca"
pwd="zzzzzzzzz"
led=Pin(2,Pin.OUT)
led.off()
# Crea objeto de red wifi
wlan=network.WLAN(network.STA_IF)
# # Conecta a la red wifi
if not wlan.isconnected():
print ('Connecting to ' + ssid, end=' -> ')
wlan.active(True)
time.sleep(1)
wlan.connect(ssid, pwd)
timeout=0
while not wlan.isconnected() and timeout <10:
print(str(timeout), end=',')
time.sleep(1)
timeout+=1
ip=wlan.ifconfig()[0]
print("Conectado. IP: ", ip)
led.on()
If I have the usb cable connected to an IDE, the board resets with this error:
Connecting to branca -> ets Jul 29 2019 12:21:46
rst:0x8 (TG1WDT_SYS_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:4728
load:0x40078000,len:14888
load:0x40080400,len:3368
entry 0x400805cc
W (54) boot.esp32: PRO CPU has been reset by WDT.
W (54) boot.esp32: WDT reset info: PRO CPU PC=0x40081b4b
W (56) boot.esp32: WDT reset info: APP CPU PC=0x40081b4b
If I close the IDE, the program runs normally.
Is there a hardware malfunction .?. The board functioned well 2 days ago !!!!!