I am not sure if this is the best community for this question, but I couldn't find one dedicated to IoT. Or should I ask on StackOverflow?
I am looking to build the following IoT system using WiFi devices: -- total 3 wifi capable devices -- devices #1 and #2 are acting as sensors. Assume they are simple ON-OFF type sensors (very infrequent state change) -- Device #3 is acting as an actuator, controlling an output ON/OFF -- Required functionality: The Device #3 should turn its output ON, when both device #1 and #2 read 'ON' on their sensors
I have spent today searching for ways to achieve this. I looked through Particle Photon, Sparkfun Thing, etc. for the devices and Thingspeak, data.sparfun.com for the cloud/internet part of it. But I couldnt see how I could achieve this. What is not clear to me is: --- how to get the message to the actuator device to turn its output ON?? Poll or send a message? how to do either?
Here is one potential approach I thought of:
- Use Sparkfun Thing for the devices
- The sensor devices use HTTP to post the sensor data to the cloud when they detect a change on their sensors values
- The actuator device, will periodically poll (by issuing HTTP GET requests) the cloud and fetch the sensors' data. And when it sees both are ON, it will drive its output ON
The problem with this is that I need quick reaction, i.e. once both the sensors read ON, I need the actuator to turn the output ON within 2-3 seconds. This means, with the "polling" method, I need to poll quite frequently, and I am not sure whether the rate-limits on Thingspeak and data.sparkfun.com will allow this.
So to summarize my questions: --- how to get the message to the actuator device to turn its output ON?? Is there a way other than polling, where a message can be sent to the device? --- Any suggestions on which platform (photon, sparkfun thing or any other) to use for this kind of project --- Any other (even totally different) suggestions on how to achieve the system with the required functionality described above