Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Mai Ehab
#72138 the problem first
Code: Select all#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
//#include <SoftwareSerial.h>

#define FIREBASE_HOST "node-c251d.firebaseio.com"
#define FIREBASE_AUTH "Lod8BAO9PAcIZWiYVf6d2vWygFqxk64zFuxYYHpm"





//SoftwareSerial myserial(3, 1); // RX, TX
const char* ssid = "SE";
const char* password = "****";
const int BUFFER_SIZE = JSON_OBJECT_SIZE(2) + JSON_ARRAY_SIZE(0);  //<<<<<<<<<<<<<<<<
char hif;
char h;


void setup(){
//myserial.begin(9600);
WiFi.begin(ssid, password);
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
}


void loop() { 

// Serial.read(hif);
// Serial.read(h);

StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
JsonObject& DHT11 = jsonBuffer.createObject();
StaticJsonBuffer<100> jsonBuffer2;
JsonObject& BBM = jsonBuffer2.createObject();
StaticJsonBuffer<100> jsonBuffer3;
JsonObject& Weight = jsonBuffer3.createObject();
DHT11["Temp"] =hif;
DHT11["humidity"] = h;




 // set value in firebase
 Firebase.push("/sensor/dht", DHT11);
 Firebase.push("/sensor/Heart Pulse",BBM);
 Firebase.push("/sensor/Weight",Weight);
}


Error i get:
Code: Select allArduino: 1.8.5 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)"

In file included from F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson/Internals/../JsonBuffer.hpp:14:0,

                 from F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson/Internals/BlockJsonBuffer.hpp:10,

                 from F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson/DynamicJsonBuffer.hpp:10,

                 from F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson.hpp:10,

                 from F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson.h:8,

                 from F:\Education\arduino\libraries\firebase-arduino-master\src/Firebase.h:28,

                 from F:\Education\arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22,

                 from C:\Users\MaYoOoSh\Desktop\nodemcu\nodeMcu.ino:3:

F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson/JsonObject.hpp: In instantiation of 'bool ArduinoJson::JsonObject::setNodeValue(ArduinoJson::Internals::List<ArduinoJson::JsonPair>::node_type*, T) [with T = char; ArduinoJson::Internals::List<ArduinoJson::JsonPair>::node_type = ArduinoJson::Internals::ListNode<ArduinoJson::JsonPair>]':

F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson/JsonObject.hpp:163:39:   required from 'bool ArduinoJson::JsonObject::setNodeAt(ArduinoJson::JsonObjectKey, T) [with T = char]'

F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson/JsonObject.hpp:81:35:   required from 'bool ArduinoJson::JsonObject::set(ArduinoJson::JsonObjectKey, T, typename ArduinoJson::TypeTraits::EnableIf<(ArduinoJson::JsonObject::CanSet<T>::value && (! ArduinoJson::TypeTraits::IsReference<T>::value))>::type*) [with T = char; typename ArduinoJson::TypeTraits::EnableIf<(ArduinoJson::JsonObject::CanSet<T>::value && (! ArduinoJson::TypeTraits::IsReference<T>::value))>::type = void]'

F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson/Internals/../JsonObjectSubscript.hpp:44:5:   required from 'typename ArduinoJson::TypeTraits::EnableIf<ArduinoJson::JsonObject::CanSet<T>::value, ArduinoJson::JsonObjectSubscript<TKey> >::type& ArduinoJson::JsonObjectSubscript<TKey>::operator=(T) [with T = char; TKey = const char*; typename ArduinoJson::TypeTraits::EnableIf<ArduinoJson::JsonObject::CanSet<T>::value, ArduinoJson::JsonObjectSubscript<TKey> >::type = ArduinoJson::JsonObjectSubscript<const char*>]'

C:\Users\MaYoOoSh\Desktop\nodemcu\nodeMcu.ino:39:15:   required from here

F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson/Internals/../JsonVariant.hpp:317:3: error: 'ArduinoJson::JsonVariant::JsonVariant(T, typename ArduinoJson::TypeTraits::EnableIf<ArduinoJson::TypeTraits::IsSame<T, char>::value>::type*) [with T = char; typename ArduinoJson::TypeTraits::EnableIf<ArduinoJson::TypeTraits::IsSame<T, char>::value>::type = void]' is private

   JsonVariant(T value, typename TypeTraits::EnableIf<

   ^

In file included from F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson.hpp:12:0,

                 from F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson.h:8,

                 from F:\Education\arduino\libraries\firebase-arduino-master\src/Firebase.h:28,

                 from F:\Education\arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22,

                 from C:\Users\MaYoOoSh\Desktop\nodemcu\nodeMcu.ino:3:

F:\Education\arduino\libraries\firebase-arduino-master\src/third-party/arduino-json-5.6.7/include/ArduinoJson/JsonObject.hpp:178:25: error: within this context

     node->content.value = value;

                         ^

exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


now when i initiate one tree with JSON commands
Code: Select allStaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
JsonObject& DHT11 = jsonBuffer.createObject();

all goes okay but when i start initiate another trees i got these errors.

Note: this NodeMcu supposed to interface with Arduino and get its data from there