Data lost on ESP32 with AT command 'AT+CIPSENDEX' with V2.2 and V2.4

BerndW
Posts: 3
Joined: Wed Jun 01, 2022 7:05 am

Data lost on ESP32 with AT command 'AT+CIPSENDEX' with V2.2 and V2.4

Postby BerndW » Wed Jun 01, 2022 7:43 am

Hello,

I am using the ESP32-WROOM in combination with an STM32 microcontroller. I use UART port for AT command communication.

When I send data to a server via UDP (AT+CIPSENDEX) and at the same time the server sends data too, then the esp32 lost some byte of the data the STM32 sent and I do not get the response ‘Recv xxx bytes’. I tested the original firmware for the ESP32 and the esp-at source code. This issue is reproducible with firmware V2.2 and V2.4. It works fine with V2.1. I can not use V2.1 for my project because I need IPV6 support.

I added a debug message in function at_port_read_data in source at_uart_task.c. The function uart_read_bytes reads all the time all data the STM32 sent. But I do not get the response ‘Recv xxx bytes’ and ‘SEND OK’.

Does anybody knows this issue?

Thanks for any hint in advance!!

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: Data lost on ESP32 with AT command 'AT+CIPSENDEX' with V2.2 and V2.4

Postby ESP_Sun » Wed Jun 01, 2022 11:19 am

Maybe you can tell me about how many bytes you send each time to ESP32 through STM32, and what is the approximate probability of recurrence of this problem so that I can reproduce it? Are you sure that STM32 has been sent out? You can connect the TX of STM32 to display how much data is sent by STM32 on the computer, and connect the RX of ESP32 to display how much data ESP32 receives

BerndW
Posts: 3
Joined: Wed Jun 01, 2022 7:05 am

Re: Data lost on ESP32 with AT command 'AT+CIPSENDEX' with V2.2 and V2.4

Postby BerndW » Thu Jun 02, 2022 12:23 pm

When I send > 200 Byte to the ESP32 it is reproducible every second time. If I try to send 1000 Byte I can reproduce it to 90%. It is very important, that the ESP32 receive Data on that UDP Port at the same time over WiFi!
I am really sure that the STM sends data, because I add an printf to the function “at_port_read_data” in source “at_uart_task.c”. So I can see, that all data will be received in that function but the ESP32 do not send a response like ‘Recv xxx bytes’ OR ‘SEND OK’. If I send one or two extra Byte to the ESP32 then I get a response as expected. So the ESP lost some bytes internal.

Pay attention to the fact that version 2.0 and 2.1 working fine!!! Only v2.2 and 2.4 are working bad!

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: Data lost on ESP32 with AT command 'AT+CIPSENDEX' with V2.2 and V2.4

Postby ESP_Sun » Mon Jun 06, 2022 3:09 am

Hi,

Maybe you can try to use flow control (AT+UART_CUR=115200,8,1,0,3 (https://docs.espressif.com/projects/esp ... d-in-flash) ) to see if that improves the issue.

We use AT+CIPSENDEX in v2.2 and v2.4 (https://docs.espressif.com/projects/esp ... anded-ways) may need to pay attention to the following points, maybe you can check whether the data you send involves '\'
When the requirement of data length is met, or when the string \0 (0x5c, 0x30 in ASCII) appears, the transmission of data starts. Go back to the normal command mode and wait for the next AT command.

If the data contains the \<any>, it means that drop backslash symbol and only use <any> character.

When sending \0, please use a backslash to escape it as \\0.

BerndW
Posts: 3
Joined: Wed Jun 01, 2022 7:05 am

Re: Data lost on ESP32 with AT command 'AT+CIPSENDEX' with V2.2 and V2.4

Postby BerndW » Tue Jun 07, 2022 7:40 am

Hello,

your hint, that the at command 'AT+CIPSENDEX' has been changed helps a lot!!!

I use 'AT+CIPSEND' now and everythink works as expected!

Many thanks for your great support!

Who is online

Users browsing this forum: No registered users and 20 guests