bblanchon / ArduinoJson

📟 JSON library for Arduino and embedded C++. Simple and efficient.
https://arduinojson.org
MIT License
6.68k stars 1.11k forks source link

Hi Benoit Blanchon, I'd like to discuss with my issue -435 in more details #961

Closed Nuba123 closed 5 years ago

Nuba123 commented 5 years ago

I upgrade my ArduinoJson Library to V6.10.0 from library manager. And I also check the upgradation tutorial of your's and run the two examples (JsonGenerator+JsonParser). But I didn't get any output in serial monitor for the JsonParser according to your video tutorial.

So, Is that might be an issue to get error (described in issue number-435) to work with DHT11 sensor wired with ESP8266. Whereas, ESP is connected with my laptop using an USB cable and get connected via COM-3. Following are my included library

include

include

include

include

include

define FIREBASE_HOST "yourprojectname.firebaseio.com"

define FIREBASE_AUTH "W5oYCR6eqZDevkPlRR0QULmMiqi"

void setup() { Serial.begin(921600); pLease help me to sort it out as soon as possible.

mobizt commented 5 years ago

Farebase Arduino is now not support ArduinoJson v6 only v5 https://github.com/FirebaseExtended/firebase-arduino/issues/426

bblanchon commented 5 years ago

Hi @Nuba123,

First, we need to understand why the examples are not working. As far as I know JsonParserExample.ino and JsonGeneratorExample.ino work on all platform without modification. Please try again and verify that the baud rate is 9600 in the serial monitor.

Also, as @mobizt mentioned "FirebaseArduino" requires ArduinoJson 5.

Regards, Benoit

Nuba123 commented 5 years ago

Thanks @bblanchon @mobizt It helps. I installed ArduinoJson V5.13.1. And uninstalled V-6.10.1. Now the errors are resolved which I mentioned in my post (issue-435). But the new issue is arise. Would you please take a quick look on it and give me a quick feedback?

I got the error message in IDE serial monitor as "DHT11 Sensor Read Failed".

I set the baud rate in serial monitor 115200 same as in sketch Serial.begin(115200); I connected the DHT11 data pin (2) to ESP8266's D2 (GPIO 4) and define in sketch #define DHTPIN 4 . I also did test in either way. Following is the script.

include

include

include

include

//#include //#include

include

define FIREBASE_HOST "yourproject.firebaseio.com"

define FIREBASE_AUTH "000000000000000000000"

define WIFI_SSID "MMMM"

define WIFI_PASSWORD "XXXXXXXXXi"

define DHTPIN 4

define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

void setup() { Serial.begin(115200); delay(1000);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to "); Serial.print(WIFI_SSID); while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.println(); Serial.print("Connected to "); Serial.println(WIFI_SSID); Serial.print("IP Address is : "); Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
dht.begin();
} void loop() { float h = dht.readHumidity();
float t = dht.readTemperature();

if (isnan(h) || isnan(t)) {
Serial.println(F("Failed to read from DHT sensor!")); return; }

Serial.print("Humidity: "); Serial.print(h); String fireHumid = String(h) + String("%");
Serial.print("% Temperature: "); Serial.print(t); Serial.println("°C "); String fireTemp = String(t) + String("°C");
delay(4000);

Firebase.pushString("xxxx.firebaseio.com/DHT11/Humidity", fireHumid);
Firebase.pushString("xxxx.firebaseio.com/DHT11/Temperature", fireTemp);
}

bblanchon commented 5 years ago

Hi @Nuba123,

I'm sorry, this question is not about ArduinoJson anymore. I cannot afford to answer questions outside of the scope of the library. Thank you for your understanding.

Regards, Benoit

Nuba123 commented 5 years ago

Hi @bblanchon. No worries, I got my answer on the issues with DHT Sensor and Firebase from Github. And solved the problem.