I use ESP8266-01 with the AT Interface in UDP-Mode.
After connecting to my LAN I jump into the passthrough mode and use the ESP
as UART-Bridge. So far so good.
From time to time I want to check from my application, if the connection to the
access point already exists. For that I did not find any other way than
- stop passthrough (+++)
- ask for the CIPStatus
- Parse the answer for the status
- (if OK:) Start Passthrough again.
This is for sure not the cleanest solution. But is it the only one? Does someone has a
hint for a better solution?
Normally I send short telegrams by sending them into the uart. When stopping, the
ESP creates a WLAN UDP telegram and sends it to my server.
I realize in passthrough when I send larger amount of bytes, that the ESP
from itself sends a UDP-Telegram after app. 65ms. (my Program did not stop sending)
As I can see, at 19200 Baud after app. 130 Byte there is a Telegram of 100 bytes sent by
the ESP itself without the application stopping sending.
Because of my native Telegram is longer than that and the server expects a longer (and complete) one,
I get errors in the server application. For that I had to exceed my protocol to reconstruct
the whole telegram out of parts...
With slower Baudrates the bytes sent by itself is less so I estimate its a time threshold ....?
I couldn't find anything about this behaviour in the documentation. Did I miss it?
Thank you very much!
Usually the application should send heart beat to keep alive with the server.
About Q2, maybe due to my poor English, I do not understand what the problem is, do you mean that you want to send 130 bytes but only 100 bytes are sent? Some bytes are missing? If that is your question, maybe you can enable the UART flow control to test it again.
Keep alive may be complicated. Assume that the connection is broken down. Then passthrough is switched off and the ESP AT-Interface will revceive the keep-alive-question instead of the Server application. It (the ESP) will not understand the Keep-Alive-protocol and will answer with some error messages... and I have to parse it and analyze it and differentiate it from the correct (Server-)answer.....
It is an option. Will think about it.
19200 Baud. I like to send a 200Byte Telegram. The python interface at server side [serverSock.recvfrom(1024)] waits until it receives a (complete?) telegram. I don't know the underlying WLAN Protocoll. And therefore I don't know how the interface decides if a telegram has been delivered completely. But my application presumes that the serverSock always delivers a complete telegram.
Now I recognizes that, when I push the bytes into the ESP-UART, that the ESP sends a first 100 Byte package when approx. 130 Bytes have been sent to the UART. And these 100 Bytes are then delivered (Server-side-application) by serverSock as a complete telegram. But it is not complete. The complete one needs 200 Bytes. And after that the server application notices missing bytes (no wonder....)
Hopefully my problem is more clear now ....
Who is online
Users browsing this forum: Bing [Bot] and 1 guest
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
We also have a RTOS version and a MESH version too!
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!