物聯網服務租賃專家
Category IoT, TRRAK

Geofence Event

Let us look at the system map again. Now, we have 4 kinds of devices, which are 2 Arduino low end trackers, and 2 high end mobile phones, and now they are doing their job by pushing GPS location to our system.

Sometimes, we would want to see current location for device, as you can see all points on APP.

But most of the time, you just want to be notified by special event, such as I just want to be notified when kids enter and out of school, but keep me quiet for the rest of the time. And I want to let everyone knows when I am out of office, so my wife can prepare the dinner for me just in time.

 

NOTIFICATION by Slack

That is why we need to set an invisible area on the map, we call it " GEOFENCE", then the system will judge when the device location is inside or outside of area, and then we push messages by Slack APP to all members.

 

Two ways to set geofence

We have two ways to set Geofence, first one is from Owntracks APP on mobile phone, it is easy to setup, but the setting is for himself only, but not for other devices. say if you have 100 devices, and you must set 100 times individually.

The biggest problem is that it is impossible to setup for low end trackers, because it does not have Owntracks APP on it, so our Arduino trackers will not work in Geofence.

So, we need another way to setup Geofence on server, then it only need one time setup, and it will work for all devices. I love Node-RED\'s powerful functions, and we can do it easily. It includes a little bit javascript code, and I will explain as well, then you can customize it for your own.