Gpsd needs some time to create its Unix socket after the process starts.
The hotplug call in service_started() is triggered too early, before the
socket is ready, causing failures in scripts that depend on it.
Additionally, when gpsd crashes and procd respawns it, service_started() is
not called again, so no hotplug event is emitted on respawn. Therefore scripts
listening for gpsd availability miss the STARTED event.
This commit ensures the hotplug call waits for the socket to appear,
so dependent scripts reliably see the STARTED event, even after respawns.
Signed-off-by: Oliver Sedlbauer <os@dev.tdt.de>
More than one device can be added to the gpsd at startup. Currently the gpsd
service start script in OpenWrt treats this as an option with only one value.
To allow multiple devices to be specified, the uci 'option device' must be
removed and a new uci 'list devices' is added.
This change means that several devices can be specified at gpsd start with
the new uci 'list devices' configuration.
Running configurations in the field are migrated by a migration script.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
The 'readonly' option tells the GPSD that it is not allowed to write to the
GPS TTY, only reading the NMEA data stream is allowed. This option of the
GPSD must be set for my mobile radio device MV31, otherwise the GPSD can not
read the NMEA data stream on the GPS TTY because the GPSD blocks during
plugin probing.
gpsd:PROG: CORE: Probing "Garmin USB binary" driver...
gpsd:PROG: CORE: Probe not found "Garmin USB binary" driver...
gpsd:PROG: CORE: Probing "GeoStar" driver...
gpsd:PROG: Sent GeoStar packet id 0xc1
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
The 'gpsd' offers the possibility to call the script '/etc/gpsd/device-hook'
when a GPS source was added or removed via gpsdctl.
In addition to the '/etc/gpsd/device-hook' call an event is now triggered
too after the 'gpsd' has started. This allows scripts to configurre 'gpsd'
receivers.
The following events are available for '/etc/hotplug.d/gpsd' scripts:
* ACTIVATE via '/etc/gpsd/device-hook'
* DEACTIVATE via '/etc/gpsd/device-hook'
* STARTED via '/etc/init.d/gpsd'
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This change makes it possible to add new gps device without restarting the
'gpsd' service by using the 'gpsdctl' command.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This replaces the use of uci_validate_section() with
uci_load_validate(), which removes the need to declare local variables
for every config option.
This also adds a service_triggers() function and removes some
unnecessary curly brackets.
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Because this selects ttyUSB0 (bad choice) by default, turn off enabling gps
by default until the user set's the tty manually and will stop gpsd from
stomping on another device's tty.
Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com>
This package is currently in oldpackages. Add here to keep support for gpsd.
From oldpackages, this was bumped from 3.10 -> 3.15 and includes an upstream
patch to allow building with musl.
Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com>