-->
Page 1 of 3

Esp8266 not receiving data from sensor periodically.

PostPosted: Mon Jul 18, 2016 3:33 am
by ShantanuJ
Hi.
I have been able to make an android app communicate with the NodeMcu V3 module.

Now, I also attached a Potentiometer. The module is able to respond with the value of the pot also. But that is only when a new client connects.

How do I make the NodeMcu module constantly send the Potentiometer data to the app? So that as soon as a threshold is crossed, I will get a notification on my phone?

Re: Esp8266 not receiving data from sensor periodically.

PostPosted: Mon Jul 18, 2016 4:15 am
by rom
easiest way would be a GET Request from the Client every say 200-500ms. Answer with the ADC Value of the Potentiometer. Look for the TCP Server example and substitute conn:send(ADC_Value).

Re: Esp8266 not receiving data from sensor periodically.

PostPosted: Mon Jul 18, 2016 10:30 pm
by debojitk
You can use MQTT protocol for publish subscribe communication. With this approach you would get data from sensor in a periodic manner and take necessary actions.

Re: Esp8266 not receiving data from sensor periodically.

PostPosted: Tue Jul 19, 2016 5:40 am
by ShantanuJ
But I am trying to implement this setup on just the home wifi. Inside the home only. For this purpose also will I require MQTT server implementation?