hm, thats interesting. are you sure the blynk app on the phone has solid internet connection and receives the values every second?
you should put this line into void getcoordinates: Blynk.virtualWrite(V5, millis() / 1000);
and create a display widget in blynk app on v5, set to push and check if the seconds are rising.
also, you could serial print the lat and long variables to serial monitor, to check what is actually sending to the app. or if you do not have tx rx pins free, you can send the coordinates as the millis, to wirtual pins, and see in the app. than on google maps you can verify if those coordinates are really in nigeria…
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
Output any data on Map widget!
App project setup:
Map widget on V1
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = 12, TXPin = 13;
static const uint32_t GPSBaud = 9600;
TinyGPSPlus gps;
BlynkTimer timer;
SoftwareSerial ss(RXPin, TXPin);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "4bb191e6da5a438bb071ecca688732f3";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "MikroTik Home";
char pass[] = "";
char server[] = "192.168.1.104";
WidgetMap myMap(V5);
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass, server);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);
timer.setInterval(1000L, getCoordinates);
Blynk.virtualWrite(V5, millis() / 1000);
myMap.clear();
}
void getCoordinates()
{
float lat = (gps.location.lat(), 5);
float lon = (gps.location.lng(), 4);
myMap.location(1, lat, lon, "value");
}
void loop()
{
Blynk.run();
timer.run();
}
you project is working perfectly. the problem is, that you do not get the proper coordinates! probably somehow you loosing the decimals of the floats. this is the problem.
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
Output any data on Map widget!
App project setup:
Map widget on V1
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = 12, TXPin = 13;
static const uint32_t GPSBaud = 9600;
TinyGPSPlus gps;
BlynkTimer timer;
SoftwareSerial ss(RXPin, TXPin);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "4bb191e6da5a438bb071ecca688732f3";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "MikroTik Home";
char pass[] = "";
char server[] = "192.168.1.104";
WidgetMap myMap(V5);
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass, server);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);
timer.setInterval(1000L, getCoordinates);
Blynk.virtualWrite(V5, millis() / 1000);
myMap.clear();
}
void getCoordinates()
{
myMap.location(1, gps.location.lat(), gps.location.lng(), "value");
}
void loop()
{
Blynk.run();
timer.run();
}
“value” is “Home”, “Iran”, “Work” or some generic term like “GPS_Loc” but not “value”. The syntax is just showing you that you need a String for the GPS place name.
I believe V5 is your map so you can’t send millis() to it and it is no good sending millis() in setup.
Comment that line out in setup()
Create a display on V6 for millis().
Create another 2 display widgets, V7 LAT and V8 LONG
Then replace your getCoordinates() function with this:
thanks for reply. I adding your code but when compiling I got error expected ')' before ';' token the error in line 76 Serial.println(V8, String(lon, 4);
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
Output any data on Map widget!
App project setup:
Map widget on V1
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = 12, TXPin = 13;
static const uint32_t GPSBaud = 9600;
TinyGPSPlus gps;
BlynkTimer timer;
SoftwareSerial ss(RXPin, TXPin);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "4bb191e6da5a438bb071ecca688732f3";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "MikroTik Home";
char pass[] = "";
char server[] = "192.168.1.104";
WidgetMap myMap(V5);
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass, server);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);
timer.setInterval(1000L, getCoordinates);
}
unsigned int move_index;
void getCoordinates()
{
Blynk.virtualWrite(V6, millis() / 1000);
move_index++;
float lat = (gps.location.lat(), 5);
float lon = (gps.location.lng(), 4);
Serial.println(V7, String(lat, 5);
Serial.println(V8, String(lon, 4);
myMap.location(move_index, lat, lon, "Iran");
}
void loop()
{
Blynk.run();
timer.run();
}