ty
the working arduino code I understood how it works, even if ajax.
The problem is translating that code into b4r.
I tried but it gives me Sintax error with AstreamWrite ("code ajax here")
I also tried with....
1) LittleFS (maybe the right way)
2) raWOT (too complicated)
3) B4R and #if C code .... (compilation ok but still doesn't display the page)
I have not tried that myself completely but I suppose you will use Asyncstreams.
I suppose that these are the correct steps:
Let's say that you have three pages:
http://{esp ip}
http://{esp ip}/setthedata
http://{esp ip}/getthedata
When the client sends the request you do not do anything in server_newconnection but you just set the asyncstream and let Astream_NewData handle the situation. Take a look at a recent simillar question by
@Cableguy who was asking for the buffer in AsyncStreams. Scanning the posted request text in Async_NewData you will find for what the request is supposed to be and respond with an AsyncStream write exactly the same as I wrote it in
@Cableguy 's question. In client side you just write java script code similar to the javascript above. Be sure to follow the same way I told to
@Cableguy in the response text in order to work correctly. Then when you write with asyncstream.write(...) close the connection.