logo elektroda
logo elektroda
X
logo elektroda

How to configure the ESP8266 for continuous WiFi communication in AP mode?

Askabius 570 3
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18131261
    Askabius
    Level 5  
    Hello,
    The internet and forums are full of similar topics, but none of them are close to my problem, unfortunately.
    I need to write a program for the ESP8266 with which I could communicate via WiFi with my phone (I already have an android app almost ready). I would like the ESP to work here in AP mode.

    The snag is that all the tutorials show this in the web/HTTP server example. This makes it impossible to send large amounts of information in small portions (e.g. 4KB). I care about very low latency, I need to send at least 4 packets per second. (1 packet consists of 2 variables in total).

    From my observations, all the courses and tutorials that show how to configure the network in ESP etc. Are based on a method which, after sending one portion of data, disconnects the client, and sending another portion involves establishing a new connection, which causes huge delays and often crashes the application.

    I would like to know if it is possible to somehow configure the WiFi connection to create a kind of permanent communication channel (such a UART, only that over WiFi).

    If anyone knows the answer to my question I would be very grateful for at least a link to a solution. Thank you for taking the time to read :) .
  • ADVERTISEMENT
  • Helpful post
    #2 18131829
    gkalfail
    Level 12  
    I personally haven't used it but supposedly "websockets" are used for this.
    Example of use: https://www.youtube.com/watch?v=8ISbmQTbjDI (CNLohr, "WebSockets for awesome on the ESP8266"), he got between 200Hz - 400Hz refresh rate.
  • ADVERTISEMENT
  • #4 18135222
    Nagus
    Level 27  
    This can be done on foot....
    Open socket
    Code: C / C++
    Log in, to see the code
    .
    For example, fire up a listen on UDP port 666:
    Code: C / C++
    Log in, to see the code
    .
    ... and then just hop the transfer with the recvfrom and sendto commands.
ADVERTISEMENT