I have an ESP32 recording values from an ADC at a rate of 1 sample/second.
I need the ESP32 to send new values to a device (let's say a smartphone app for now, eventually via a server), as they are recorder on the ADC.
I've been wondering which is the best way to go about this :
Option 1: [what I've got set up now] The iOS app sens a request for a new value every second. The ESP32 then sends a response, which contains an array of every value recorded since the last request. Problem: This seems costly and very... 'lazy' (can't word it better, it just doesn't feel like a good approach)
Option 2: the iOS app sends a request to 'subscribe' for changes in the ESP's ADC. Is this considered good practice ? which is the best way to go about this ? Google search with keywprds 'ESP32' 'http' 'stream' 'ADC' yielded results with audio and video applications
Option 3: ESP POSTs new values to server. iOS app then retrives them by requesting them from server OR server pushes latest values to app.
I've been researching this for the past two days, unsuccessfully. I'm not very experienced with this, which means I don't know the right terms & keywords to research this without asking for a lead...