libretiny: Generic RTL8710BX doesn't start after a reboot

Hi @kuba2k2,

The Generic RTL8710BX (mentioned in my previous support requests) doesn’t start after sending a restart command or after an OTA firmware upgrade. https://docs.libretuya.ml/boards/generic-rtl8710bx-4mb-980k/

If I unplug it and plug it again it starts up.

[09:53:04][D][button:013]: 'PLUG-EZVIZ Restart' Pressed.
[09:53:04][I][restart.button:012]: Restarting device...
[09:53:04][I][app:134]: Rebooting safely...
[09:53:04][D][lt.preferences:104]: Saving 1 preferences to flash...
[09:53:04][V][lt.preferences:115]: sync: key: 233825507, len: 4
[09:53:04][D][lt.preferences:133]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
←[32mINFO Disconnected from ESPHome API for plug-ezviz.local←[0m
←[33mWARNING Disconnected from API←[0m
←[33mWARNING Can't connect to ESPHome API for plug-ezviz.local: Error connecting to ('192.168.45.123', 6053): [WinError 121] The semaphore timeout period has expired←[0m
←[32mINFO Trying to reconnect to plug-ezviz.local in the background←[0m
←[32mINFO Successfully connected to plug-ezviz.local←[0m
[09:55:04][V][json:033]: Attempting to allocate 512 bytes for JSON serialization
[09:55:04][V][json:053]: Size after shrink 60 bytes
[09:55:04][V][json:033]: Attempting to allocate 512 bytes for JSON serialization
[09:55:04][V][json:053]: Size after shrink 80 bytes
[09:55:04][V][json:033]: Attempting to allocate 512 bytes for JSON serialization
[09:55:04][V][json:053]: Size after shrink 152 bytes
[09:55:04][V][json:033]: Attempting to allocate 512 bytes for JSON serialization
[09:55:04][V][json:053]: Size after shrink 156 bytes
[09:55:04][V][json:033]: Attempting to allocate 512 bytes for JSON serialization
[09:55:04][V][json:053]: Size after shrink 148 bytes
[09:55:04][V][json:033]: Attempting to allocate 512 bytes for JSON serialization
[09:55:04][V][json:053]: Size after shrink 168 bytes
[09:55:17][V][wifi_lt:276]: Event: Connected ssid='SunnyDay' bssid=FC:EF:03:10:01:01 channel=4, authmode=WPA PSK
[09:58:37][I][ota:109]: Boot seems successful, resetting boot loop counter.
[09:58:37][D][lt.preferences:104]: Saving 1 preferences to flash...
[09:58:37][V][lt.preferences:115]: sync: key: 233825507, len: 4
[09:58:37][D][lt.preferences:133]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 31 (31 by maintainers)

Most upvoted comments

That’s weird, since I added another function to reset the chip few days ago. But that’s a story for another issue I think. I’m glad that OTA upload works now 👍

Okay, actually, hold up with that for a minute @mihsu81 … sorry for the confusion.

Seems like I found a bug in the implementation, that produces same results for me as your corrupted firmware. I’ll work on it and let you know.

RtlHardFaultDecoder: firmware at C:\Users\Bethayn-Dell\GitHub\libretuya-esphome.esphome\build\plug-ezviz.pio\build\plug-ezviz\firmware.elf does not exist, r

Thanks @dbuezas. I’ve tried it but the compilation fails.

Compiling .pioenvs\plug-ezviz\src\esphome\components\web_server\list_entities.cpp.o
src/esphome/components/socket/lwip_sockets_LT.cpp: In function 'ssize_t readv(int, const iovec*, int)':
src/esphome/components/socket/lwip_sockets_LT.cpp:13:97: error: 'lwip_readv' was not declared in this scope
 ssize_t readv(int fd_, const struct iovec *iov, int iovcnt) { return lwip_readv(fd_, iov, iovcnt);  }
                                                                                                 ^
src/esphome/components/socket/lwip_sockets_LT.cpp: In function 'const char* inet_ntop(int, const void*, char*, socklen_t)':
src/esphome/components/socket/lwip_sockets_LT.cpp:19:118: error: 'lwip_inet_ntop' was not declared in this scope
 const char * inet_ntop(int af, const void *src, char *dst, socklen_t size) { return lwip_inet_ntop(af, src, dst, size); }
                                                                                                                      ^
*** [.pioenvs\plug-ezviz\src\esphome\components\socket\lwip_sockets_LT.cpp.o] Error 1
============================================= [FAILED] Took 27.37 seconds =============================================

@mihsu81 okay, I see the corrupted characters. I’ll look into the dumps you posted later today.

About the exception decoder: it’s showing you a warning that firmware.elf doesn’t exist. I don’t know why but Esphome uses a different build folder name… Like .pioenvs instead of .pio. I’ll have to fix this somehow, but for now you can put the firmware.elf that Esphome compiled, into the path that PIO monitor shows it expects.

@dbuezas honestly I don’t think it’s caused by network issues. I see it happens when using OTA2 mostly, so there may be some problems with UF2 binpatching. That would explain the corrupted characters.