So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Kevin32
#72912 Hi

I need to get info from 4 ESP8266 devices:
Please have a look at this picture.
Image
    1) User should be free to choose 4 of them that are in range. So no hardcoded names
    2) Sensors should only response their values if they are asked to do so
    3) There is no Interner available
    4) Sensors should give their info as fast as they can. If Android phone sends them request to do so
    5) If it is not possible, I can use NodeMCU as a server, which is connected to Android phone

My ideas so far:

1) Mesh network, which seems like a lot of overhead, since devices do not need to communicate with each other.
2) Wifi direct, because as I read the manual, ESPs should support it and so do Android. But I still don't know how it should work in real life... There is not much info available as well. THIS
3) Android phone act as a client, and making requests to 4 ESP8266 that are in range and that user can choose, and those 4 sensors should return their current sensor value.
4) I can make each of these sensors act as an AP, but that means I have to connect one of them, get info, then disconnect from it, and then connect another sensor, get info etc... Which is why I offered NodeMCU which can establish multiple connections. Although it
5) Your suggestions :)

Sorry if stupid question, I work as an Android developer so this all seems too vague for me. But I am a beginner in Arduino/ESP field
User avatar
By gdsports
#72998 Assuming you plan to use Arduino, I suggest you look at the ESP8266 examples include with the IDE. The following are links to github but the same code is available in the IDE.

Make an ESP8266 an access point with web server.

https://github.com/esp8266/Arduino/blob ... Portal.ino

Web client for ESP8266.

https://github.com/esp8266/Arduino/blob ... Client.ino

The hazy general idea is to have the 4 ESPs/web clients connect to the ESP AP/web server. The Android phone can connect to the ESP AP to get data. Try the other examples because there may be a better way to do what you want.