DroneBridge / ESP32

DroneBridge for ESP32. A secure & transparent telemetry link with support for WiFi and ESP-NOW. Supporting MAVLink, MSP, LTM or any other protocol
Apache License 2.0
340 stars 102 forks source link

Xaio ESP32-C3/waveshare esp32-s3-zero hangs when connecting via UDP #67

Closed 4O6FPV closed 3 months ago

4O6FPV commented 3 months ago

I have uploaded the V1.5 to my xiao ESP32-C3 and am able to change pins and reboot without issues now (thanks). Yet when I connect to the FC via UDP the connection hangs as shown on the webpage status the UART received bytes stopping as soon as you hit connect on UDP. I have yet to hookup my ftdi to get some debug information but here is a video showing it. I have also hooked up 7 total ESP32 variants and have only had issues with the xiao esp32-c3 and the waveshare esp32-s3-zero both stop uart received bytes when you click on connect in MP. https://photos.app.goo.gl/kxHNWoqnFNyWZNy98 20240309_143854

seeul8er commented 3 months ago

Wow that is a lot of testing, thank you. I only have a PX4 based flight controller so I only ever test with QGroundControl. Seems like it hangs up at some point.

You might be able to get sufficient logs via the USB interface. I added a chapter in the wiki regaring logging. However, hocking up an FTDI is for sure the safest way. Maybe I'll get an Ardupilot setup as well for testing

4O6FPV commented 3 months ago

esp-web-tools-logs (1).txt @seeul8er Below is from the xiao esp32-c3. I do not see anything glaring. The uart connection simply stops as soon as you hit connect via udp. I rebooted the esp32 to see if it would show anything but nothing comes across once you hit connect via udo it just stops sending uart data as the uart received bytes on webpage just stops. I will also do a PR to add the boards I have tested and know they work into the wiki/docs. The attached log also is from the same device but there were some differences in them I couldn't understand. ESP-ROM:esp32c3-api1-20210207 Build:Feb 7 2021 rst:0x15 (USB_UART_CHIP_RESET),boot:0xb (SPI_FAST_FLASH_BOOT) Saved PC:0x40388bcc SPIWP:0xee mode:DIO, clock div:1 load:0x3fcd5820,len:0x1704 load:0x403cc710,len:0x968 load:0x403ce710,len:0x2f9c entry 0x403cc710 I (24) boot: ESP-IDF v5.1.2 2nd stage bootloader I (24) boot: compile time Mar 8 2024 18:25:20 I (25) boot: chip revision: v0.3 I (27) boot.esp32c3: SPI Speed : 80MHz I (32) boot.esp32c3: SPI Mode : DIO I (37) boot.esp32c3: SPI Flash Size : 2MB I (42) boot: Enabling RNG early entropy source... I (47) boot: Partition Table: I (51) boot: ## Label Usage Type ST Offset Length I (58) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (65) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (73) boot: 2 factory factory app 00 00 00010000 00100000 I (80) boot: 3 www Unknown data 01 82 00110000 00030000 I (88) boot: End of partition table I (92) esp_image: segment 0: paddr=00010020 vaddr=3c0c0020 size=25cb8h (154808) map I (125) esp_image: segment 1: paddr=00035ce0 vaddr=3fc91200 size=02b14h ( 11028) load I (128) esp_image: segment 2: paddr=000387fc vaddr=40380000 size=0781ch ( 30748) load I (137) esp_image: segment 3: paddr=00040020 vaddr=42000020 size=b53a0h (742304) map I (260) esp_image: segment 4: paddr=000f53c8 vaddr=4038781c size=098c8h ( 39112) load I (273) boot: Loaded app from partition at offset 0x10000 I (274) boot: Disabling RNG early entropy source... I (285) cpu_start: Unicore app I (285) cpu_start: Pro cpu up. I (294) cpu_start: Pro cpu start user code I (294) cpu_start: cpu freq: 160000000 Hz I (294) cpu_start: Application information: I (297) cpu_start: Project name: db_esp32 I (302) cpu_start: App version: v1.4-13-g532b062-dirty I (308) cpu_start: Compile time: Mar 8 2024 18:25:09 I (314) cpu_start: ELF file SHA256: 0f841d7138dcb9ff... I (320) cpu_start: ESP-IDF: v5.1.2 I (325) cpu_start: Min chip rev: v0.3 I (330) cpu_start: Max chip rev: v0.99 I (335) cpu_start: Chip rev: v0.3 I (340) heap_init: Initializing. RAM available for dynamic allocation: I (347) heap_init: At 3FC9A500 len 00025B00 (150 KiB): DRAM I (353) heap_init: At 3FCC0000 len 0001C710 (113 KiB): DRAM/RETENTION I (360) heap_init: At 3FCDC710 len 00002950 (10 KiB): DRAM/RETENTION/STACK I (368) heap_init: At 50000010 len 00001FD8 (7 KiB): RTCRAM I (375) spi_flash: detected chip: generic I (379) spi_flash: flash io: dio W (383) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header. I (396) sleep: Configure to isolate all GPIO pins in sleep state I (402) sleep: Enable automatic switching of GPIO sleep configuration I (410) app_start: Starting scheduler on CPU0 I (415) main_task: Started on CPU0 I (415) main_task: Calling app_main() I (425) DB_ESP32: Reading settings from NVS I (425) DB_ESP32: Stored settings: Wifi Mode: 1 ssid DroneBridge ESP32 wifi_pass dronebridge wifi_chan 6 baud 115200u gpio_tx 9 gpio_rx 10 gpio_cts 2 gpio_rts 3 rts_thresh 64 proto 4 trans_pack_size 64 ltm_per_packet 2 msp_ltm 0 ap_ip 192.168.2.1 I (445) pp: pp rom version: 9387209 I (455) net80211: net80211 rom version: 9387209 I (465) wifi:wifi driver task: 3fca3098, prio:23, stack:6656, core=0 I (465) wifi:wifi firmware version: 91b9630 I (465) wifi:wifi certification version: v7.0 I (475) wifi:config NVS flash: enabled I (475) wifi:config nano formating: disabled I (475) wifi:Init data frame dynamic rx buffer num: 32 I (485) wifi:Init static rx mgmt buffer num: 5 I (485) wifi:Init management short buffer num: 32 I (495) wifi:Init dynamic tx buffer num: 32 I (495) wifi:Init static tx FG buffer num: 2 I (495) wifi:Init static rx buffer size: 1600 I (505) wifi:Init static rx buffer num: 10 I (505) wifi:Init dynamic rx buffer num: 32 I (515) wifi_init: rx ba win: 6 I (515) wifi_init: tcpip mbox: 32 I (515) wifi_init: udp mbox: 6 I (525) wifi_init: tcp mbox: 6 I (525) wifi_init: tcp tx win: 5744 I (535) wifi_init: tcp rx win: 5744 I (535) wifi_init: tcp mss: 1440 I (535) wifi_init: WiFi IRAM OP enabled I (545) wifi_init: WiFi RX IRAM OP enabled I (555) wifi:set country: cc=US schan=1 nchan=13 policy=1

I (555) phy_init: phy_version 1130,b4e4b80,Sep 5 2023,11:09:30 I (585) wifi:mode : softAP (a0:76:4e:43:87:19) I (595) wifi:Total power save buffer number: 16 I (595) wifi:Init max length of beacon: 752/752 I (595) wifi:Init max length of beacon: 752/752 I (595) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1 I (605) DB_ESP32: WIFI_EVENT - AP started! (SSID: DroneBridge ESP32 PASS: dronebridge) I (645) DB_ESP32: MDNS Service started! I (645) DB_ESP32: Filesystem init finished! Partition size: total: 173441 bytes, used: 61495 bytes (35%) I (645) DB_CONTROL: Starting control module I (655) TCP_SERVER_SETUP: Opened TCP server on port 5760 I (655) DB_CONTROL: Opened UDP socket on port 14550 I (665) DB_CONTROL: Started control module I (1125) DB_HTTP_REST: Starting HTTP Server I (1125) TCP_SERVER_SETUP: Opened TCP server on port 1603 I (1125) COMM: Started communication module I (2045) main_task: Returned from app_main() I (48475) wifi:new:<1,0>, old:<1,0>, ap:<1,0>, sta:<255,255>, prof:1 I (48475) wifi:station: ce:ae:f4:71:54:63 join, AID=1, b, 20 I (48535) DB_ESP32: WIFI_EVENT - Client connected - station:ce:ae:f4:71:54:63, AID=1 I (50475) esp_netif_lwip: DHCP server assigned IP to a client, IP is: 192.168.2.2 I (50475) DB_ESP32: WIFI_EVENT - New station IP:192.168.2.2 I (50475) DB_ESP32: WIFI_EVENT - MAC: ce:ae:f4:71:54:63 I (64085) DB_HTTP_REST: File sending complete I (64195) DB_HTTP_REST: File sending complete I (136185) DB_HTTP_REST: File sending complete I (136215) DB_HTTP_REST: File sending complete I (136315) DB_HTTP_REST: File sending complete I (148875) wifi:station: ce:ae:f4:71:54:63 leave, AID = 1, bss_flags is 131105, bss:0x3fc9c384 I (148875) wifi:new:<1,0>, old:<1,0>, ap:<1,0>, sta:<255,255>, prof:1 I (148875) DB_ESP32: WIFI_EVENT - Client disconnected - station:ce:ae:f4:71:54:63, AID=1 I (148885) DB_ESP32: WIFI_EVENT - AP stopped! I (148955) wifi:flush txq I (148955) wifi:stop sw txq I (148955) wifi:lmac stop hw txq ESP-ROM:esp32c3-api1-20210207 Build:Feb 7 2021 rst:0x3 (RTC_SW_SYS_RST),boot:0xb (SPI_FAST_FLASH_BOOT) Saved PC:0x40048b82 SPIWP:0xee mode:DIO, clock div:1 load:0x3fcd5820,len:0x1704 load:0x403cc710,len:0x968 load:0x403ce710,len:0x2f9c entry 0x403cc710 I (24) boot: ESP-IDF v5.1.2 2nd stage bootloader I (24) boot: compile time Mar 8 2024 18:25:20 I (24) boot: chip revision: v0.3 I (27) boot.esp32c3: SPI Speed : 80MHz I (32) boot.esp32c3: SPI Mode : DIO I (36) boot.esp32c3: SPI Flash Size : 2MB I (41) boot: Enabling RNG early entropy source... I (46) boot: Partition Table: I (50) boot: ## Label Usage Type ST Offset Length I (57) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (65) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (72) boot: 2 factory factory app 00 00 00010000 00100000 I (80) boot: 3 www Unknown data 01 82 00110000 00030000 I (87) boot: End of partition table I (91) esp_image: segment 0: paddr=00010020 vaddr=3c0c0020 size=25cb8h (154808) map I (125) esp_image: segment 1: paddr=00035ce0 vaddr=3fc91200 size=02b14h ( 11028) load I (127) esp_image: segment 2: paddr=000387fc vaddr=40380000 size=0781ch ( 30748) load I (137) esp_image: segment 3: paddr=00040020 vaddr=42000020 size=b53a0h (742304) map I (260) esp_image: segment 4: paddr=000f53c8 vaddr=4038781c size=098c8h ( 39112) load I (273) boot: Loaded app from partition at offset 0x10000 I (273) boot: Disabling RNG early entropy source... I (285) cpu_start: Unicore app I (285) cpu_start: Pro cpu up. I (294) cpu_start: Pro cpu start user code I (294) cpu_start: cpu freq: 160000000 Hz I (294) cpu_start: Application information: I (297) cpu_start: Project name: db_esp32 I (302) cpu_start: App version: v1.4-13-g532b062-dirty I (308) cpu_start: Compile time: Mar 8 2024 18:25:09 I (314) cpu_start: ELF file SHA256: 0f841d7138dcb9ff... I (320) cpu_start: ESP-IDF: v5.1.2 I (325) cpu_start: Min chip rev: v0.3 I (329) cpu_start: Max chip rev: v0.99 I (334) cpu_start: Chip rev: v0.3 I (339) heap_init: Initializing. RAM available for dynamic allocation: I (346) heap_init: At 3FC9A500 len 00025B00 (150 KiB): DRAM I (353) heap_init: At 3FCC0000 len 0001C710 (113 KiB): DRAM/RETENTION I (360) heap_init: At 3FCDC710 len 00002950 (10 KiB): DRAM/RETENTION/STACK I (367) heap_init: At 50000010 len 00001FD8 (7 KiB): RTCRAM I (374) spi_flash: detected chip: generic I (378) spi_flash: flash io: dio W (382) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header. I (396) sleep: Configure to isolate all GPIO pins in sleep state I (402) sleep: Enable automatic switching of GPIO sleep configuration I (409) app_start: Starting scheduler on CPU0 I (414) main_task: Started on CPU0 I (414) main_task: Calling app_main() I (424) DB_ESP32: Reading settings from NVS I (424) DB_ESP32: Stored settings: Wifi Mode: 1 ssid DroneBridge ESP32 wifi_pass dronebridge wifi_chan 6 baud 115200u gpio_tx 9 gpio_rx 10 gpio_cts 2 gpio_rts 3 rts_thresh 64 proto 4 trans_pack_size 64 ltm_per_packet 2 msp_ltm 0 ap_ip 192.168.2.1 I (444) pp: pp rom version: 9387209 I (454) net80211: net80211 rom version: 9387209 I (464) wifi:wifi driver task: 3fca3098, prio:23, stack:6656, core=0 I (464) wifi:wifi firmware version: 91b9630 I (464) wifi:wifi certification version: v7.0 I (474) wifi:config NVS flash: enabled I (474) wifi:config nano formating: disabled I (474) wifi:Init data frame dynamic rx buffer num: 32 I (484) wifi:Init static rx mgmt buffer num: 5 I (484) wifi:Init management short buffer num: 32 I (494) wifi:Init dynamic tx buffer num: 32 I (494) wifi:Init static tx FG buffer num: 2 I (494) wifi:Init static rx buffer size: 1600 I (504) wifi:Init static rx buffer num: 10 I (504) wifi:Init dynamic rx buffer num: 32 I (514) wifi_init: rx ba win: 6 I (514) wifi_init: tcpip mbox: 32 I (514) wifi_init: udp mbox: 6 I (524) wifi_init: tcp mbox: 6 I (524) wifi_init: tcp tx win: 5744 I (534) wifi_init: tcp rx win: 5744 I (534) wifi_init: tcp mss: 1440 I (534) wifi_init: WiFi IRAM OP enabled I (544) wifi_init: WiFi RX IRAM OP enabled I (554) wifi:set country: cc=US schan=1 nchan=13 policy=1

I (554) phy_init: phy_version 1130,b4e4b80,Sep 5 2023,11:09:30 I (584) wifi:mode : softAP (a0:76:4e:43:87:19) I (594) wifi:Total power save buffer number: 16 I (594) wifi:Init max length of beacon: 752/752 I (594) wifi:Init max length of beacon: 752/752 I (594) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1 I (604) DB_ESP32: WIFI_EVENT - AP started! (SSID: DroneBridge ESP32 PASS: dronebridge) I (644) DB_ESP32: MDNS Service started! I (644) DB_ESP32: Filesystem init finished! Partition size: total: 173441 bytes, used: 61495 bytes (35%) I (644) DB_CONTROL: Starting control module I (654) TCP_SERVER_SETUP: Opened TCP server on port 5760 I (654) DB_CONTROL: Opened UDP socket on port 14550 I (664) DB_CONTROL: Started control module I (1124) DB_HTTP_REST: Starting HTTP Server I (1124) TCP_SERVER_SETUP: Opened TCP server on port 1603 I (1144) COMM: Started communication module I (1594) main_task: Returned from app_main() I (5314) wifi:new:<1,0>, old:<1,0>, ap:<1,0>, sta:<255,255>, prof:1 I (5314) wifi:station: ce:ae:f4:71:54:63 join, AID=1, b, 20 I (5394) DB_ESP32: WIFI_EVENT - Client connected - station:ce:ae:f4:71:54:63, AID=1 I (5694) esp_netif_lwip: DHCP server assigned IP to a client, IP is: 192.168.2.2 I (5694) DB_ESP32: WIFI_EVENT - New station IP:192.168.2.2 I (5704) DB_ESP32: WIFI_EVENT - MAC: ce:ae:f4:71:54:63 I (19834) DB_HTTP_REST: File sending complete I (19864) DB_HTTP_REST: File sending complete I (29714) DB_HTTP_REST: File sending complete I (29784) DB_HTTP_REST: File sending complete I (29914) DB_HTTP_REST: File sending complete

seeul8er commented 3 months ago

I see you have flow control enabled. Any difference when it is disabled? I'll check it in more detail tomorrow.

4O6FPV commented 3 months ago

I see you have flow control enabled. Any difference when it is disabled? I'll check it in more detail tomorrow.

to disable do you just leave rts/cts as 0 pins?

4O6FPV commented 3 months ago

@seeul8er

I am a idiot and had the cts/rts swapped on those to modules once I set the correct pin assignments it connected like a charm!!!!! Sorry for the screw up closing! I will add a little note to the wiki that if folks see that behavior to make sure and check the cts/rts pin assignments.

seeul8er commented 3 months ago

Did the same thing during implementation, that is why I asked :)