moby: enable gpsd
This commit is contained in:
parent
219bb02cb8
commit
7b21ede5c4
|
@ -14,6 +14,7 @@
|
|||
imports = [
|
||||
./bootloader.nix
|
||||
./fs.nix
|
||||
./gps.nix
|
||||
./kernel.nix
|
||||
./polyfill.nix
|
||||
];
|
||||
|
|
24
hosts/by-name/moby/gps.nix
Normal file
24
hosts/by-name/moby/gps.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
# pinephone GPS happens in EG25 modem
|
||||
# serial control interface to modem is /dev/ttyUSB2
|
||||
# after enabling GPS, readout is /dev/ttyUSB1
|
||||
#
|
||||
# minimal process to enable modem and GPS:
|
||||
# - `echo 1 > /sys/class/modem-power/modem-power/device/powered`
|
||||
# - `screen /dev/ttyUSB2 115200`
|
||||
# - `AT+QGPSCFG="nmeasrc",1`
|
||||
# - `AT+QGPS=1`
|
||||
#
|
||||
# now, something like `gpsd` can directly read from /dev/ttyUSB1.
|
||||
#
|
||||
# initial GPS fix can take 15+ minutes.
|
||||
# meanwhile, services like eg25-manager can speed this up by uploading assisted GPS data to the modem.
|
||||
#
|
||||
# geoclue somehow fits in here as a geospatial provider that leverages GPS and also other sources like radio towers
|
||||
|
||||
{ ... }:
|
||||
{
|
||||
services.gpsd.enable = true;
|
||||
services.gpsd.devices = [ "/dev/ttyUSB1" ];
|
||||
|
||||
# TODO: enable eg25-manager, and bring online both the modem and GPS on boot
|
||||
}
|
|
@ -9,12 +9,18 @@
|
|||
persist.private = [
|
||||
{ type = "file"; path = ".cache/mepo/savestate"; }
|
||||
];
|
||||
|
||||
# give mepo access to gpsd for location data, if that's enabled.
|
||||
# same with geoclue2.
|
||||
suggestedPrograms = lib.optional config.services.gpsd.enable "gpsd"
|
||||
++ lib.optional config.services.geoclue2.enable "geoclue2-with-demo-agent"
|
||||
;
|
||||
};
|
||||
|
||||
programs.mepo = lib.mkIf config.sane.programs.mepo.enabled {
|
||||
# enable location services (via geoclue)
|
||||
enable = true;
|
||||
# more precise, via gpsd ("may require additional config")
|
||||
# programs.mepo.gpsd.enable = true
|
||||
};
|
||||
# programs.mepo = lib.mkIf config.sane.programs.mepo.enabled {
|
||||
# # enable location services (via geoclue)
|
||||
# enable = true;
|
||||
# # more precise, via gpsd ("may require additional config")
|
||||
# # programs.mepo.gpsd.enable = true
|
||||
# };
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user