I’m making a temperature controlling rig using a sensor and relay output from my Photon to control a slow cooker.
I want an Android app that can act as the control interface, and allow you to set temperature, time, view those values in realtime, and start and stop the rig.
Currently I’m using an Asynctask running in a Handler to check the 5 variables with device.getVariable() every 5-10 seconds, but I’d like to get faster updates. If I set the cycle frequency too fast, the Photon falls over and reboots.
I’ve seen several posts talking about running TCP or UDP servers, is that a better idea in this application? Can I bundle variables together so I only need one request?
Yup, and I'd suggest doing that regardless. Combine your variables into an easy to parse string, and extract the needed information on the client side.
You can do the same with server sent events, which go up to 1p/s, and are pushed from the device.