Thank you for the reply! I was wondering about gpsd at the time
of my question and appreciate your good advice. Here's what I've got
from a very lazy sort of Perl-programmer mentality :^)
perl -MJSON::XS -le '$_=`gpspipe -n 5 -w|grep TPV`;$_=decode_json$_;pr
+int"$_->{lon} $_->{lat} $_->{alt} $_->{time}"'
Result:
-123.456789012 12.345678901 123.1234 2024-05-03T12:34:56.000Z
My application requires the automated determination of timezone from GPS:
perl -MJSON::XS -e '$_=`gpspipe -n 5 -w|grep TPV`;$_=decode_json$_;pri
+nt`timezonefinder $_->{lon} $_->{lat}`'
Result: Your/Timezone
sudo apt install libopenblas-dev
pip3 install timezonefinder
export PATH=/home/user/.local/bin:$PATH
Wait for GPS:
perl -MJSON::XS -e 'RE:while(){$_=`gpspipe -n 5 -w|grep TPV`;last if$_
+;sleep 1}eval{$_=decode_json$_};if($@){sleep 1;goto RE};print`timezon
+efinder $_->{lon} $_->{lat}`'
Now my computer magically knows the time zone:
sudo ln -s /usr/share/zoneinfo/Your/Timezone /etc/localtime
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.