Closed lcervo closed 4 months ago
From your description and the provided log snippet, it appears that the error occurs during the NTP time synchronization process. This issue is likely due to temporary network problems, such as network fluctuations or disconnections, which cause the NTP request to fail intermittently.
However, please note that our system includes a retry mechanism that will automatically attempt to synchronize the time again after a short delay. This means that even if the initial attempt to get the NTP time fails, the system should eventually succeed in obtaining the correct time without requiring a manual reboot.
To better understand and assist with this issue, could you please provide us with the following additional information:
hi, this is the log dump:
MPY: soft reboot
MP boot @38878ms
prepare paths
D (39084): Loading config
C (39090): Start VOBOT v1.0.4 VOBOT-PRD REV2
D (39107) DEVMON: device monitor started
D (39109): asyncio loop forever
D (39110) DH: Dock Hub Start
init: I2C(0, scl=18, sda=17, freq=80000)
I (39283) BUZZER: buzzer init
~D (39319) CFGPRJ: Project ConfigMgr init
init CH455
init: UART(2, baudrate=19200, bits=8, parity=1, stop=1, tx=8, rx=-1, rts=-1, cts=-1, txbuf=0, rxbuf=129, timeout=0, timeout_char=0)
I (39457) NET: network init
W (39579) DH: NFC not enabled
D (39587) CACT: check action init
Double buffer 19200
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x8 (TG1WDT_SYS_RST),boot:0x2a (SPI_FAST_FLASH_BOOT)
Saved PC:0x420b6613
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3810,len:0x1784
load:0x403c9700,len:0x4
load:0x403c9704,len:0x1048
load:0x403cc700,len:0x3004
entry 0x403c9954
I (26) boot: ESP-IDF v5.2.1 2nd stage bootloader
I (26) boot: compile time Jun 19 2024 17:47:27
W (26) boot: Unicore bootloader
I (29) boot: chip revision: v0.2
I (33) qio_mode: Enabling default flash chip QIO
I (38) boot.esp32s3: Boot SPI Speed : 80MHz
I (43) boot.esp32s3: SPI Mode : QIO
I (48) boot.esp32s3: SPI Flash Size : 8MB
W (53) boot.esp32s3: PRO CPU has been reset by WDT.
W (58) boot.esp32s3: APP CPU has been reset by WDT.
I (64) boot: Enabling RNG early entropy source...
I (69) boot: Partition Table:
I (73) boot: ## Label Usage Type ST Offset Length
I (80) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (87) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (95) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (102) boot: 3 factory factory app 00 00 00010000 000d0000
I (110) boot: 4 ota_0 OTA app 00 10 000e0000 00620000
I (117) boot: 5 vfs Unknown data 01 81 00700000 00100000
I (125) boot: End of partition table
I (129) esp_image: segment 0: paddr=000e0020 vaddr=3c1f0020 size=11cd94h (1166740) map
I (315) esp_image: segment 1: paddr=001fcdbc vaddr=3fc9e800 size=0325ch ( 12892) load
I (317) esp_image: segment 2: paddr=00200020 vaddr=42000020 size=1e8a10h (2001424) map
I (624) esp_image: segment 3: paddr=003e8a38 vaddr=3fca1a5c size=0375ch ( 14172) load
I (627) esp_image: segment 4: paddr=003ec19c vaddr=40374000 size=1a7bch (108476) load
I (650) esp_image: segment 5: paddr=00406960 vaddr=500007f8 size=00808h ( 2056) load
I (651) esp_image: segment 6: paddr=00407170 vaddr=600fe000 size=0003ch ( 60) load
I (667) boot: Loaded app from partition at offset 0xe0000
I (668) boot: Disabling RNG early entropy source...
I (668) cpu_start: Multicore app
I (672) octal_psram: vendor id : 0x0d (AP)
I (677) octal_psram: dev id : 0x02 (generation 3)
I (683) octal_psram: density : 0x03 (64 Mbit)
I (688) octal_psram: good-die : 0x01 (Pass)
I (693) octal_psram: Latency : 0x01 (Fixed)
I (699) octal_psram: VCC : 0x01 (3V)
I (704) octal_psram: SRF : 0x01 (Fast Refresh)
I (709) octal_psram: BurstType : 0x01 (Hybrid Wrap)
I (715) octal_psram: BurstLen : 0x01 (32 Byte)
I (721) octal_psram: Readlatency : 0x02 (10 cycles@Fixed)
I (727) octal_psram: DriveStrength: 0x00 (1/1)
I (733) MSPI Timing: PSRAM timing tuning index: 5
I (737) esp_psram: Found 8MB PSRAM device
I (742) esp_psram: Speed: 80MHz
I (755) cpu_start: Pro cpu start user code
I (755) cpu_start: cpu freq: 240000000 Hz
I (755) cpu_start: Application information:
I (755) cpu_start: Compile time: Jun 7 2024 14:21:53
I (755) cpu_start: ELF file SHA256: 855373051...
I (755) cpu_start: ESP-IDF: v5.2.1
I (755) cpu_start: Min chip rev: v0.1
I (756) cpu_start: Max chip rev: v0.99
I (756) cpu_start: Chip rev: v0.2
I (756) heap_init: Initializing. RAM available for dynamic allocation:
I (756) heap_init: At 3FCB3D58 len 000359B8 (214 KiB): RAM
I (756) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
I (757) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (757) heap_init: At 600FE03C len 00001FAC (7 KiB): RTCRAM
I (757) esp_psram: Adding pool of 8192K of PSRAM memory to heap allocator
I (758) spi_flash: detected chip: gd
I (758) spi_flash: flash io: qio
W (758) rmt(legacy): legacy driver is deprecated, please migrate to driver/rmt_tx.h
and/or driver/rmt_rx.h
W (758) i2c: This driver is an old driver, please migrate your application code to adapt driver/i2c_master.h
I (759) sleep: Configure to isolate all GPIO pins in sleep state
I (759) sleep: Enable automatic switching of GPIO sleep configuration
I (759) coexist: coex firmware version: 77cd7f8
I (760) coexist: coexist rom version e7ae62f
I (760) main_task: Started on CPU0
I (761) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (761) main_task: Calling app_main()
I (769) main_task: Returned from app_main()
I (769) MAIN: MP Task Heap Size=0x426843 Addr=0x3c310a88 Stack Size=0x8000
MP boot @774ms
prepare paths
D (957): Loading config
C (963): Start VOBOT v1.0.4 VOBOT-PRD REV2
D (979) DEVMON: device monitor started
D (981): asyncio loop forever
D (982) DH: Dock Hub Start
I (991) modsocket: Initializing
init: I2C(0, scl=18, sda=17, freq=80000)
I (1146) BUZZER: buzzer init
~D (1180) CFGPRJ: Project ConfigMgr init
init CH455
I (1196) uart: ALREADY NULL
init: UART(2, baudrate=19200, bits=8, parity=1, stop=1, tx=8, rx=-1, rts=-1, cts=-1, txbuf=0, rxbuf=129, timeout=0, timeout_char=0)
I (1314) NET: network init
I (1315) pp: pp rom version: e7ae62f
I (1316) net80211: net80211 rom version: e7ae62f
I (1317) wifi:wifi driver task: 3fccd768, prio:23, stack:6656, core=0
I (1318) wifi:wifi firmware version: a9f5b59
I (1318) wifi:wifi certification version: v7.0
I (1318) wifi:config NVS flash: disabled
I (1318) wifi:config nano formating: disabled
I (1319) wifi:Init data frame dynamic rx buffer num: 32
I (1319) wifi:Init static rx mgmt buffer num: 5
I (1319) wifi:Init management short buffer num: 32
I (1319) wifi:Init static tx buffer num: 16
I (1320) wifi:Init tx cache buffer num: 32
I (1320) wifi:Init static tx FG buffer num: 2
I (1320) wifi:Init static rx buffer size: 1600
I (1320) wifi:Init static rx buffer num: 16
I (1320) wifi:Init dynamic rx buffer num: 32
I (1321) wifi_init: rx ba win: 16
I (1321) wifi_init: tcpip mbox: 32
I (1321) wifi_init: udp mbox: 6
I (1321) wifi_init: tcp mbox: 6
I (1321) wifi_init: tcp tx win: 5760
I (1322) wifi_init: tcp rx win: 5760
I (1322) wifi_init: tcp mss: 1440
I (1322) wifi_init: WiFi/LWIP prefer SPIRAM
W (1442) DH: NFC not enabled
D (1450) CACT: check action init
Double buffer 19200
I (1468) spi_bus: SPI2 bus created
I (1469) spi_bus: SPI2 bus device added, CS=10 Mode=0 Speed=60000000
I (1520) lcd st7789: MADCTL=a0
I (1520) bsp_lcd: Screen name : [ST7789] | width : [320] | height : [240]
I (1577) gpio: GPIO[41]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3
I (1577) gpio: GPIO[40]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3
D (1578) BTN: pin ENTER 39 active 0
D (1592) BTN: pin BACK 0 active 0
LCD backlight use PWM 4
D (1629) NET: networks start
D (1631) DEV_OTA: device ota started
I (1633) DIAG: diag init
D (1638) NET: wifi setup by user
D (1640) NET: trying wifi
D (1641) NETW: connect wifi now
I (1641) phy_init: phy_version 640,cd64a1a,Jan 24 2024,17:28:12
I (1673) wifi:mode : sta (dc:da:0c:1e:21:c4)
I (1673) wifi:enable tsf
I (1674) MOD_DIAG: core 0 event: WIFI_EVENT id=40
I (1674) wifi: STA_START
I (1674) MOD_DIAG: core 0 event: WIFI_EVENT id=2
-------- [2, 2, bytearray(b'')]
-------- [2, 2, bytearray(b'')]
I (1690) NETW: connect to ssid[LC-IOT] pwd[**]
D (1693) NETW: #0 connecting WiFi
LCD duty= 511
I (1723) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1
D (1744) APP_MGR: custom apps found: ['photo_album', 'work_calendar']
I (2117) wifi:state: init -> auth (b0)
I (2122) wifi:state: auth -> assoc (0)
I (2135) wifi:state: assoc -> run (10)
I (2170) wifi:connected with LC-IOT, aid = 14, channel 1, BW20, bssid = e6:b3:70:f2:bf:f6
I (2170) wifi:security: WPA2-PSK, phy: bgn, rssi: -87
I (2171) wifi:pm start, type: 1
I (2171) wifi:dp: 1, bi: 102400, li: 3, scale listen interval from 307200 us to 307200 us
I (2172) wifi:set rx beacon pti, rx_bcn_pti: 14, bcn_timeout: 25000, mt_pti: 14, mt_time: 10000
I (2172) network: CONNECTED
I (2173) MOD_DIAG: core 0 event: WIFI_EVENT id=4
-------- [2, 4, bytearray(b'LC-IOT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xe6\xb3p\xf2\xbf\xf6\x01\x03\x00\x00\x00\x00\x00\x00\x00')]
I (2218) wifi:dp: 2, bi: 102400, li: 4, scale listen interval from 307200 us to 409600 us
I (2218) wifi:AP's beacon interval = 102400 us, DTIM period = 2
I (2229) wifi:
I (10113) wifi:
I (10185) wifi:dp: 1, bi: 102400, li: 3, scale listen interval from 307200 us to 307200 us
I (10185) wifi:set rx beacon pti, rx_bcn_pti: 14, bcn_timeout: 25000, mt_pti: 14, mt_time: 10000
I (10186) network: CONNECTED
I (10186) MOD_DIAG: core 0 event: WIFI_EVENT id=4
I (10205) wifi:dp: 2, bi: 102400, li: 4, scale listen interval from 307200 us to 409600 us
I (10205) wifi:AP's beacon interval = 102400 us, DTIM period = 2
I (10212) wifi:
I (23527) wifi:
I (24773) wifi:dp: 1, bi: 102400, li: 3, scale listen interval from 307200 us to 307200 us
I (24773) wifi:set rx beacon pti, rx_bcn_pti: 14, bcn_timeout: 25000, mt_pti: 14, mt_time: 10000
I (24774) network: CONNECTED
I (24774) MOD_DIAG: core 0 event: WIFI_EVENT id=4
I (24783) wifi:
In my app is there a way to detect when the network is up and running so that it can start properly (invoking on_start)? I saw there is a net.connected() but it returns just a boolean and not an async. Do I need to create a loop and check for a truthy return value ? It's a bit an overkill isn't it? Any alternatives?
After reviewing the logs, we found that your device encountered an error (Error code WIFI_REASON_MISSING_ACKS) after completing the WiFi connection during the boot phase. This led to the WiFi disconnection and subsequently caused the NTP time synchronization to fail. However, after retrying, the connection was restored, and the NTP time was successfully synchronized.
The WIFI_REASON_MISSING_ACKS error indicates that the device failed to receive the expected acknowledgment (ACK) frames, resulting in a communication interruption. This could be related to your network environment.
Regarding your concern about detecting when the network is up and running, you do not need to check the network status in the on_start function. The on_start function should only handle the initialization of your program. You can check the network status in the on_running_foreground() function by calling net.connected(). Please note that once the application becomes active, the system will call on_running_foreground() approximately every 200 milliseconds, allowing you to periodically check the network connection status.
ok! I implemented that the logic in the on_running_foreground(). I have another question. I have a button added to the screen and I attached an event to it. How can I trigger that event using the click of the rotary button?
Once you add an event to the component and focus on it following this example, the button event registration will be complete:
scr.add_event(event_handler, lv.EVENT.ALL, None)
lv.group_get_default().add_obj(scr)
lv.group_focus_obj(scr)
When you press the button, the event will be triggered and the event_handler
function will be executed. You can write the event_handler
function as shown in the example below:
def event_handler(e):
code = e.get_code()
if code == lv.EVENT.CLICKED:
# Event triggered when the encoder button is pressed.
# You can write the logic for the encoder button press here.
elif code == lv.EVENT.KEY and e.get_key() == lv.KEY.ESC:
# Event triggered when the ESC key is pressed.
# You can write the logic for the ESC key press here.
By following this approach, you can trigger the event using the click of the rotary button.
that was it!! thank you!!!
Hi, I am developing my own app therefore I am rebooting the vobot many times. Every so often I am getting the following error that forces me to reboot the device again.
D (3692) NTP: sync time from: pool.ntp.org I (3702) wifi:idx:1 (ifx:0, e6:b3:70:f2:bf:f6), tid:6, ssn:2, winSize:64
E (10701) NTP: unable to get NTP time
Traceback (most recent call last):
File "core/nwk/ntp.py", line 53, in _ntp
OSError: -202
D (10702) NTP: wait 3s
Is it something I can do to prevent this to happen?