Hello. Welcome on our pages. Here i will introduce you android application ESP8266Home. Also i will show you how to setup ESP8266 as TCP server to send or receive status as instruction from Android app. We design this app to handle sensors data on easy way. Also there is option to control relay.
The TCP server is implemented on computer or any network connected device, the router assign it an IP address and port number is assigned to it manually, to set it as a TCP server, it wait until a TCP client device request has been initiated once the TCP connection has been initiated, the server can send and receive data to and from TCP client through the corresponding port assigned. This mode is useful when users want to send or receive data through the same network, port forwarding could be an option.
The TCP client mode is implemented on a device on a network to exchange data with the TCP server, the TCP client has required the IP address of TCP server and its port number to communicate with it, once a TCP session is established between the two, the device server can send or receive data to and from the TCP client. This mode is useful when users want to establish a connection with TCP server to exchange data through the port on same network.
Communication between app and devices is over WiFi. Devices sent JSON data to application.
Here is JSON-s example:
Devices generate this JSON based on the values measured by the sensor. After this you must setup handler for this in app. It is easy, just write IP and select type of sensor. Here i will give you examples of many most popular sensors (DHT11, DHT22, Dallas DS1820, BMP280…)
On this way we can handle data from any device which has IP and broadcast data in this format. You can use ESP8266, Wemos D1, Raspberry Pi…
Here is example how to add device and use it in control:
All this devices code is free, also app is free to use. If you want special adjustments and additions you can contact me. Also i can sold you app source code.
Also my code is free but my time not, so if you need talk with me put 5$ on