Using sketch from firebase course demostration page 53. Up loading to NodeMCU board doesn’t connect to WiFi.
Copied sketch page 48 & 49. Using serial monitor indicates no connection.
Copied same code to Arduino IDE, connects ok with the following error.
…192.168.12.243
Token info: type = id token, status = on request
Token info: type = id token, status = error
Token error: code: -1, message: connection refused
Getting User UID
Trying to find out why the two errors.
Hi.
First, double-check your Wi-Fi credentials.
Then, make sure the ESP is relatively close to your router to make sure it catches Wi-Fi signal.
What board are you using?
Regards,
Sara
What about your credentials? Did you double-check?
Were you able to connect to your network before using that same board?
Regards,
Sara
Using Arduino IDE, I rechecked the credentials, they are OK. I’m wondering which one would cause the error if it was incorrect. I copied the sketch form Arduino and saved it on PlatformIO and uploaded it and it still won’t connect where the board using Arduino will.
I would like to get the PlarformIO to connect and see if I get the same token error not finding my UID.
Hi Roger.
When you say it doesn’t connect with PlatformIO, what happens exactly? What do you see in the Serial Monitor?
What was the Firebase library version you were using on Arduino IDE?
Did you reset the board after uploading the code?
Regards,
Sara
Hi Sara
Thanks for keeping inTouch. Both Arduino and PlatformIO connect to local internet but both have the same comment after resetting the board.
Token info: type = id token, status = on request
Token info: type = id token, status = error
Token error: code: -1, message: connection refused
Getting User UID
I don’t quite understand the “Token info”
I have a UID YRZG***OuW7d************MyaC3
Hi.
What lines of code did you modify? Tell me the exact line number.
Did you insert the username and password (of the user created on Firebase)?
Did you allow authentication methods on the Firebase console?
Regards,
Sara
PlatormIO sketch lines changed
#define WIFI_SSID “SSID: TMOBIL*******PT5G”
#define WIFI_PASSWORD “c8aff23*******a6b”
to
char ssid[] = “TMOBI*************”;
char password[] = “***********a6b”;
and
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
to
WiFi.begin(ssid, password);
I’ve done this on other ArduinoIDE sketch programs. Note; I didn’t have to change it on Arduno only on PlatformIO
I used authentication methods on the Firebase console when I started the new project. I inserted my user name (email) and password. Is that why I didn’t get the token? Should I start the project all over again?
Roger
Hi again.
Did you use that username and password on the lines of code:
// Insert Authorized Email and Corresponding Password
#define USER_EMAIL "REPLACE_WITH_THE_USER_EMAIL"
#define USER_PASSWORD "REPLACE_WITH_THE_USER_PASSWORD"
And the Project API KEY?
// Insert Firebase project API Key
#define API_KEY "REPLACE_WITH_YOUR_PROJECT_API_KEY"
Maybe it is better to start the project all over again. Maybe you’re missing some of the steps…
Regards,
Sara
Sara,
I use both email & password along with api_key.
Yes, I was thinking of starting a simular project over again. I’m new at IoT. I have several projects that work on my local wifi. I want to learn how to install them to the cloud. I have a project with the Arduino sketch and an app with Android. I plan to work on that later. The other project is following the project in your Firebase Web course book. I will keep trying. Thanks for your help.
Roger