• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

New project using platformio to upload sketch

Q&A Forum › Category: Questions › New project using platformio to upload sketch
0 Vote Up Vote Down
Roger Lakin asked 3 years ago

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.

Question Tags: Firebase_WEB_App course
12 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

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

0 Vote Up Vote Down
Roger Lakin answered 3 years ago

The board is NodeMCU 1.0(ESP-12E Module)
Sketch is uploaded with COM3

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

What about your credentials? Did you double-check?
Were you able to connect to your network before using that same board?
Regards,
Sara

0 Vote Up Vote Down
Roger Lakin answered 3 years ago

The board is NodeMCU 1.0(ESP-12E Module)
Sketch is uploaded with COM3

0 Vote Up Vote Down
Roger Lakin answered 3 years ago

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.  

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

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

0 Vote Up Vote Down
Roger Lakin answered 3 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

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

0 Vote Up Vote Down
Roger Lakin answered 3 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

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

0 Vote Up Vote Down
Roger Lakin answered 3 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi Roger.
Let us know if you need further help.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.