Hello everyone. I am new to this community and also with programming such things, and I need your help. What I want to do is to display the GPS data sent from STM Nucleo through serial communication to ESP8266. STM Nucleo display GPS data on a serial monitor, but now I need to display that data on my Blynk app. I tried to combine the codes I found on the community, but there are no results yet. My code on the ESP8266 is below.
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
WidgetTerminal terminal(V1);
WidgetLED led1(GP2);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "*******************************";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "*******";
char pass[] = "*******";
SimpleTimer timer;
void setup()
{
// Debug console
//Serial.begin(9600);
DebugSerial.begin(115200);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
timer.setInterval(500, Sent_serial);
}
void Sent_serial() {
// Sent serial data to Blynk terminal - Unlimited string readed
String content = ""; //null string constant ( an empty string )
char character;
while(DebugSerial.available()) {
character = DebugSerial.read();
content.concat(character);
}
if (content != "") {
Blynk.virtualWrite (V1, content);
terminal.print(content);
}
}
void loop()
{
Blynk.run();
timer.run();
// terminal.write(param.getBuffer(), param.getLength());
// terminal.println();
// terminal.flush();
// You can inject your own code or combine it with other sketches.
// Check other examples on how to communicate with Blynk. Remember
// to avoid delay() function!
}