You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i using firebase-arduino for get data from firebase database and after that. i'm send data to my api by using ESP8266HTTPClient. nodemcu have an exception, I think this exception maybe happen from i'm change http fingerprint for communication with my api that using https because when i using http. nodemcu don't have any exception.
Settings in IDE
Module: Nodemcu 0.9 (ESP-12 Modulue)
Flash Size: 4MB/3MB
CPU Frequency: 80Mhz
Upload Using: SERIAL
Sketch
some my code
#include<Arduino.h>voidsetup() {
Serial.begin(250000);
//set pin modepinMode(SETTING_MODE,INPUT);
pinMode(STATE_CONNECTION,OUTPUT);
pinMode(gas_sensor, INPUT); //Set gas sensor as input
}
voidloop() {
staticuint8_t state = 0;
switch(state) {
case0 :
Serial.println("check Mode");
checkMode(state); //check modebreak;
case1 :
//auto connect wifi and firebase
Serial.println("auto connect wifi and firebase");
state = AutoConnectWifiAndFirebase();
break;
case2 :
//connect wifi
Serial.println("connect wifi and firebase");
state = ConnectwifiAndFirebase();
break;
case3 :
//handle with firebase
Serial.println("handle firebase");
handleFirebaseController(state);
break;
default :
state = 0;
}
delay(500);
}
voidhandleFirebaseController (uint8_t& state) {
while (true) {
if (isEnterOfflineMode()) {
state = 0 ;
return;
}
AnswerUplink();
handleGasSensor(); // send sensor value to FirebasecheckConnection(); //check connectiondelay(100);
}
} // handle working in FirebasevoidAnswerUplink() {
staticuint8_t uplink = 0;
uint8_t state_uplink= Firebase.getInt(uplink_path);
// handle errorif (Firebase.failed()) {
Serial.print("get status uplink failed:");
Serial.println(Firebase.error());
count_connection_lose++;
return;
}
if (state_uplink != uplink) {
uint8_t ack = state_uplink;
Firebase.setInt(ack_path,ack);
// handle errorif (Firebase.failed()) {
Serial.print("set status ack failed:");
Serial.println(Firebase.error());
count_connection_lose++;
return;
}
uplink = state_uplink;
}
} // check if have uplink signalvoidhandleGasSensor() {
double ppm = getSensorValue();
Serial.println(ppm);
staticint repeatTime = 0;
staticbool isNotify = false;
if (ppm > 2000) {
if (repeatTime > 100) {
isNotify = false;
}
if (!isNotify) {
AlertNotification(); //send fcm
isNotify = true;
}
repeatTime ++;
}
} //handle SensorvoidAlertNotification() {
http.begin(fcm_server,"A3 41 68 37 4D 94 36 8D 01 2C 68 49 05 58 D2 CC 0E 0B DE F4"); // url test server api
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
http.addHeader("Authorization", fcm_server_key);
String payload = "sdid="+DEVICE_ID;
int httpCode = http.sendRequest("POST",payload);
if (httpCode > 0 ) {
if (httpCode == HTTP_CODE_OK) {
Serial.println(http.getString());
}else{
Serial.printf("[HTTP] POST... failed, error: %s\n", http.errorToString(httpCode).c_str());
}
http.end();
}else {
count_connection_lose++;
}
} //alert notificationdoublegetSensorValue(){
float sensor_volt; //Define variable for sensor voltagefloat RS_gas; //Define variable for sensor resistancefloat ratio; //Define variable for ratiofloat sensorValue = analogRead(gas_sensor); //Read analog values of sensor
sensor_volt = sensorValue * (5.0 / 1024.0); //Convert average to voltage
RS_gas = ((5.0 * 20.0) / sensor_volt) - 20.0; //Calculate RS in fresh air
ratio = RS_gas / R0; // Get ratio RS_gas/RS_airdouble ppm_log = (log10(ratio) - b) / m; //Get ppm value in linear scale according to the the ratio valuedouble ppm = pow(10, ppm_log); //Convert ppm value to log scale//double percentage = ppm / 10000; //Convert to percentagereturn ppm;
} // get gass sensor
nodemcu have an exception when ran in this statement
......
AlertNotification(); //send fcm
.....
void AlertNotification() {
http.begin(fcm_server,"A3 89 90 37 4D 94 36 8D 01 2C 68 49 05 58 D2 CC 0E 0B DE F4"); // url test server api
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
http.addHeader("Authorization", fcm_server_key);
String payload = "sdid="+DEVICE_ID;
int httpCode = http.sendRequest("POST",payload);
if (httpCode > 0 ) {
if (httpCode == HTTP_CODE_OK) {
Serial.println(http.getString());
}else{
Serial.printf("[HTTP] POST... failed, error: %s\n", http.errorToString(httpCode).c_str());
}
http.end();
}else {
count_connection_lose++;
}
} //alert notification
Decoding 29 results
0x4022c1c4: bi_clone at /Users/igrokhotkov/e/axtls/e1/crypto/bigint.c line 265
0x4022cbb1: bi_barrett at /Users/igrokhotkov/e/axtls/e1/crypto/bigint.c line 1285
0x4022ceb0: precompute_slide_window at /Users/igrokhotkov/e/axtls/e1/crypto/bigint.c line 1323
: (inlined by) bi_mod_power at /Users/igrokhotkov/e/axtls/e1/crypto/bigint.c line 1372
0x4022bc88: trim at /Users/igrokhotkov/e/axtls/e1/crypto/bigint.c line 1197
0x4022deb1: RSA_public at /Users/igrokhotkov/e/axtls/e1/crypto/rsa.c line 242
: (inlined by) RSA_encrypt at /Users/igrokhotkov/e/axtls/e1/crypto/rsa.c line 276
0x40229fbc: send_client_key_xchg at /Users/igrokhotkov/e/axtls/e1/ssl/tls1_clnt.c line 352
0x4022a3bd: do_clnt_handshake at /Users/igrokhotkov/e/axtls/e1/ssl/tls1_clnt.c line 109
0x40203edb: ClientContext::_consume(unsigned int) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 517
: (inlined by) ClientContext::read(char*, unsigned int) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src\include/ClientContext.h line 175
0x40229db4: do_handshake at /Users/igrokhotkov/e/axtls/e1/ssl/tls1.c line 1481
: (inlined by) basic_read at /Users/igrokhotkov/e/axtls/e1/ssl/tls1.c line 1357
0x4022a15c: do_client_connect at /Users/igrokhotkov/e/axtls/e1/ssl/tls1_clnt.c line 154
0x401004d8: malloc at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266\umm_malloc/umm_malloc.c line 1664
0x40229f0c: ssl_read at /Users/igrokhotkov/e/axtls/e1/ssl/tls1.c line 265
0x40203cec: WiFiClient::_s_connected(void*, void*, signed char) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiClient.cpp line 149
0x4020437d: SSLContext::connect(ClientContext*, char const*, unsigned int) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 517
: (inlined by) WiFiClientSecure::_connectSSL(char const*) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 279
0x40203712: WiFiClient::connect(IPAddress, unsigned short) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiClient.cpp line 149
0x402046d1: WiFiClientSecure::connect(char const*, unsigned short) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 269
0x40209358: HTTPClient::connect() at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266HTTPClient\src/ESP8266HTTPClient.cpp line 197
0x40209b28: HTTPClient::sendRequest(char const*, unsigned char*, unsigned int) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266HTTPClient\src/ESP8266HTTPClient.cpp line 197
0x4020a7fc: String::changeBuffer(unsigned int) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.cpp line 720
0x4020a84b: String::reserve(unsigned int) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.cpp line 720
0x4020a87d: String::copy(char const*, unsigned int) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.cpp line 720
0x40209bd6: HTTPClient::sendRequest(char const*, String) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266HTTPClient\src/ESP8266HTTPClient.cpp line 197
0x402028f3: AlertNotification() at C:\Users\xang\Desktop\GassSensor/GassSensor.ino line 355
0x4020a5d0: Print::println(double, int) at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.cpp line 76
0x40202aa1: handleGasSensor() at C:\Users\xang\Desktop\GassSensor/GassSensor.ino line 340
0x40202aff: handleFirebaseController(unsigned char&) at C:\Users\xang\Desktop\GassSensor/GassSensor.ino line 286
0x40202b82: loop at C:\Users\xang\Desktop\GassSensor/GassSensor.ino line 87
0x4020b3f4: loop_wrapper at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/core_esp8266_main.cpp line 56
0x40100718: cont_norm at C:\Users\xang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/cont.S line 109
i wish you have sufficient information about my problem, and understand my post
The text was updated successfully, but these errors were encountered:
Basic Infos
Hardware
Hardware: Nodemcu v0.9
Description
when i using firebase-arduino for get data from firebase database and after that. i'm send data to my api by using ESP8266HTTPClient. nodemcu have an exception, I think this exception maybe happen from i'm change http fingerprint for communication with my api that using https because when i using http. nodemcu don't have any exception.
Settings in IDE
Module: Nodemcu 0.9 (ESP-12 Modulue)
Flash Size: 4MB/3MB
CPU Frequency: 80Mhz
Upload Using: SERIAL
Sketch
some my code
nodemcu have an exception when ran in this statement
......
.....
Debug Messages
decode this Exception
i wish you have sufficient information about my problem, and understand my post
The text was updated successfully, but these errors were encountered: