绑定我的移动 GPS 后,我无法启动 xgps 并出现错误。
gpsmon /dev/rfcomm0 工作正常。我的有线 gps 也工作正常!!
我的程序收到错误消息:
$ sudo rfcomm bind rfcomm0 C0:EE:FB:20:94:C2 7
$ sudo systemctl status gpsd*
● gpsd.socket - GPS (Global Positioning System) Daemon Sockets
Loaded: loaded (/etc/systemd/system/gpsd.socket; enabled; vendor preset: enabled)
Active: active (running) since Sun 2021-03-14 18:32:56 CET; 5min ago
Triggers: ● gpsd.service
Listen: /run/gpsd.sock (Stream)
[::1]:2947 (Stream)
127.0.0.1:2947 (Stream)
Tasks: 0 (limit: 18994)
Memory: 72.0K
CGroup: /system.slice/gpsd.socket
Mär 14 18:32:56 OMEN-17cbxxxx systemd[1]: Listening on GPS
(Global Positioning System) Daemon Sockets.
● gpsd.service - GPS (Global Positioning System) Daemon
Loaded: loaded (/lib/systemd/system/gpsd.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2021-03-14 18:32:56 CET; 5min ago
TriggeredBy: ● gpsd.socket
Process: 1300 ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $DEVICES (code=exited, status=0/SUCCESS)
Main PID: 1305 (gpsd)
Tasks: 1 (limit: 18994)
Memory: 1.5M
CGroup: /system.slice/gpsd.service
└─1305 /usr/sbin/gpsd /dev/rfcomm0
Mär 14 18:32:56 OMEN-17cbxxxx systemd[1]: Starting GPS (Global Positioning System) Daemon...
Mär 14 18:32:56 OMEN-17cbxxxx systemd[1]: Started GPS (Global Positioning System) Daemon.
$ xgps
xgps: host localhost port 2947
$ sudo systemctl status gpsd*
● gpsd.socket - GPS (Global Positioning System) Daemon Sockets
Loaded: loaded (/etc/systemd/system/gpsd.socket; enabled; vendor preset: enabled)
Active: active (running) since Sun 2021-03-14 18:32:56 CET; 5min ago
Triggers: ● gpsd.service
Listen: /run/gpsd.sock (Stream)
[::1]:2947 (Stream)
127.0.0.1:2947 (Stream)
Tasks: 0 (limit: 18994)
Memory: 72.0K
CGroup: /system.slice/gpsd.socket
Mär 14 18:32:56 OMEN-17cbxxxx systemd[1]: Listening on GPS (Global Positioning System) Daemon Sockets.
● gpsd.service - GPS (Global Positioning System) Daemon
Loaded: loaded (/lib/systemd/system/gpsd.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2021-03-14 18:32:56 CET; 5min ago
TriggeredBy: ● gpsd.socket
Process: 1300 ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $DEVICES (code=exited, status=0/SUCCESS)
Main PID: 1305 (gpsd)
Tasks: 1 (limit: 18994)
Memory: 1.6M
CGroup: /system.slice/gpsd.service
└─1305 /usr/sbin/gpsd /dev/rfcomm0
Mär 14 18:32:56 OMEN-17cbxxxx systemd[1]: Starting GPS (Global Positioning System) Daemon...
Mär 14 18:32:56 OMEN-17cbxxxx systemd[1]: Started GPS (Global Positioning System) Daemon.
Mär 14 18:38:37 OMEN-17cbxxxx gpsd[1305]: gpsd:ERROR: SER: device open of /dev/rfcomm0 failed: Permission denied - retrying read-only
Mär 14 18:38:37 OMEN-17cbxxxx gpsd[1305]: gpsd:ERROR: SER: read-only device open of /dev/rfcomm0 failed: Permission denied
Mär 14 18:38:37 OMEN-17cbxxxx gpsd[1305]: gpsd:ERROR: /dev/rfcomm0: device activation failed.
Mär 14 18:38:37 OMEN-17cbxxxx gpsd[1305]: gpsd:ERROR: /dev/rfcomm0: activation failed, freeing device
看起来,xgps 阻止了 gpsd?!!gpsmon /dev/rfcomm0 运行正常!!