Community discussions

 
WirelessRudy
Forum Guru
Forum Guru
Topic Author
Posts: 3074
Joined: Tue Aug 08, 2006 5:54 pm
Location: Spain

LtAP Mini GPS + tracking in map

Thu Jan 17, 2019 12:45 pm

Anybody already has done this?

I am new to this but have no clue on how to get me a map that tell me where my LtAP mini with external GPS antenna (so it all works!) is.

The wiki show some info but now I have to go into scripting, installing server(s), etc...

A 'how to' for dummies would be appreciated....
Show your appreciation of this post by giving me Karma! Thanks.

Rudy R. Puister

WISP operator based on MT routerboard & ROS.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24042
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: LtAP Mini GPS + tracking in map

Thu Jan 17, 2019 1:23 pm

Ummm, but you WILL have to do that. There is no easier way, you can't have a webpage with a moving map, if you don't have a web server :)

https://wiki.mikrotik.com/wiki/Manual:GPS-tracking
No answer to your question? How to write posts
 
WirelessRudy
Forum Guru
Forum Guru
Topic Author
Posts: 3074
Joined: Tue Aug 08, 2006 5:54 pm
Location: Spain

Re: LtAP Mini GPS + tracking in map

Thu Jan 17, 2019 2:29 pm

Ummm, but you WILL have to do that. There is no easier way, you can't have a webpage with a moving map, if you don't have a web server :)

https://wiki.mikrotik.com/wiki/Manual:GPS-tracking
Yes ok, but now I first have to investigate what server is best... any recommendations? You guys made screendump of a map in the Wiki example. A dummy (in this respect!) could start with the same...? I have no problems installing a webserver. But which one is good? No clue...
Show your appreciation of this post by giving me Karma! Thanks.

Rudy R. Puister

WISP operator based on MT routerboard & ROS.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24042
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: LtAP Mini GPS + tracking in map

Thu Jan 17, 2019 2:30 pm

nginx+php on any hosting provider. digitalocean is simple. for test purposes, you can have it on your desktop with https://www.wamp.net
No answer to your question? How to write posts
 
crau1000
just joined
Posts: 6
Joined: Thu Jan 31, 2019 3:52 am

Re: LtAP Mini GPS + tracking in map

Sun Feb 03, 2019 11:10 pm

Normis, is there a specific command in RouterOS to change the GPS format type? Or, is the only way to get dd GPS data through the "system gps monitor format=dd command"?

Also, using the scripts from https://wiki.mikrotik.com/wiki/Manual:GPS-tracking, it does not post lat/long data to the sqlite database. I get data in the db for "time" and "added" but do not get lat/long data. I noticed in the PHP script for index,php, the data values are "TEXT". Does leafy require text values? I would think you would want to use "FLOAT". Tried all parameters (NUMERIC, INTEGER) etc. Just cant get lat/long info into sqlite3.

My server is set up with apache2, PHP and sqlite. All work with other tests I've done. Im suspecting the router isn't actually putting the lat long data in to be processed via json.

Any help would be great.. Thanks!
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24042
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: LtAP Mini GPS + tracking in map

Mon Feb 04, 2019 8:48 am

Latest RouterOS versions have some changes in the GPS commands. The next Beta will have "set" instead of "monitor" for the format, so the wiki script will work then. We updated article before version was released, sorry about that. Probably today or tomorrow it will be out.

Since the new version supports DD format, the example has gotten easier.
No answer to your question? How to write posts
 
crau1000
just joined
Posts: 6
Joined: Thu Jan 31, 2019 3:52 am

Re: LtAP Mini GPS + tracking in map

Mon Feb 04, 2019 11:39 pm

Thanks Normis. Im looking forward to getting the updated OS and get this working. I will eventually get this working with postgresql. I'll update you with that code once I get it stitched together.

Again.. thanks for your help..
 
crau1000
just joined
Posts: 6
Joined: Thu Jan 31, 2019 3:52 am

Re: LtAP Mini GPS + tracking in map

Tue Feb 05, 2019 2:07 am

Hello Normis -- I installed 6.44beta61. I used the set command for dd. Still doesn't work BUT, I did find an issue. I sniffed and pulled apart the traffic going to JSON.. So we get prepended \00\00\00\00\00\00 etc.. trailing our dd lat/lon values.. I found a match to the value in "system script environment"..

[admin@Client_101] /system script environment> pri
# NAME VALUE
0 lat 33.9686\00\00\00\00\00\00\00\00\00\00\00\
1 lon -117.7433\00\00\00\00\00\00\00\00\00\00\0
[admin@Client_101] /system script environment>

Basically JSON just chokes on the string the global variable represents.. This (I believe) may be an issue..

Just a thought, I could be misunderstanding the reason for the \00\00\00....

I'll naturalize (remove the \00\00\...etc) the string in pyhton and spit it into the sqlite db..

Hope this helps.. And again thanks for your time..
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24042
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: LtAP Mini GPS + tracking in map

Wed Feb 06, 2019 8:52 am

Which script did you use, which caused these added zeroes?
No answer to your question? How to write posts
 
crau1000
just joined
Posts: 6
Joined: Thu Jan 31, 2019 3:52 am

Re: LtAP Mini GPS + tracking in map

Wed Feb 06, 2019 10:01 am

Hi Normis,

The output isn't from a script it's the "/system script environment print" command in RouterOS. There is a PHP filter for the index.php script that filters the zeros and "\" forward slashes out before it goes to the JSON app. I got it working. I had to do a couple of tweeks.. one of which was getting the PHP script for index.php to understand negative numbers. You have to include the "-?" in the PHP preg_match line like here:

if (preg_match('/^-?[([0-9]{2,3}\.[0-9]{0,8})$/',$data->lat) && preg_match('/^-?([0-9]{2,3}\.[0-9]{0,8})$/',$data->lon) )

Note.. after the carot, you need a "-?" before the brackets. You should include this in your script online to help users South of the equator where they have negative lats and in North America where we have negative longs. If both lat and long do not have this in the preg_match line, neither lats nor longs will get into the DB.

I'm going to migrate to a Postgresql DB.. When I do, I'll provide you with another index.php script with more features in the DB.. ie.. Router ID, speed etc.

Thanks for your time..

Cheers!
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24042
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: LtAP Mini GPS + tracking in map

Wed Feb 06, 2019 10:47 am

We improved the regex, to support negative coords
No answer to your question? How to write posts
 
thejokertheory
just joined
Posts: 4
Joined: Wed Feb 20, 2019 3:00 pm

Re: LtAP Mini GPS + tracking in map

Wed Feb 20, 2019 6:50 pm

Hi, does someone know how to solve the problem of the 00 in the latitude and longitude reading of router OS ? I have this problem on Router OS v.6.44rc1 when i set gps format do DD.
The tracking works well, but with wrong coordinates value device location is not correct. Any idea to get this issue solved ?

here is a screenshot
You do not have the required permissions to view the files attached to this post.
 
Tibi
just joined
Posts: 2
Joined: Tue May 31, 2016 9:33 am

Re: LtAP Mini GPS + tracking in map

Mon Feb 25, 2019 5:34 pm

I would also be interested in this ...
 
billessig
just joined
Posts: 1
Joined: Sat Mar 09, 2019 5:41 am

Re: LtAP Mini GPS + tracking in map

Sat Mar 09, 2019 5:52 am

I'm glad I am not the only one to discover the extra 00 in the coordinates bug when coordinates format is set to dd

To clarify for anyone who has pull to get this fixed-

There are two extra 0s prepended to the portion of the coordinates to the right of the decimal place. This occurs for both latitude and longitude.
Example: If you are located at 40.123456, -120.789123, the device reports your coordinates as 40.001234, -120.007891.
 
reiniss2
MikroTik Support
MikroTik Support
Posts: 47
Joined: Wed Jan 02, 2019 12:14 pm

Re: LtAP Mini GPS + tracking in map

Thu May 09, 2019 10:17 am

I'm glad I am not the only one to discover the extra 00 in the coordinates bug when coordinates format is set to dd
The issue has been fixed with the additional "\00" values at the end of the output and will be released on all three branches with the next releases.


There are two extra 0s prepended to the portion of the coordinates to the right of the decimal place. This occurs for both latitude and longitude.
Example: If you are located at 40.123456, -120.789123, the device reports your coordinates as 40.001234, -120.007891.
This should be fixed too, if you still encounter the issue, please write an e-mail to support@mikrotik.com providing Supout.rif file of your device generated when you experience the issue.
 
wesco
just joined
Posts: 1
Joined: Sun Jul 07, 2019 5:54 pm

Re: LtAP Mini GPS + tracking in map

Sun Jul 07, 2019 6:03 pm

please consider to change the regex to : /^(|\-)([0-9]{1,3}\.[0-9]{0,8})$/
in fact here in Germany we have only one digit in Longitude
.. Costs me 1h debugging … but now i know regex better ;-)
 
User avatar
timscoop
Trainer
Trainer
Posts: 2
Joined: Wed Nov 24, 2010 4:13 pm
Location: South Africa
Contact:

Re: LtAP Mini GPS + tracking in map

Fri Aug 16, 2019 12:11 pm

Anybody already has done this?

I am new to this but have no clue on how to get me a map that tell me where my LtAP mini with external GPS antenna (so it all works!) is.

The wiki show some info but now I have to go into scripting, installing server(s), etc...

A 'how to' for dummies would be appreciated....
Not sure whether you are still looking but this should be helpful. Also included a guide on Github for the server configuration.
https://scoop.co.za/blog/post/vehicle-g ... tik-s-ltap

Who is online

Users browsing this forum: No registered users and 94 guests