Hi,
i am trying to get the ESP-NOW program to communicate with firebase. The program works but the data from 4 AM2302s is put in the same subdirectory, temperature, humidity and ID #, on firebase. The database is layed out this way:
https://imgur.com/a/Q76Rw8S
Want it to look this way:
https://imgur.com/a/SvxPsRK
The onsite html works great just unsure how to use the ID variable in the path statement.
Arduino code
Thank you
Hi.
You just need to concatenate the id number with the paths you want to use for temperature and humidity.
Instead of having this line on the setup(), that will only run only once:
database_path = "/Data/AM2302 Readings" + incomingReadings.id ;
Put in the loop() so that the id number is updated in any loop(). Add it just before sending the temperature and humidity data. If you actually want to display the “ID” string, you can change it like this:
database_path = "/Data/AM2302 Readings/" + "ID" + incomingReadings.id ;
I hope this helps.
Regards,
Sara