I'm trying to create a APP (using APPGyver) to control some functions on a ESP8266 and to receive information of a sensor (Thermistor) on the app. To make some integrations between the app and the ESP8266, i'm using a backend (Firebase Auth and Firestore). I'm also using this backend to control the usage of the device, because it's gonna be a nxn relation (n users can control n devices and vice versa).
The problem is: I need to send the information of the sensor to the app (specifically the information of the device associated with that user). It's not that difficult to do, using the backend but, if the device keep sending this information constantly to the database, the usage of APIs would be enormous (much more than the free quota). So, is there a way to send the data from the ESP8266 directly to the APPgyver APP (much better if only to the users associated to that device)? If its not, there is other way i could do it without using a huge amount of APIs?
Just to considering, the device (esp8266) and the app could be in any web connections. Just as any IoT comercial devices.
Not knowing app, communication, and backend details, I can only make a guess. If they are inside the same local network, yes, you could use TCP direct connections or, much simpler, use UDP broadcast packets and a simple custom protocol (you can start the packets with the intended destination ID, assigned to each client, and that avoids the need of IP addresses mapping) as I did with a couple of projects.
If not, I don't think there's a simpler way to do it without cloud API. You can just reduce the API usage to let the ESP send the sensor data only when the temperature changes more than a specific amount you set as minimum measure precision (e.g. 0.5 °C) from the previous one sent to the app/backend.
if the device keep sending this information constantly to the database, the usage of APIs would be enormous (much more than the free quota).
do you need the historical data (firebase) to make decisions in the app?
you can't have the historical data at high sample rate being stored and used by many clients and not pay some price for that.
having a intermittent connexion directly between the app and the ESP82266 means that the ESP would have to store the historical data and transmit that to the app upon connexion
if everything is the same local network, running an RPi in your network with an MQTT server or MAMP or other packages would provide a central access point with history management.