Gps stream open gate

hi guys, I would like to create a project with gps stream. I would like to be able to open the automatic gate when I arrive by car or scooter. setting the gate coordinates as soon as the mobile is at that point, the relay of the gate opening lights up. obviously I do not know how to program everything. can we work together with this project? always if it is feasible? thank you all

1 Like

We can help guide you to the references you need to learn Blynk (actually many of the main links are already at the top… scroll up… of this page), but otherwise you can try services like fiverr for programming assistance.

Look at the GPS Trigger Widget

I like the GPS trigger and want to use it in an application, as far as I understand it is not available for iOs, any update when it will be available?

Any other ways to get a trigger from a location on iOs?

Thanks
Sharon

Ah, then you are stuck with the GPS Streaming Widget (I think that works with iOS) and comparing incoming location with a preset range via code… and NO I have not seen any pre-done Blynk code (but you can search this forum in case there is any).

But I am sure Google has seen the needed formulas, algorithms and Arduino code… then it is just a matter of using said methods within a Blynk sketch.

Thanks for the prompt answer.

The issue I see with your approach is that the NodeMCU needs to calculate when the trigger needs to be executed (the NodeMCU can be off and I don’t want to flood the system with information over the cloud).

I will need the mobile device to calculate and decide when to trigger, can I add this code into the Blynk App?

Thanks

Not my approach, rather the way it is normally done… The App is primarily a UI conduit with minimal “calculating” functions (AKA eventor). Code on the MCU device is the way complex things happen.

i also have ios and i do not know gps trigger. but I would like to try with gps streamer. with an if you are in 38.4788 15.5677 open pin 5 (gate). if anyone of you helps me, the code would be wonderful

@luccio Not really polite to jump into someone else’s topic asking for custom code :face_with_raised_eyebrow:

1 Like

I created the post

1 Like

I am sure that was just an oversight, by @Gunner. He responds to so many topics on this forum, I bet it is hard to keep track of them all.

But either way, most here are willing to help, but not just write code for you. You will need to do the bulk of the work and then ask for help with specific aspects of your code that are not quite working.

Show us what you have attempted so far.

Here is an example that you may be able to adapt to your needs.

https://examples.blynk.cc/?board=ESP8266&shield=ESP8266%20WiFi&example=Widgets%2FGPS_Stream

Yup… way too much lack of sleep or coffee or something :blush:

Totally agree… it’s like an addiction :scream:

Sorry @luccio I didn’t scroll up far enough to confirm first :blush: Please, feel free to carry on in your own topic :laughing:

:kissing_heart:

hi I’m trying to figure out how to make the gps trigger work for ios but I can not. can you help me with the if? thank you

#define BLYNK_PRINT Serial  
#include <Ethernet2.h>
#include <BlynkSimpleEthernet2.h>
#include <SimpleTimer.h>
char auth[] = "xxx"; 

SimpleTimer timer;

float homeLat = xx.xxxxxx;
float homeLon = xx.xxxxxx;
float thresholdDistance = 0.10; //km

BLYNK_WRITE(V5) {
  GpsParam gps(param);
  // Print 6 decimal places for Lat
  Serial.println(gps.getLat(), 7);
  Serial.println(gps.getLon(), 7);

  Serial.println(gps.getAltitude(), 2);
  Serial.println(gps.getSpeed(), 2);
}


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

  Blynk.begin(auth);
}

void loop()
{
  Blynk.run();

  if (???)
}

It doesn’t work on iOS… Period. There have been a few recent topics and posts about this already.

BTW that is not how you post code in this forum… It needs to be properly formatted. I will fix your last post.

Blynk%20-%20FTFC

But the “gps stream” seems to work with iOS, right?
And that should be enough to trigger an action on the hardware side.
'Cause what does the “gps trigger” in the app(on android) actually do?
It calculates distance between two GPS coordinates :wink:
I’d suggest sending the position via “gps stream”
and do the calculation and evaluation of the distance on the hardware side.

Correct, and yes… with comparison code of some sort.

The GPS trigger just does all that calculation in itself.

@luccio: All that is missing is the calculation between your home coordinates and the coordinated that come in via gps stream.
After a quick search on google if found a fairly easy approch done by Jinseok Jeon (JeonLab.wordpress.com) who uses the distance calculation in his GOLF Gps.
https://github.com/jeonlab/Golf-GPS/blob/master/JeonLab_Golf_GPS.ino

Combinig the gps stream example with the calculation of the distance this is what it could look like:

#define BLYNK_PRINT Serial  
#include <Ethernet2.h>
#include <BlynkSimpleEthernet2.h>
#include <SimpleTimer.h>
char auth[] = "xxx"; 

float homeLat = xx.xxxxxx;
float homeLon = xx.xxxxxx;
float thresholdDistance = 100; // meter

BLYNK_WRITE(V5) {
  float distance;
  
  GpsParam gps(param);
  Serial.println(gps.getLat(), 7);
  Serial.println(gps.getLon(), 7);
  
  distance = distanceCalc(homeLat, homeLon, gps.getLat(), gps.getLon()); 
  Serial.println(distance,2);
  
  if(distance < thresholdDistance)
  {
    [do something]  
  }  
  else
  {
    [do something else]  
  }    
}

float distanceCalc(float lat1, float long1, float lat2, float long2)
{
  float distLat, distLong, distance;
  
  distLat = (lat1 - lat2) * 111194.9;
  distLong = 111194.9 * (long1 - long2) * cos(radians((lat1 + lat2) / 2));
  distance = sqrt(pow(distLat, 2) + pow(distLong, 2));
  return distance; // in meter
}

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth);
}

void loop()
{
  Blynk.run();
}
2 Likes

ciao Alessio vuoi risolvere come aprire il cancello di casa con il widgets GPS Streaming di Blynk?.

Ciao hai la soluzione?