-1

I have transferred the values from Arduino mega to nodeMCU through serial communication. But I'm not able to transfer the values to firebase. An error is occuring -

Error compiling for board NodeMCU 1.0 (ESP-12E Module)

This is the code :

#include <ESP8266WiFi.h>

#include <FirebaseArduino.h>

// Set these to run example.
#define FIREBASE_HOST "https://agro-775df.firebaseio.com/"
#define FIREBASE_AUTH "YRyEHN5YcQ4DSdviYX5ciiqWQBwQmhAIneFlcXbK"
#define WIFI_SSID "vintage"
#define WIFI_PASSWORD "barapi"

String str;
char bu[10];
int one,two,three;
int temp,humi;

void setup() 
{

  Serial.begin(115200);

  // connect to wifi.
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  Serial.print("connecting");
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }
  Serial.println();
  Serial.print("connected: ");
  Serial.println(WiFi.localIP());

  Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);

   while(!Serial)uj{

   }
}

int n = 0;

void loop() {

if (Serial.available()) 
  {
    str=Serial.readString();
  }
  // set string value
  Firebase.setString("message",str);
  // handle error
  if (Firebase.failed()) 
{
           Serial.print("setting /message failed:");
       ``    Serial.println(Firebase.error());  
            return;
  }
  delay(1000);
}
Danny_ds
  • 11,201
  • 1
  • 24
  • 46

2 Answers2

0
  1. Go to tools->Board and then check weather your board model is selected correctly or not.
  2. Go to tools->serial port and check weather the COM port is selected correctly or not.
Jeroen Heier
  • 3,520
  • 15
  • 31
  • 32
0

Change Esp8266 board driver's version for example 2.6.3 install...Sometimes try 2-3 times

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 10 '22 at 19:45