esp32 Wifi connection problems

protein_sheikh
Posts: 1
Joined: Tue Jun 19, 2018 12:05 pm

esp32 Wifi connection problems

Postby protein_sheikh » Wed Aug 08, 2018 3:56 pm

hi,
i am using sparkfun's 'the thing'. Along with micropython.

i am trying to connect to wifi but i am running into some problems

here is what i get back on my REPL prompt when i try to connect to two different wifi networks

Code: Select all

import weefee2
>>> weefee2.wlan_connect('oi', 'looper22')
I (37860) wifi: wifi driver task: 3ffcb834, prio:23, stack:4096, core=0
I (37860) wifi: wifi firmware version: ac8d7b4
I (37860) wifi: config NVS flash: enabled
I (37870) wifi: config nano formating: disabled
I (37870) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (37880) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (37900) wifi: Init dynamic tx buffer num: 32
I (37900) wifi: Init data frame dynamic rx buffer num: 64
I (37900) wifi: Init management frame dynamic rx buffer num: 64
I (37910) wifi: Init static rx buffer size: 1600
I (37910) wifi: Init static rx buffer num: 10
I (37920) wifi: Init dynamic rx buffer num: 0
Network Connect: (2000, 1, 1, 0, 0, 27, 5, 1)
I (37990) phy: phy_version: 3910, c0c45a3, May 21 2018, 18:07▒▒▒▒▒▒ڴj5RJB▒▒▒ʂJ▒▒▒▒▒j▒▒▒▒▒▒х▒B▒▒҂
                ▒▒▒�Ң"邢Jj▒▒▒ښ▒j%▒B▒�▒▒J▒▒▒▒▒▒E▒5EJE▒▒j5R▒ets Jun  8 2016 00:22:57







rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_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:0x3fff0018,len:4
load:0x3fff001c,len:4596
load:0x40078000,len:0
load:0x40078000,len:12768
entry 0x4007ad68
I (237) cpu_start: Pro cpu up.
I (237) cpu_start: Single core mode
I (237) heap_init: Initializing. RAM available for dynamic allocation:
I (241) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (247) heap_init: At 3FFC57D0 len 0001A830 (106 KiB): DRAM
I (253) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (260) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (266) heap_init: At 40091B28 len 0000E4D8 (57 KiB): IRAM
I (272) cpu_start: Pro cpu start user code
I (66) cpu_start: Starting scheduler on PRO CPU.
OSError: [Errno 2] ENOENT
MicroPython v1.9.4-443-gc1c798fbc on 2018-08-08; ESP32 module with ESP32
Type "help()" for more information.
>>> import network
>>> station = network.WLAN(network.STA_IF)
I (37956) wifi: wifi driver task: 3ffcb834, prio:23, stack:4096, core=0
I (37956) wifi: wifi firmware version: ac8d7b4
I (37956) wifi: config NVS flash: enabled
I (37956) wifi: config nano formating: disabled
I (37966) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (37976) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (37996) wifi: Init dynamic tx buffer num: 32
I (37996) wifi: Init data frame dynamic rx buffer num: 64
I (37996) wifi: Init management frame dynamic rx buffer num: 64
I (37996) wifi: Init static rx buffer size: 1600
I (38006) wifi: Init static rx buffer num: 10
I (38006) wifi: Init dynamic rx buffer num: 0
>>> station.active(True)
I (62096) phy: phy_version: 3910, c0c45a3, May 21 2018, 18:07:06, 1, 0
I (62096) wifi: mode : sta (24:0a:c4:81:4d:04)
I (62096) wifi: STA_START
True
>>> station.connect("oi","looper22")
I (80466) wifi: n:6 0, o:1 0, ap:255 255, sta:6 0, prof:1
I (81026) wi▒▒▒▒▒▒▒W,W▒'▒Z+▒R▒
                              ▒ѡ▒B▒Jj▒









import weefee
>>> weefee.connect()
I (35551) wifi: wifi driver task: 3ffcb834, prio:23, stack:4096, core=0
I (35551) wifi: wifi firmware version: ac8d7b4
I (35551) wifi: config NVS flash: enabled
I (35551) wifi: config nano formating: disabled
I (35561) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (35571) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (35591) wifi: Init dynamic tx buffer num: 32
I (35591) wifi: Init data frame dynamic rx buffer num: 64
I (35591) wifi: Init management frame dynamic rx buffer num: 64
I (35591) wifi: Init static rx buffer size: 1600
I (35601) wifi: Init static rx buffer num: 10
I (35601) wifi: Init dynamic rx buffer num: 0
connecting to network...
I (35681) phy: phy_version: 3910, c0c45a3, May 21 2018, 18:07▒▒▒▒▒@H▒▒+L[C▒R▒▒35681) wifi: mode : sta (24:0a:c4:81:4d:04)
I (35681) wifi: STA_START
I (36411) wifi: n:6 2, o:1 0, ap:255 255, sta:6 2, prof:1
I (36981) wifi: ▒▒▒▒▒▒▒▒▒▒▒@▒▒▒сj▒
                                  ▒ѡ▒B▒J▒▒



import weefee
>>> weefee.connect()
I (42055) wifi: wifi driver task: 3ffcb834, prio:23, stack:4096, core=0
I (42055) wifi: wifi firmware version: ac8d7b4
I (42055) wifi: config NVS flash: enabled
I (42055) wifi: config nano formating: disabled
I (42065) system_api: Base MAC address is not set, read default base MAC address                                                                                                              from BLK0 of EFUSE
I (42075) system_api: Base MAC address is not set, read default base MAC address                                                                                                              from BLK0 of EFUSE
I (42095) wifi: Init dynamic tx buffer num: 32
I (42095) wifi: Init data frame dynamic rx buffer num: 64
I (42095) wifi: Init management frame dynamic rx buffer num: 64
I (42095) wifi: Init static rx buffer size: 1600
I (42105) wifi: Init static rx buffer num: 10
I (42105) wifi: Init dynamic rx buffer num: 0
connecting to network...
I (42185) phy: phy_version: 3910, c0c45a3, May 21 2018, 18:07▒▒▒▒▒▒@0
I (42185) wifi: mode : sta (24:0a:c4:81:4d:04)
I (42185) wifi: STA_START
I (42915) wifi: n:6 2, o:1 0, ap:255 255, sta:6 2, prof:1
I (43485) wifi: state: init -> auth (b0)
I (44485) wifi: state: auth -> init (2)
▒J▒▒▒▒▒r▒▒bz▒▒b
               ▒钪▒▒▒▒b▒х▒▒b▒ɽ▒▒j▒▒▒ښ▒j%▒B▒▒▒ªJ▒▒▒▒▒▒E▒E*j▒▒▒ʪ▒U        ▒WV▒▒▒K▒                                                                                                             ڴj5R:U▒Ձj▒▒▒хѥ▒▒▒*▒▒▒▒Ձj▒▒▒хѥ▒▒▒*▒ɽ▒▒▒ɕ▒▒▒▒▒▒▒▒*▒▒BJ▒▒▒▒▒э▒Aɽ▒▒▒▒ѕ▒▒jR▒*▒▒▒▒ѥ▒▒▒                                                                                                             ▒▒́▒▒▒▒▒▒▒▒▒▒jR4▒K▒▒▒▒▒▒▒▒ѕɁ"յ▒▒jR5
                                        $$H'HL▒▒008f3e3  PS      : 0x00050033  A                                                                                                             0      : 0x8008f3e3  A1      : 0x3ffb6d40
A2      : 0x0000006f  A3      : 0x00060023  A4      : 0x4008f3c4  A5      : 0x3f                                                                                                             40732c
A6      : 0x00060623  A7      : 0x3f406bd1  A8      : 0x0000007e  A9      : 0x00                                                                                                             00007d
A10     : 0x3ff4001c  A11     : 0x00060023  A12     : 0x00000001  A13     : 0x3f                                                                                                             fb72a8
A14     : 0x00060623  A15     : 0x00000001  SAR     : 0x00000018  EXCCAUSE: 0x00                                                                                                             000014
EXCVADDR: 0x8008f3e0  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xff                                                                                                             ffffff

Backtrace: 0x4008f3e3:0x3ffb6d40 0x4008f3e0:0x3ffb6d60 0x4008f8df:0x3ffb6d80 0x4                                                                                                             0083da6:0x3ffb6da0

Rebooting...
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:0x3fff0018,len:4
load:0x3fff001c,len:4596
load:0x40078000,len:0
load:0x40078000,len:12768
entry 0x4007ad68
I (237) cpu_start: Pro cpu up.
I (237) cpu_start: Single core mode
I (238) heap_init: Initializing. RAM available for dynamic allocation:
I (241) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (247) heap_init: At 3FFC57D0 len 0001A830 (106 KiB): DRAM
I (253) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (260) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (266) heap_init: At 40091B28 len 0000E4D8 (57 KiB): IRAM
I (272) cpu_start: Pro cpu start user code
I (66) cpu_start: Starting scheduler on PRO CPU.
OSError: [Errno 2] ENOENT
MicroPython v1.9.4-443-gc1c798fbc on 2018-08-08; ESP32 module with ESP32
Type "help()" for more information.
>>>




here is weefee

Code: Select all

def connect():
    import network
    sta_if = network.WLAN(network.STA_IF)
    if not sta_if.isconnected():
        print('connecting to network...')
        sta_if.active(True)
        sta_if.connect('****','*****')
        while not sta_if.isconnected():
            pass
    print('network config:',sta_if.ifconfig())
def no_debug():
    import esp
    esp.osdebug(None)



here is weefee2

Code: Select all

def wlan_connect(essid,password,timeout=15):
    import sys, network, time
    network.WLAN(network.STA_IF).active(False)
    network.WLAN(network.AP_IF).active(False)
    print('Network Connect:',time.localtime())
    wlan = network.WLAN(network.STA_IF)
    wlan.active(True)
    if not wlan.isconnected():
        wlan.connect(essid,password)
        time.sleep(0.1)
        for x in range(timeout):
            if wlan.isconnected():
                break
            time.sleep(1)
    return_value = wlan.isconnected()
    print('Network Connect:',return_value)
    #print('Network Status:',wlan.status())
    return return_value




the weird thing is that these two methods were working fine couple of days ago.
the micropython firmware is the latest one.

Thanks

ESP_Sprite
Posts: 1762
Joined: Thu Nov 26, 2015 4:08 am

Re: esp32 Wifi connection problems

Postby ESP_Sprite » Thu Aug 09, 2018 1:44 am

Weird crashes on phy initialization usually mean that your power supply is inadequate. Could that be the case here? (If you're using an USB cable to power your board, try a different one, or try to feed your board directly using a lab power supply.)

Who is online

Users browsing this forum: No registered users and 2 guests