Knee monitoring

The task of cracking a moving object is widespread. In the simplest case, you need to take a phone with android, put OsmAnd there and set up live monitoring. You sit and look at the map (OpenStreetMap of course) moving the device. That’s what I would have done, but suddenly it turned out that on the right day I would have no Internet, no computer, no time.

And I started looking for a way out. First, brief consultations and discussions with the chat were held , and then, after lunch, a decision came.

There is a mobile phone and there is an email2sms operator service. So in my case, the task boils down to simply getting a human-readable text of no more than 1000 characters long. But first I’ll try to explain the train of thought.
  • We track the tracking service provided by the ops right away as inaccurate and due to the lack of a SIM card of any of the aforementioned operators.
  • At the OSM has a good search ( not without sin as found habrapolzovateli , but acceptable). But what if you turn it in the opposite direction and get the name of a nearby ground object using the transmitted coordinates. What does my task have to do with it? .. And nothing to do with it! Just regarding landmarks, the text should be more human-readable. In general, the idea is interesting, it is necessary to leave for later. The author of the site even has something in the zashashnik.
  • “The observed has moved 350 meters north from the previous measurement” - it seems to be suitable, but then you need to somehow save all the points. Even if the last two ... Where can I get this hosting?
  • Arrange WPT in advance and, upon reaching them, let the device drop the message. Well, here, firstly, the route is not known in advance, but only the destination. Secondly, such an application was not found. About it below.
  • And so not always responsive juick_ppl and here nothing helped .
  • “Observed” - “relatively” - “destination” ... Eureka!

So, 100500 applications from the market can do exactly the same as OsmAnd - collect tracks, show the location on the map, share coordinates. The problem is that they are divided only by pressing the menu item “share”, and the dependence on manual actions of an untrained android user should be excluded. And to say that - a pair of coordinates ( lat , lon ) is only suitable for hanging in a frame on the wall, but not telling the person where the object has already reached. Other suitable options were not found, maybe there was not enough time. Mention only OruxMaps - undoubtedly a useful and very functional program. So functional that it scared me to a trembling knee. I’ll leave her study for later ...

At this point, a clear idea was formed about the format of the message received every 5 minutes: " XXX km left to the destination ", this will be enough for me. It could be less common, but 5 minutes is the maximum that can be set. The approximate limit on the number of email2sms is 100 per day. That’s enough for the whole 8 hours, it’s good.

Suddenly, we just managed to find a hosting, on the terms of placing an extremely simple php script, without a database and other goodies. So it's time to start coding. On the site from the bookmarks ( GIS-LAB.info , why hide) there was an explanatory description of large circles with the ready-made algorithm "Calculating the distance and initial azimuth between two points on a sphere", impudently distorting and remodeling in php:
> ' . $dist . ' [meters]';
echo '
Initial bearing >> ' . $angledeg . ' [degrees]'; ?>

Distance >> 276805.84112453 [meters]
Initial bearing >> 39 [degrees]


As a control example, we took the points of airports approximately corresponding to the direction and distance of the trip.

Distance between MQF and CEK
The distance has been calculated as being: 277 kilometers (173 miles)


Great, it works! We make out a function, the initial azimuth is thrown out as unnecessary and for simplicity. We attach the missing functionality, not forgetting to post the data in the direction for which Live Tracking initially appeared in OsmAnd 0.7.1.




> ".$d1." to final destination and ".$d2." from start (meters)\r\n";
$message .= "Speed >> ".round($hhsb_speed,2)." (m/s)";
$subject = "distance";
mail($emailto, $subject, $message, $headers);
# сохранить в ОсМо для просмотра на карте
$esya = 'http://воизбежаниехабраэффектапутьвидентольковархиве/?'.$hhsb_clat.':'.$hhsb_clon.':'.$hhsb_hdop.':'.$hhsb_alt.':'.$hhsb_speed.':'.$hhsb_usr.':'.$hhsb_n;
$ch = curl_init($esya);
$res=curl_exec($ch);
curl_close($ch);
$ans=json_decode($res);
echo $ans->response; //{"s":1} по-любому, можно не проверять
?>


A very important step is to write the line Web address Live tracking of the type in OsmAnd :

h͇t͇t͇p͇://hosting_does_not_advertise/fd.php?clat={0}&clon={1}&hdop={3}&alt={4}&speed={5}&slat=53.393&slon=58.756&flat=55.3&flon=61.5&eml=emailto@gmail.com&rpl=emailfrom@mail.ru&usr=[osmohash]&n=[num]



You can rob waypoints in the same concept, and if there is a small database, turn around completely. However, my kneecap minimum has already been completed ...
... Good luck ! It remains to charge the android. After all, if you do not blow to charge, then the focus will not work.

Of the identified shortcomings:
  • The maximum interval is 5 minutes, I would like more. Ideally, in general, be able to enter a number, rather than select from a list.
  • By the end of the second hour, the application died, it is not clear who tried. I suspect that the android messed up, because the user has not been active all this time - as soon as the first data transfer took place, the device immediately appeared in the bag and regularly sent signals. I had to cause a panic and ask to revive OsmAnd. Managed, OK.
  • There is a dependency on an untrained user - do not remotely disable it. The instructions did not help, it's hard to see ... It turned out to be easier to ask to turn off the power of the "tracker" on arrival.

But it’s enough to wash the bones of such a spherically ideal, thoughtful and logically completed life hack, because we have already arrived at the place.
Distance >> 29 to final destination and 247194 from start (meters)
Speed ​​>> 0.0 (m / s)

Also popular now: