Lobo Micropython esp32 wlan frozen

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
alien1983
Posts: 17
Joined: Fri Sep 07, 2018 4:52 pm

Lobo Micropython esp32 wlan frozen

Post by alien1983 » Mon Oct 01, 2018 3:09 am

Hi,
If I have an automatic start wlan esp32 frozen very often during the start. If I run Wlan by manual it is much less common frozen.

#######################################
Terminal
#######################################


D (1064) nvs: nvs_get MPY_StackSize 4
D (1065) nvs: nvs_get_str_or_blob MpyTimeZone
D (1069) MicroPython: MPy stack: 0x3ffc0cb8 - 0x3ffc5cc0 (20488)
D (1075) MicroPython: Configure heap
D (1079) nvs: nvs_get MPY_HeapSize 4
D (1082) MicroPython: MPy heap: 0x3ffc5cc4 - 0x3ffd7d04 (73728)
D (1088) MicroPython: Main task exit, stack used: 1392
I (1090) MicroPython: [=== MicroPython FreeRTOS task started (sp=3ffc5c10)
===]


Internal FS (SPIFFS): Mounted on partition 'internalfs' [size: 1048576; Fl
ash address: 0x200000]
----------------
Filesystem size: 956416 B
Used: 2304 B
Free: 954112 B
----------------
MicroPython ESP32_LoBo_v3.2.24 - 2018-09-06 on ESP32 board with ESP32
Type "help()" for more information.
>>> import network
>>> network.ftp.start(user="micro", password="python", buffsize=1024, time
out=300)
False
>>>
>>>
>>>
>>>
>>> import connectWiFi
>>> connectWiFi.connect()
W (6047600) [modnetwork]: WiFi not started
I (6047675) phy: phy_version: 3960, 5211945, Jul 18 2018, 10:40:07, 0, 0
Connection successful
('192.168.188.24', '255.255.255.0', '192.168.188.1', '192.168.188.1')
>>> import network
>>> network.ftp.start(user="micro", password="python", buffsize=1024)
True
>>>
Bets 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:0x3fff0018,len:4
load:0x3fff001c,len:5976
load:0x40078000,len:9040
ho 0 tail 12 room 4
load:0x40080000,len:6120
entry 0x40080334
I (30) boot: ESP-IDF v3.1-rc1-53509c7b 2nd stage bootloader
I (30) boot: compile time 13:16:14
I (31) boot: Enabling RNG early entropy source...
I (36) boot: SPI Speed : 40MHz
I (40) boot: SPI Mode : DIO
I (44) boot: SPI Flash Size : 4MB
I (48) boot: Partition Table:
I (52) boot: ## Label Usage Type ST Offset Length
I (59) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (66) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (74) boot: 2 MicroPython factory app 00 00 00010000 001f0000
I (81) boot: 3 internalfs Unknown data 01 82 00200000 00100000
I (89) boot: End of partition table
I (93) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x735b
8 (472504) map
I (267) esp_image: segment 1: paddr=0x000835e0 vaddr=0x3ffb0000 size=0x050
40 ( 20544) load
I (276) esp_image: segment 2: paddr=0x00088628 vaddr=0x3ffb5040 size=0x000
00 ( 0) load
I (276) esp_image: segment 3: paddr=0x00088630 vaddr=0x40080000 size=0x004
00 ( 1024) load
I (284) esp_image: segment 4: paddr=0x00088a38 vaddr=0x40080400 size=0x075
d8 ( 30168) load
I (305) esp_image: segment 5: paddr=0x00090018 vaddr=0x400d0018 size=0x154
b7c (1395580) map
I (793) esp_image: segment 6: paddr=0x001e4b9c vaddr=0x400879d8 size=0x0d9
2c ( 55596) load
I (817) esp_image: segment 7: paddr=0x001f24d0 vaddr=0x400c0000 size=0x006
48 ( 1608) load
I (818) esp_image: segment 8: paddr=0x001f2b20 vaddr=0x50000000 size=0x009
8c ( 2444) load
I (838) boot: Loaded app from partition at offset 0x10000
I (839) boot: Disabling RNG early entropy source...
I (839) cpu_start: Pro cpu up.
I (843) cpu_start: Starting app cpu, entry point is 0x400812f8
I (0) cpu_start: App cpu up.
I (853) heap_init: Initializing. RAM available for dynamic allocation:
D (860) heap_init: New heap initialised at 0x3ffae6e0
I (865) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
D (871) heap_init: New heap initialised at 0x3ffbd3a8
I (876) heap_init: At 3FFBD3A8 len 00022C58 (139 KiB): DRAM
I (882) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (889) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
D (895) heap_init: New heap initialised at 0x40095304
I (900) heap_init: At 40095304 len 0000ACFC (43 KiB): IRAM
I (907) cpu_start: Pro cpu start user code
D (919) clk: RTC_SLOW_CLK calibration value: 3405581
I (35) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
D (36) heap_init: New heap initialised at 0x3ffe0440
D (40) heap_init: New heap initialised at 0x3ffe4350
D (45) MicroPython: Entry
D (1048) MicroPython: SPIRAM: Disabled
D (1048) nvs: nvs_flash_init_custom partition=nvs start=9 count=6
D (1064) MicroPython: Configure stack
D (1064) nvs: nvs_open_from_partition MPY_NVM 1
D (1064) nvs: nvs_get MPY_StackSize 4
D (1065) nvs: nvs_get_str_or_blob MpyTimeZone
D (1069) MicroPython: MPy stack: 0x3ffc0cb8 - 0x3ffc5cc0 (20488)
D (1075) MicroPython: Configure heap
D (1079) nvs: nvs_get MPY_HeapSize 4
D (1082) MicroPython: MPy heap: 0x3ffc5cc4 - 0x3ffd7d04 (73728)
D (1088) MicroPython: Main task exit, stack used: 1392
I (1090) MicroPython: [=== MicroPython FreeRTOS task started (sp=3ffc5c10)
===]


Internal FS (SPIFFS): Mounted on partition 'internalfs' [size: 1048576; Fl
ash address: 0x200000]
----------------
Filesystem size: 956416 B
Used: 2304 B
Free: 954112 B
----------------
Hello World!
MicroPython ESP32_LoBo_v3.2.24 - 2018-09-06 on ESP32 board with ESP32
Type "help()" for more information.
>>>
Bets 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:0x3fff0018,len:4
load:0x3fff001c,len:5976
load:0x40078000,len:9040
ho 0 tail 12 room 4
load:0x40080000,len:6120
entry 0x40080334
I (30) boot: ESP-IDF v3.1-rc1-53509c7b 2nd stage bootloader
I (30) boot: compile time 13:16:14
I (31) boot: Enabling RNG early entropy source...
I (36) boot: SPI Speed : 40MHz
I (40) boot: SPI Mode : DIO
I (44) boot: SPI Flash Size : 4MB
I (48) boot: Partition Table:
I (52) boot: ## Label Usage Type ST Offset Length
I (59) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (66) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (74) boot: 2 MicroPython factory app 00 00 00010000 001f0000
I (81) boot: 3 internalfs Unknown data 01 82 00200000 00100000
I (89) boot: End of partition table
I (93) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x735b
8 (472504) map
I (267) esp_image: segment 1: paddr=0x000835e0 vaddr=0x3ffb0000 size=0x050
40 ( 20544) load
I (276) esp_image: segment 2: paddr=0x00088628 vaddr=0x3ffb5040 size=0x000
00 ( 0) load
I (276) esp_image: segment 3: paddr=0x00088630 vaddr=0x40080000 size=0x004
00 ( 1024) load
I (284) esp_image: segment 4: paddr=0x00088a38 vaddr=0x40080400 size=0x075
d8 ( 30168) load
I (305) esp_image: segment 5: paddr=0x00090018 vaddr=0x400d0018 size=0x154
b7c (1395580) map
I (793) esp_image: segment 6: paddr=0x001e4b9c vaddr=0x400879d8 size=0x0d9
2c ( 55596) load
I (817) esp_image: segment 7: paddr=0x001f24d0 vaddr=0x400c0000 size=0x006
48 ( 1608) load
I (818) esp_image: segment 8: paddr=0x001f2b20 vaddr=0x50000000 size=0x009
8c ( 2444) load
I (839) boot: Loaded app from partition at offset 0x10000
I (839) boot: Disabling RNG early entropy source...
I (839) cpu_start: Pro cpu up.
I (843) cpu_start: Starting app cpu, entry point is 0x400812f8
I (0) cpu_start: App cpu up.
I (853) heap_init: Initializing. RAM available for dynamic allocation:
D (860) heap_init: New heap initialised at 0x3ffae6e0
I (865) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
D (871) heap_init: New heap initialised at 0x3ffbd3a8
I (876) heap_init: At 3FFBD3A8 len 00022C58 (139 KiB): DRAM
I (882) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (889) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
D (895) heap_init: New heap initialised at 0x40095304
I (900) heap_init: At 40095304 len 0000ACFC (43 KiB): IRAM
I (907) cpu_start: Pro cpu start user code
D (919) clk: RTC_SLOW_CLK calibration value: 3400960
I (35) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
D (36) heap_init: New heap initialised at 0x3ffe0440
D (40) heap_init: New heap initialised at 0x3ffe4350
D (45) MicroPython: Entry
D (1048) MicroPython: SPIRAM: Disabled
I (839) boot: Disabling RNG early entropy source...
I (839) cpu_start: Pro cpu up.
I (843) cpu_start: Starting app cpu, entry point is 0x400812f8
I (0) cpu_start: App cpu up.
I (853) heap_init: Initializing. RAM available for dynamic allocation:
D (860) heap_init: New heap initialised at 0x3ffae6e0
I (865) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
D (871) heap_init: New heap initialised at 0x3ffbd3a8
I (876) heap_init: At 3FFBD3A8 len 00022C58 (139 KiB): DRAM
I (882) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (889) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
D (895) heap_init: New heap initialised at 0x40095304
I (900) heap_init: At 40095304 len 0000ACFC (43 KiB): IRAM
I (907) cpu_start: Pro cpu start user code
D (919) clk: RTC_SLOW_CLK calibration value: 3400960
I (35) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
D (36) heap_init: New heap initialised at 0x3ffe0440
D (40) heap_init: New heap initialised at 0x3ffe4350
D (45) MicroPython: Entry
D (1048) MicroPython: SPIRAM: Disabled
D (1048) nvs: nvs_flash_init_custom partition=nvs start=9 count=6
D (1064) MicroPython: Configure stack
D (1064) nvs: nvs_open_from_partition MPY_NVM 1
D (1064) nvs: nvs_get MPY_StackSize 4
D (1065) nvs: nvs_get_str_or_blob MpyTimeZone
D (1069) MicroPython: MPy stack: 0x3ffc0cb8 - 0x3ffc5cc0 (20488)
D (1075) MicroPython: Configure heap
D (1079) nvs: nvs_get MPY_HeapSize 4
D (1082) MicroPython: MPy heap: 0x3ffc5cc4 - 0x3ffd7d04 (73728)
D (1088) MicroPython: Main task exit, stack used: 1392
I (1090) MicroPython: [=== MicroPython FreeRTOS task started (sp=3ffc5c10) ===]


Internal FS (SPIFFS): Mounted on partition 'internalfs' [size: 1048576; Flash address: 0x200000]
----------------
Filesystem size: 956416 B
Used: 2304 B
Free: 954112 B
----------------
Hello World!
MicroPython ESP32_LoBo_v3.2.24 - 2018-09-06 on ESP32 board with ESP32
Type "help()" for more information.
>>> import connectWiFi
>>> connectWiFi.connect()
W (59022) [modnetwork]: WiFi not started
I (59097) phy: phy_version: 3960, 5211945, Jul 18 2018, 10:40:07, 0, 0

#######################################
#######################################
boot.py
+++++++++++++++++++++++++++++++++++++++++++
import connectWiFi
connectWiFi.connect()
+++++++++++++++++++++++++++++++++++++++++++

connectWiFi.py
+++++++++++++++++++++++++++++++++++++++++++
def connect():
import network

ssid = "×××××××"
password = "××××××××××"

station = network.WLAN(network.STA_IF)

if station.isconnected() == True:
print("Already connected")
return

station.active(True)
station.connect(ssid, password)

while station.isconnected() == False:
pass

print("Connection successful")
print(station.ifconfig())
+++++++++++++++++++++++++++++++++++++++++++

The problem only occurs with wifi.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Lobo Micropython esp32 wlan frozen

Post by pythoncoder » Mon Oct 01, 2018 6:19 am

This query should be posted in the Loboris forum where it would be seen by more users of that port (including the author).
Peter Hinch
Index to my micropython libraries.

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: Lobo Micropython esp32 wlan frozen

Post by kevinkk525 » Mon Oct 01, 2018 8:47 am

I think it could be the common mistake of doing this loop:

Code: Select all

while station.isconnected() == False:
    pass
instead of:

Code: Select all

while station.isconnected() == False:
    time.sleep_ms(50)
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Lobo Micropython esp32 wlan frozen

Post by pythoncoder » Tue Oct 02, 2018 10:49 am

If so, this issue is still not fixed.

tl;dr I found it necessary to put arbitrary sleep(t) statements in ESP32 code in a doomed attempt at achieving a resilient MQTT connection. I concluded at the time (August 2017) that the ESP32 port was not yet ready for serious use.
Peter Hinch
Index to my micropython libraries.

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: Lobo Micropython esp32 wlan frozen

Post by kevinkk525 » Tue Oct 02, 2018 12:32 pm

yes it looks like that bug is still present. The wait time is not needed in mqtt anymore though, as using sockets seems to call the underlying RTOS idle methods (or similar) but a busy loop does not. I pinged loboris about that issue on his forum. Should be easy to fix this in his port by having another thread call the needed functions of RTOS (at least that's what I think :D I have no idea about the underlying code structure)
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

alien1983
Posts: 17
Joined: Fri Sep 07, 2018 4:52 pm

Re: Lobo Micropython esp32 wlan frozen

Post by alien1983 » Thu Oct 04, 2018 5:18 am

I tested this port (lobo) is unstable. It no working good . Ftp telnet webserver . it's easy to hang it.
:| you have some solution for stable work like ardiuno / raspberry pi .? Esp32 with micropython + ftp telnet/ssh + webserver?

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: Lobo Micropython esp32 wlan frozen

Post by kevinkk525 » Thu Oct 04, 2018 8:02 am

I had not much problems with lobo port. Was stable for me. Just ftp sometimes hangs a bit.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

Post Reply