I have successfully programmed data-exchange using ESP-NOW and UDP.
With data-exchange I mean send a rather small number of bytes 10-200 in both directions. Very similiar to a serial connection.
This required to learn some details but I had it it up and running pretty quick.
As a simple example:
two ESP32 called ESP1 ESP2
ESP1 sends "time" ESP2 receives "time" and sends back
ESP2 sends "12:34" ESP1 recives "12:34"
Data-exchange done. Exchange a few bytes
By googling I tried to find something similar based on HTTP TCP.
As HTTP is used 99% for more complex things like webrequests based on HTTP-GET or HTTP-POST with complex data-structures including JSON I did not find anything that would be similar to the super-simple "send a few bytes or characters back and forth-example.
If somebody knows a link that has a demo-code that shows how to to bi-directional exchange of a few bytes back and forth
by consequent avoiding using html this would be great.
As you can see by my questions I have almost no knowledge about HTTP TCP. It might even possible that bi-directional data-exchange of a few bytes back and forth
by consequent avoiding using html is not possible.
If this is the case what would be the bare minimum = the shortest ever possible html-code that does nothing more than this example: not based on http
but based on TCP
ESP1 sends "time" ---->based on HTTP TCP------>ESP2 receives "time" and sends back
ESP2 sends "12:34" ---->based on HTTP TCP------>ESP1 receives "12:34"
EDIT: I'm very sorry I confused http with TCP. This means all the above written is meant with TCP
best regards Stefan
I don't understand what you mean by that.
Does "http session" mean If I'm focused on http as the protocol = meaning I want to use http and nothing else?
or does this mean some kind of http-communication-mode?
keep server/clients websockets opened or closed?
is telnet "on top" of http?
By this questions you can again see: I know almost nothing about how http works.
explaining more of the very basics about http or links to real basic explanations much appreciated.
HTTP is a request/response protocol so the examples show the client connecting sending receiving the response and disconnecting. And the HTTP server examples get a client reads the request, writes a response and closes.
For your communication, you can let the client connected all the time and only reconnect if the connection disconnects for some reason.
The WiFiTelnetToSerial example shows a server which doesn't disconnect clients.
I apreciate your time and effort to answer and to explain. Thank you very much.
In this case I insist on getting an direct answer to my question or get no answer.
The first question below is not meant as an inplicit request for writing a complete demo-code. It is meant as what the letters of the question say. This means the answer to this first question is: "nnnn minutes"
where "nnnn" is the number of minutes.
As a rough estimation: How many minutes would it take you to write a demo-code that demonstrates a very simple but BI-directional TCP-connection between two ESP32's that does
exactly
this:
ESP1 sends once every second "Hello ESP2 " + ESP1count++
ESP2 receive this message sending back "I'm here " + ESP1count * 10
in parallel
ESP2 sends once every 5 seconds "How are you ESP1?" + ESP2Count++
ESP1 receives this message sending back "Oh I'm fine" + ESP2Count * 1000
where ESP1count and ESP2count are variables that count up with every cycle
not more not less.
I want to emphasise again: I would like to know the rough estimated real number of minutes it takes an experienced user to write this code. So I could estimate how much time it will take me as a
total noob
to code this.
only in case the time to write such a demo-code is less than 10 minutes:
would you mind writing it and post it here?