Jump to content
ELFORUM - Forumul electronistilor
piratu2ro

ESP 8266 si Realtime database FIREBASE

Recommended Posts

Revin si eu cu o problema, nu reusec sa mai primesc date de la un ESP 8266 intr-o baza de date firebase, atasez codul din esp poate ma poate ajuta cineva cu ceva sugestii sa il fac iar sa functioneze, multumesc mult

#include <dummy.h>
#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
#include<SoftwareSerial.h> 
#define FIREBASE_HOST "espr-ddbe1.firebaseio.com"
#define FIREBASE_AUTH "7NP2sO9qqfTUrS4IpX06eie5Be9wFlxoScHvL8uE"
#define WIFI_SSID "Ptyrr"
#define WIFI_PASSWORD "ptyt1966"

SoftwareSerial NMCU(D6 , D5); // rx and tx
String data;

void setup() {
  NMCU.begin(38400);
  Serial.begin(9600);
  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);  
}
}
void loop() {
  delay(500);
  if(NMCU.available()){  
  String data = NMCU.readString();
  delay(500);
  Serial.print("data is :");
  Serial.println(data);
  Firebase.setString("Receiving", data);
  Serial.println( "Sent");
}
}

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines