Hi, i am adding the device with the quickstart template, it works. Then i change the testing code that blynk generates, pasting my code and device goes offline.
My hardware is TI MSP432+NodeMCU. I am getting everything on serial on nodemcu but when i try to upload it simly goes offline and the serial is not showing anything.
#define BLYNK_TEMPLATE_ID "TMPLvNuI6u_g"
#define BLYNK_DEVICE_NAME "Quickstart Device"
#define BLYNK_AUTH_TOKEN "M_JWokpG5OMGsLitRvyH6TNzpfYGDsgc"
#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Wire.h>
#include <ArduinoJson.h>
#define BLYNK_PRINT Serial
SoftwareSerial nodemcu(D7,D8);
BlynkTimer timer; //announcing the timer
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "TheVoid";
char pass[] = "000000gggggg";
float temp, hum, pres, pt1, pt2, pt3, pt4;
void datareceive()
{
StaticJsonBuffer<1024> JsonBuffer;
JsonObject& data = JsonBuffer.parseObject(nodemcu);
// if (data == JsonObject::invalid()) {
// Serial.println("Invalid Json Object");
// JsonBuffer.clear();
// return;
// }
float temp = data["temperature"];
float hum = data["humidity"] ;
long pres = data["pressure"] ;
float pt1 = data["pt1"] ;
float pt2 = data["pt2"] ;
float pt3 = data["pt3"] ;
float pt4 = data["pt4"] ;
}
void datasend()
{
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V0, temp);
Blynk.virtualWrite(V1, hum);
Blynk.virtualWrite(V2, pres);
// Blynk.virtualWrite(V3, pt1);
// Blynk.virtualWrite(V4, pt2);
// Blynk.virtualWrite(V5, pt3);
// Blynk.virtualWrite(V6, pt4);
}
void setup(){
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
nodemcu.begin(9600);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
// Setup a function to be called every second
timer.setInterval(1500L, datareceive);
timer.setInterval(3000L, datasend);
}
void loop(){
Blynk.run();
timer.run();
}
I am keeping void loop clear, not flooding the cloud, internet is okay, credentials are okay, still offline.
Note that i am using json object to receive data from the MSP432 using software serial on NodeMCU at 9600. Maybe this has to do with the failure to connect again.