logo elektroda
logo elektroda
X
logo elektroda

ESP8266 - How to send temperature data from one module to another via UDP?

krzysiekwfd 5937 33
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #31 16503443
    krzysiekwfd
    Level 11  
    such as
    Code: C / C++
    Log in, to see the code


    or so
    Code: C / C++
    Log in, to see the code
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #33 16506657
    krzysiekwfd
    Level 11  
    Is this correct?

    Code: C / C++
    Log in, to see the code
    .

    I also tried the 2nd way with this displaying a frame of 2 pages, but that does not work either because it shows me the same page in a frame
    the code looks like this
    Code: C / C++
    Log in, to see the code



    the best thing is that I tested it by pasting another page and everything works then??maybe someone knows how to remedy it
  • #34 16512067
    krzysiekwfd
    Level 11  
    I managed to do the whole thing another way.

Topic summary

The discussion addresses how to transmit temperature data between two ESP8266 ESP-01 modules, with one running a web server on port 80 displaying its own temperature and the goal to also show temperature from the second module on the same webpage. Initial suggestions include embedding the second module's webpage via an iframe in the first module's HTML, avoiding direct UDP communication. Challenges arise in assigning static IP addresses to the modules, especially when using a Windows 10 mobile hotspot as the network, which complicates fixed IP configuration due to subnet mismatches and lack of router access. Solutions involve correctly setting static IPs within the hotspot's subnet range (e.g., 192.168.137.x), specifying gateway, subnet mask, and DNS parameters in WiFi.config(), and ensuring the order of WiFi configuration and connection calls is correct. For inter-module communication, a recommended approach is to have the second ESP send its temperature to the first via HTTP GET requests with parameters, which the first ESP stores and displays alongside its own data. The first ESP's web server then serves a combined page with both temperature readings. Code examples illustrate HTTP GET request formatting, proper URL parameter passing, and HTML iframe embedding. The discussion also highlights common pitfalls such as incorrect IP subnet settings, improper HTTP request formatting (e.g., misuse of Content-Length), and network conflicts when static IPs are assigned without router control. Ultimately, the solution favors HTTP GET communication between ESP modules over UDP for simplicity and reliability in this context.
Summary generated by the language model.
ADVERTISEMENT