sensebox / senseBox-bike-Arduino

Repository which holds the Arduino Sketch for the senseBox:bike
MIT License
2 stars 2 forks source link

Geofence #6

Closed goetzvr closed 3 months ago

goetzvr commented 2 years ago

A reverse geofencing can be set up in the 'BIKE.CFG'. This allows you to 'hide' your home address. When coordinates are recorded in the defined rectangle, they are rewritten to a fixed coordinate (e.g. a park).

Such a rectangle can be easily determined on Openstreetmap. In this example, the default coordinate is then in Sprengelpark. The function is only active if the default coordinate HOME_(DEFLON|DEFLAT) is set.

goetzvr commented 2 years ago

Comments are welcome.

goetzvr commented 2 years ago

Rewrtiing the coordinates to a fixed point in the defined rectangle provides a quite messed up display of the path. swappy-20211114-105736 Would it be better to filter out the coordinates in the "home zone" completly?

Thiemann96 commented 2 years ago

Thank you very much for your PR and effort put into this !

I understand it correctly that when uploading a sketch you have to provide your home location or rather your "home rectangle" right? This way the fencing will work on your home location, correct? Maybe a function which checks if the new coordinates deviates greatly from the previous coordinates and if not use the same coordinate again(or don't store & upload these values at all?). If it does deviate, i.e. the user is moving and not standing still then set the coordinates accordingly. This way we would not need to provide the location at start and it could work for more than "just" home. These are just thoughts I have not tried anything out yet.

I'm gonna leave this open (for now). We already have a semi-ready solution to filter out GPS spidering on the server side. This way less computation on the Arduino is required and it will be applied for every point . It will take some time though before it is fully integrated into the API since we are all quite busy at the moment.

I am having trouble understanding why on the UI the displayed path seems so sketchy. I'm gonna look into this.

goetzvr commented 2 years ago

In reference to my PR #5 I defined the home rectangle in the BIKE.CFG file on the SD-Card. So the configuration does not depend on the sketch. The main idea of this PR was to keep my home address private. Since the implementation is far from being perfect or well tested, I committed this PR in Draft status.

felixerdy commented 3 months ago

As we are moving forward with a non-GPS setup, Geofences will now be configured and used within the companion app