Display data from GPS to the Blynk app interface by terminal

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!
}

Have you really had success with getting software serial to read serial dat from your GPS module at 115200 baud?

The fostware serial library is usually pretty flakey at those speeds. I assume that the GPS module is sending data at 115200 ?

Pete.

That was actually my last try before posting. I set GPS to send data at 9600, so I put it back to that value. Anyway, it doesn’t work. If my logic is right, I need to cross-wire Rx and Tx pins of Nucleo and ESP8266 and put the code into ESP to catch the data. Nucleo is sending it right, but something is wrong with the connection to Blynk. Now I couldn’t even make a built-in LED to work over Blynk.

Correct, but it’s the software serial pins of the ESP that you need to be connecting to the GPS module.

GPIO 3 on the ESP8266 is the Rx pin on the USB serial port, so isn’t a suitable pin to use for software serial. Also, don’t forget that the “D” numbers screen printed on the ESP dev boards aren’t GPIO numbers.

I’d reccomend testing the hardware/software serial setup without using Blynk, then add the Blynk code back in.

Pete.

The idea of the project is to use STM Nucleo for parsing GPS data and sending it to Cloud over WiFi. Nucleo has a code and uses one UART to communicate with GPS, and another UART for sending data to ESP. Now something appeared on Blynk’s terminal - zeros. Just one digit below another. I am not sure what that means.

Me neither, without access to your hardware to do some proper testing; but I’ve already said which approach I’d take to move things along.

Pete.

I did it! Blynk.virtualWrite haven’t done the job. Then I decided to try to put this part of code:

if(DebugSerial.available()){
      Blynk.virtualWrite(V1, DebugSerial.read());
    }
    if (Serial.available()) {
DebugSerial.write(Serial.read());
}

Then I wired STM Nucleo to D0 and D1 pins of ESP and it worked! Thanks a lot for every suggestion!