Hello Rui /Sara
I was having a problem with building the software for this project in VScode/Platformio. I have used this Platformio with Arduino extension many times in my various projects with the ESP32, and have not had any issues with the serial ports.
Creating the project in Platformio and entering the code from page 47/48 of the pdf, when building an error resulted: ” \SoftwareSerial.cpp:42:27: fatal error: avr/interrupt.h: No such file or directory”. This was resolved (I think…) by finding an EspSoftwareSerial library in the Arduino libraries and copying (renaming it to SoftwareSerial) this to the .platformio/lib/SoftwareSerial folder. After this, the build worked and downloading to the ESP32 resulted in a connection the Firebase db as per the pdf. (and the serial monitor worked).
Just wondering if you any idea why this happened?
Many thanks in advance, and I am enjoying your work on this project.
Best Regards,
Paul Smulders
Hi Paul.
I’m not sure.
Maybe your ESP32 boards’ installation is outdated?
That error never happened to me before…
I’m sorry that I can’t help much.
Regards,
Sara
Hello Sara, One step forward …. I\’ve managed to connect to the data base, but \”Permissions denied\” results when trying to write data via the sendFloat() function. I\’ve changed the db Rules to: \”read\” : true and \”write\” : true and all works properly. (restoring the Rules results in Permission Denied again). I\’ve verified the email and password (even changed the password) to no avail. Any ideas on next steps for trouble-shooting this issue would be welcome. Best Regards, Paul
Hi.
That may be because your user UID doesn’t match the UID you have on the database.
Check your database nodes and that you are trying to write to the nodes under the node with the user UID. See page 31 and 32.
Regards,
Sara
Hi Sara,
The issue I’m having is when I set the DB Rules to “write”: true then all works well and values are written to the db. I imagine this means the User uid is correct (and also the s/w obtains (reads) the uid (line 132 of the code). When I change the DB Rules to “write”: $uid === auth.id” then permission to write is denied. I’ve changed the password to something simple and verified the e-mail address (no luck). I’ve finally copied the entire code from the resources (inserting the appropriate API_KEY etc.) but no luck, same result. Any ideas ??
Best Regards,
Paul
Hi.
No, that doesn’t mean that. That means exactly the opposite.
Please double-check the user UID on the database and that the UID is the same written by the ESP board when you first run the sketch, and the same that is on the Users table on the Firebase Console.
Please, let me know if this is confusing, I can try to send some pictures.
Regards,
Sara
Hi Sara,
I’ve checked (ie copied from the Console and pasted into sketch as a comment in order to verify) the UID on the database (Authentication/Users/User UID) and it matches with the ESP board when the sketch is first run.
Any ideas ??
I’ve continued on with sec 3.4 Streaming DB, works as long as db Rules are set to true.
BR Paul
Hi.
If all UIDs match, I don’t know what else could be the issue 😐
I’m sorry that I can’t help much.
Regards,
Sara
Hi Sara,
After more checking, it appears using “$uid === auth.id” is not a good idea …
should be “$uid === auth.uid”. All is working now with email/password authentication DB Rules.
Sorry for the trouble … just an old guy messing with stuff.
BR Paul