Getting GPS to work on my Mikrotik LtAP
Inhaltsverzeichnis
1 Background
I have purchased a Mikrotik LtAP:
First of all there was no connection for a GPS antenna, but I mounted an according pigtail and then I wanted to get GPS reception up and running.
Finally a tracker is rather useless without GPS reception. Here is how I did it.
2 Useful Links
- https://forum.mikrotik.com/viewtopic.php?t=136444 VERY helpful
- https://wiki.mikrotik.com/wiki/Manual:System/GPS Original Mikrotik documentation On GPS
- https://wiki.mikrotik.com/wiki/Manual:GPS-tracking Original Mikrotik documentation On Tracking
- https://wiki.mikrotik.com/wiki/Manual:Tools/Sms Original Mikrotik documentation On sending SMS
3 Notes
I have found the following statement from Mikrotik:
We are seeing that the internal antenna becomes compromised when LTE is used, so for the time being, MikroTik recommends using an external antenna with these devices, if accuracy and speed of acquisition are paramount. We will try to resolve the issue, or adjust the product information, depending on our findings.
4 Prepare the Router
First you need to log into the device. If you hook it onto your local network, it will draw an IP via DHCP and then be available on that IP. Check your router.
Log in via ssh:
ssh admin@<IP>
Then it's always a good idea to update the installed firmware.
Also set a password. And in general, figure out how to secure it, in general. Consider this documentation here:
https://wiki.mikrotik.com/wiki/Manual:Securing_Your_Router
5 Receive GPS Position
Then, let's start with the GPS configuration:
/system console disable 0 /system gps set port=serial0 enabled=yes gps-antenna-select=external /port set 0 baud-rate=auto data-bits=8 flow-control=none name=serial0 parity=none stop-bits=1 /port firmware set directory=firmware ignore-directip-modem=no
Now the device should wirk right away:
/system gps monitor
gives me:
[admin@MikroTik] /system gps> monitor date-and-time: oct/12/2018 17:48:21 latitude: N 48 9' 50.862 longitude: E 11 33' 55.386 altitude: 514.799988m speed: 1.055640 km/h destination-bearing: none true-bearing: 3.500000 deg. True magnetic-bearing: 0.000000 deg. Mag valid: yes satellites: 7 fix-quality: 1 horizontal-dilution: 1.24
Not bad. Now you can come and visit me.
6 Configure lTE
TBA
7 Tracking
Here is a script for the scheduler tool:
{ :global lat :global lon /system gps monitor once do={ :set $lat $("latitude") :set $lon $("longitude") } tool fetch mode=http url="http://10.55.8.160/index.php" port=8080 http-method=post \ http-data=("{\"lat\":\"" . $lat . "\",\"lon\":\"" . $lon . "\"}") http-content-type="application/json" :put ("{\"lat\":\"" . $lat . "\",\"lon\":\"" . $lon . "\"}") }
Since the LtAP has the capability to send SMS, I will post the solution to send an SMS position in the near future also. Should look like the following..... Stay tuned!
{ :global lat :global lon /system gps monitor once do={ :set $lat $("latitude") :set $lon $("longitude") } tool sms send lte1 "20000000" phone-number="+49173383xxxx" \ message="Position is: $lat $lon" }