Hi members:
I’m doing a simple project passing two float values: temperature and humidity from BME280 esp8266 master device to micro-OLED slave esp8266 device. I’m confusing with the BLYNK_WRITE function. I got core dump message during the slave execution. Please help me debugging.
/*Master code*/
/* -BME280-
5V - VCC
GND - GND
D1 - SCL
D2 - SDA
*/
#include <ESP8266WiFi.h>
#include <Wire.h>
#include <SoftwareSerial.h>
#include <BlynkSimpleEsp8266.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#define SEALEVELPRESSURE_HPA (1013.25)
char ssid[] = "blahblahblah1";
char pass[] = "blahblahblah2";
char LocalAuthToken[] = "blahblahblah4";
char RemoteAuthToken[] = "blahblahblah3";
WidgetBridge bridge1(V1);
WidgetBridge bridge2(V2);
Adafruit_BME280 bme;
void setup() {
Serial.begin(115200);
Wire.begin();
Serial.println("Connecting wifi");
Blynk.begin(LocalAuthToken, ssid, pass);
while (Blynk.connect() == false);
bridge1.setAuthToken(RemoteAuthToken);
bridge2.setAuthToken(RemoteAuthToken);
bool status;
status = bme.begin(0x76);
if (!status) {
Serial.println("Could not find a valid BME280 sensor, check wiring!");
while (1);
}
}
void loop() {
Blynk.run();
//------get data from BME280------
blynkupdate();
}
void blynkupdate() {
bridge1.virtualWrite(V1, bme.readTemperature());
bridge2.virtualWrite(V2, bme.readHumidity());
}
/*Slave Code*/
#include <ESP8266WiFi.h>
#include <Wire.h>
#include <SFE_MicroOLED.h>
#include <SoftwareSerial.h>
#include <BlynkSimpleEsp8266.h>
#define PIN_RESET -1
#define DC_JUMPER 0
char ssid[] = "blahblahblah1";
char pass[] = "blahblahblah2";
char RemoteAuthToken[] = "blahblahblah3";
char LocalAuthToken[] = "blahblahblah4";
MicroOLED oled(PIN_RESET, DC_JUMPER);
WidgetBridge bridge1(V1);
WidgetBridge bridge2(V2);
float value1, value2;
BLYNK_WRITE(V1)
{
value1=param.asFloat();
}
BLYNK_WRITE(V2)
{
value2=param.asFloat();
}
void setup() {
Serial.begin(115200);
Wire.begin();
Serial.print("Connecting:");
Serial.println(ssid);
Blynk.begin(LocalAuthToken, ssid, pass); //start blynk
while (Blynk.connect() == false);
bridge1.setAuthToken(RemoteAuthToken);
bridge2.setAuthToken(RemoteAuthToken);
Blynk.syncAll();
}
void loop() {
Serial.print("Temp="); Serial.println(value1);
Serial.print("Humi="); Serial.println(value2);
display_update();
}
void display_update() {
//------Update OLED------
oled.clear(PAGE); oled.setFontType(0);
oled.setCursor(0, 0); oled.print(value1);
oled.setCursor(0, 32); oled.print(value2);
oled.display();
}
19:08:49.754 -> Connecting wifi
19:08:56.605 -> Temp=0.00
19:08:56.605 ->
19:08:56.605 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
19:08:56.652 ->
19:08:56.652 -> Exception (28):
19:08:56.652 -> epc1=0x40203d32 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
19:08:56.652 ->
19:08:56.652 -> >>>stack>>>
19:08:56.652 ->
19:08:56.652 -> ctx: cont
19:08:56.652 -> sp: 3ffffda0 end: 3fffffc0 offset: 0190
19:08:56.652 -> 3fffff30: 3ffe8521 3ffee990 3ffee990 40203c8c
19:08:56.652 -> 3fffff40: 3ffe852c 000000b0 3ffee990 402037f1
19:08:56.652 -> 3fffff50: 40204294 00000000 3ffee990 40203876
19:08:56.652 -> 3fffff60: 402076ac 3ffee990 3ffe8518 40203962
19:08:56.652 -> 3fffff70: 3fffdad0 00000000 3ffee990 3ffeecd4
19:08:56.652 -> 3fffff80: 3fffdad0 00000000 3ffee990 40201130
19:08:56.652 -> 3fffff90: 40207950 00000000 3ffeeba8 4020117a
19:08:56.698 -> 3fffffa0: feefeffe 00000000 3ffeec94 40204eec
19:08:56.698 -> 3fffffb0: feefeffe feefeffe 3ffe86d8 40100f29
19:08:56.698 -> <<<stack<<<
19:08:56.698 ->
19:08:56.698 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
19:08:56.698 ->
19:08:56.698 -> ets Jan 8 2013,rst cause:2, boot mode:(3,7)
19:08:56.698 ->
19:08:56.698 -> load 0x4010f000, len 3584, room 16
19:08:56.698 -> tail 0
19:08:56.698 -> chksum 0xb0
19:08:56.698 -> csum 0xb0
19:08:56.698 -> v2843a5ac
19:08:56.698 -> ~ld