Wiki - Freifunk Pinneberg

Freies WLAN im Kreis Pinneberg

Benutzer-Werkzeuge

Webseiten-Werkzeuge


gps

Dies ist eine alte Version des Dokuments!


GPS am Freifunk-Knoten

Getestete Hardware

  • Navilock NL-601US - USB GPS-Stick
    • Für Empfang ist freie Sicht erforderlich, ggf. ein USB-Verlängerungskabel verwenden
  • Navilock NL-602U - USB GPS-Maus mit Kabel
    • Empfang auch im Innenraum mit ca. 1m Abstand zum Fenster erfolgreich
    • Viel schnellerer Fix als beim NL-601US

siehe auch: http://www.gpsinformation.org/dale/nmea.htm

Es gibt ein Modul ugps.

Das Modul ist momentan nicht in der Pinneberger Standardfirmware. Um es zu integrieren, muß die Site-Konfiguration etwas angepaßt werden:

GLUON_TLWR1043_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_GPS)

In Gluon zu finden unter openwrt/package/utils/ugps.

opkg update
opkg install kmod-usb-acm

Test

cat /dev/ttyACM0

UGPS

https://git.openwrt.org/?p=project/ugps.git

Ein erster Test ergab, daß das Programm anscheinend noch nicht produktionsreif ist. In der aktuellen Version werden u.a. folgende Fehler geworfen:

user.err syslog: GGA datagram has wrong parameter count got 5 but expected 14

Grund: es wird strtok verwendet, welches die leeren Parameter nicht berücksichtigt. Lösung: Verwende strsep

Es gibt eine neue Version, die schon besser funktioniert. Alerdings wird sekündlich ins log geschrieben. Die aktuellen Daten kann man wie folgt abfragen:

ubus call gps info
/usr/scripts/locationupdate.lua
#!/usr/bin/lua
 
UTIL = require 'luci.util'
JSON = require 'luci.jsonc' 
 
rawdata = UTIL.exec("ubus call gps info")
if rawdata == nil or rawdata == '' then
  os.exit()
end
 
gpsdata = JSON.parse(rawdata)
if gpsdata.signal == false then
   UTIL.exec("uci set gluon-node-info.@location[0].share_location='0'")
   os.exit()
end
 
UTIL.exec("uci set gluon-node-info.@location[0].share_location='1'")
UTIL.exec("uci set gluon-node-info.@location[0].latitude=" .. gpsdata.latitude)
UTIL.exec("uci set gluon-node-info.@location[0].longitude=" .. gpsdata.longitude)

Position automatisch aktualisieren:

/usr/lib/micron.d/gps
*/15 * * * * /usr/scripts/locationupdate.lua
gps.1475074006.txt.gz · Zuletzt geändert: 28.09.2016 16:46 von havelock