Page 1 of 1

ESP32S v1.1 NodeMcu board, can't connect to WiFi if usb is connected

Posted: Fri Oct 25, 2024 3:36 pm
by Aporfirio
  1. Hi, I have a simple code in MicrpPython to connect to Wi-Fi, just to reproduce the error.
  2. import network, requests, json
  3. from machine import Pin
  4. import time
  5.  
  6. ssid="branca"
  7. pwd="zzzzzzzzz"
  8. led=Pin(2,Pin.OUT)
  9.  
  10. led.off()
  11.  
  12. # Crea objeto de red wifi
  13. wlan=network.WLAN(network.STA_IF)
  14.  
  15. # # Conecta a la red wifi
  16. if not wlan.isconnected():
  17.     print ('Connecting to ' + ssid, end=' -> ')
  18.     wlan.active(True)
  19.     time.sleep(1)
  20.     wlan.connect(ssid, pwd)
  21.     timeout=0
  22.     while not wlan.isconnected() and timeout <10:
  23.         print(str(timeout), end=',')
  24.         time.sleep(1)
  25.         timeout+=1
  26. ip=wlan.ifconfig()[0]
  27. print("Conectado. IP: ", ip)
  28. led.on()
  29.  
  30. If I have the usb cable connected to an IDE, the board resets with this error:
  31.  
  32. Connecting to branca -> ets Jul 29 2019 12:21:46    
  33.  
  34. rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
  35. configsip: 0, SPIWP:0xee
  36. clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
  37. mode:DIO, clock div:2
  38. load:0x3fff0030,len:4728
  39. load:0x40078000,len:14888
  40. load:0x40080400,len:3368
  41. entry 0x400805cc
  42. W (54) boot.esp32: PRO CPU has been reset by WDT.    
  43. W (54) boot.esp32: WDT reset info: PRO CPU PC=0x40081b4b
  44. W (56) boot.esp32: WDT reset info: APP CPU PC=0x40081b4b
  45.  
  46. If I close the IDE, the program runs normally.
  47. Is there a hardware malfunction .?. The board functioned well  2 days ago !!!!!
  48.