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();
}