GPS Stream not streaming

Hello everyone, I am new to the community and new to arduino. I have read the rules on how to post and will do my best. Long story short I cannot get the GPS Stream widget to function in any way. I am able to connect to the arduino through bluetooth HC05 just fine and have several working example files but I just can’t seem to get the gps stream example file to spit out the coordinates of either of the android devices I have tried.

Specs:
Arduino Mega2560 (by Elegoo)
USB Serial connection to a mac running current OS
HC-05 (ZS-040) Bluetooth on Serial2
Blynk server (not local)
Blynk 0.5.4 library installed
Android device = LG G pad w/ android version 7.0
Alternate android device =- LG LGL34C w/ android 4.4

I upload the code, see the blank logo, connect with a low ping, and then get “waiting on connections” message. I have tried to edit the example code based on the gps stream info on docs.blynk.cc but it did not change my situation.

The gps coordinates on the blynk widget do update as I move around.

Any and all help is greatly appreciated.

#define BLYNK_PRINT Serial
// #define BLYNK_DEBUG
#include <BlynkSimpleSerialBLE.h>

// #include <SoftwareSerial.h> removed

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "HIDDEN";

// SoftwareSerial SerialBLE(10, 11); // RX, TX


BLYNK_WRITE(V2) {
  GpsParam gps(param);

  // Print 6 decimal places for Lat, Lon
  Serial.print("Lat: ");
  Serial.println(gps.getLat(), 7);

  Serial.print("Lon: ");
  Serial.println(gps.getLon(), 7);

  // Print 2 decimal places for Alt, Speed
  Serial.print("Altitute: ");
  Serial.println(gps.getAltitude(), 2);

  Serial.print("Speed: ");
  Serial.println(gps.getSpeed(), 2);

  Serial.println();
}


/* BLYNK_WRITE(V2) {
  float latitude = param[0].asFloat(); 
  float longitude = param[1].asFloat();
  float altitude = param[2].asFloat();
  float speed = param[3].asFloat();

  Serial.print(latitude);
}

*/
void setup()
{
  // Debug console
  Serial.begin(9600);

  Serial2.begin(9600); // changed SerialBLE to Serial2
  Blynk.begin(Serial2, auth);  // changed SerialBLE to Serial2

  Serial.println("Waiting for connections...");
}

void loop()
{
  Blynk.run();
}
1 Like

3 posts were split to a new topic: I am making follow me cooler

  1. Sample sketch link for Mega2560+HC-05 - I Don’t see in your code any RX/TX setup, looks like you had commented it
  2. Did you connect Bluetooth Serial widget to your HC-05 hardware?
  3. GPS Streaming widget does not support sending data to BLE/Bluetooth, as it sends them to the blynk server. I’ll check could we enable it for BLE/Bluetooth, but in any case if it would require persistent BLE/Bluetooth (always open Blynk app near the Bluetooth hardware).

I am using Blynk sketch for Arduino UNO for bluetooth & GPS streaming. The sketch works fine, but I am getting all zero for the streaming from my Samsung S6.

You stated that GPS streaming only goes to the Blynk server??? If so, how do I send it to my arduino UNO?

Latest Android Blynk app send GPS streaming update via BLE/BT connection too, but only while the app is opened - currently it is app’s limitation, as we are not persisting connection in the background, due to heavy battery drain in such case.

Thank you Alexander. Second question. In your gps via bluetooth sketch the serial monitor only display gps data once, then waiting for connection again. I assume your GPS widget continues to stream, but I am not getting it on the arduino end. In other words, in your blynk.run() loop, the V1 is only being called once and not continuously.

Does GPS stream widget update values in it? On start - it can sent latest known location, and after that some time is needed to start receiving frequent updates, by the way can you provide your GPS widget set up?