ESP32 UDP server through AT commandos

19 views Asked by At

I'm using ESP32 C6 with the AT commando server:

--- at+gmr ---
AT version:4.0.0.0(3fe3806 - ESP32C6 - Dec 29 2023 11:10:21)
SDK version:v5.1.2-dirty
compile time(89040be7):Jan  2 2024 05:53:07
Bin version:v4.0.0.0(ESP32C6-4MB)

My goal is to open the UDP server at port 8185 which worked well:

AT+CIPSTART="UDP",<"IP doesn't matter">,<remote port doesn't matter>,8185,2

I can send data from a client now and the data arrives asynchronously because of active mode (AT+CIPRECVTYPE=0). This is not very nice since data might come in any time, mixed with replies from other AT commandos and the buffering has to be done by myself. Hence, it is nicer to have AT+CIPRECVTYPE=1, which requires AT+CIPRECVDATA=<len> to fetch the data. This works to some extend. One issue I have is when two messages arrive from different clients and both messages are buffered, it is then not possible to distinguish the sender. Also I have still async. messaging e.g. "+IPD,0,100". While this async. message helps to split the receiving into the arrived packages, it only works while there are no more than two messages buffered, because it's not generated again when the second message arrives.

Do I use the AT commandos for UDP server as they are supposed to be used or not? I also played with AT+CIPMUX=1 and started multiple connections with AT+CIPSTART, but the device always reveives on the latest created connection and doesn't split depending on sender addr.

0

There are 0 answers