GPS Trigger query

Hi everyone,

I was excited to see the new GPS Trigger widget in a recent update, so I set about adding it to my project. I would like to implement it such that a notification is only sent if the user is outside of a certain area.

I need some clarification: is is possible for the GPS Trigger to return whether or not the user’s phone is in the selected zone? The way I see it you can choose to have a trigger on entering the zone or on leaving it, but what I want is a boolean user_is_in_zone variable that I can use to enable or disable a feature. Is this possible?

I suppose I could use two GPS Triggers with the same zone and set one to enter and one to exit, but that seems silly (and 2x Energy!).

Cheers!

When user enters area he is in, when goes out he is out. And this info is state. So in other words - yes you know that.

No need for that. From my point of view ENTERING area is equal to in IN area.

From the wording in the app I assumed that a trigger is sent when either entering or exiting the area, according to the setting in the app (kind of like a rising or falling interrupt).
Are you saying that actually the state is updated whenever the user enters or exits, and the switch determines whether 1 = IN or OUT.

Haven’t had a chance to test this for real yet (requires walking around outside). Is there any documentation for this widget? I couldn’t find any on the Blynk website or GitHub.

You can click on “i” button near widget for documentation.

I have another quick question: what happens if you have multiple mobile devices running Blynk? Do they all have to enter or exit the geofence for it to trigger?

Yes, they all considered as separate devices. So every device will trigger it’s own action.

OK so I finally got around to trying this out. I have GPS Trigger widget on V8 and value display on V9 so I can see what’s going on.

BLYNK_WRITE(V8)
{
  // Get here when entering or leaving geofence area
  outside_geofence = param.asInt();
}

BLYNK_READ(V9)
{
  Blynk.virtualWrite(V9, outside_geofence);
}

The geofence area is a small area around my house and I have the widget set to EXIT so I get a 1 when I’m outside the area which will enable a feature.

Except the value on V9 never changes. I’m currently sat (at work) about 10 miles away from the geofence and the value is still 0. What am I missing?

I can not run the GPS trigger in any way. The GPS Stream was very successful, but I was not able to run the Trigger. Please help.

1 Like

Ok I have tested and got the same results.

When I read the documentation I think this is where our problem is Snowman.

" This widget will work in background and periodically will check your coordinates"

Seems like coordinates have not been updated in time

@Dmitriy is there a way that we can force an update of coordinates before code is run or change the period between updates of coordinates.

Thanks

Did this ever get solved? Or did you guys find a fix? I’m currently having the exact same problem. I can even see my indicator enter/leave the map window in the widget…just getting no response from the gps widget.

FWIW I’m on a Galaxy S8

1 Like

I have the same problem.

@uhlmul Please stay within your own topic for same issue, thanks.