Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPSD Permissions Issues #91

Open
arzulo opened this issue Oct 13, 2020 · 2 comments
Open

GPSD Permissions Issues #91

arzulo opened this issue Oct 13, 2020 · 2 comments

Comments

@arzulo
Copy link

arzulo commented Oct 13, 2020

I'm having an issue with permissions between my XTRX and gpsd to try and read GPS data. No matter how I format permissions, I end up with the error...

sudo gpsd -D 5 -N -n /dev/ttyXTRX0
gpsd:INFO: launching (Version 3.20)
gpsd:IO: opening IPv4 socket
gpsd:IO: opening IPv6 socket
gpsd:INFO: listening on port gpsd
gpsd:PROG: NTP: shmat(14,0,0) succeeded, segment 0
gpsd:PROG: NTP: shmat(15,0,0) succeeded, segment 1
gpsd:PROG: NTP: shmat(16,0,0) succeeded, segment 2
gpsd:PROG: NTP: shmat(17,0,0) succeeded, segment 3
gpsd:PROG: NTP: shmat(18,0,0) succeeded, segment 4
gpsd:PROG: NTP: shmat(19,0,0) succeeded, segment 5
gpsd:PROG: NTP: shmat(20,0,0) succeeded, segment 6
gpsd:PROG: NTP: shmat(21,0,0) succeeded, segment 7
gpsd:PROG: successfully connected to the DBUS system bus
gpsd:PROG: shmget(0x47505344, 24024, 0666) for SHM export succeeded
gpsd:PROG: shmat() for SHM export succeeded, segment 22
gpsd:INFO: stashing device /dev/ttyXTRX0 at slot 0
gpsd:PROG: no /etc/gpsd/device-hook present, skipped running ACTIVATE hook
gpsd:INFO: SER: opening GPS data source type 2 at '/dev/ttyXTRX0'
gpsd:ERROR: SER: device open of /dev/ttyXTRX0 failed: Permission denied - retrying read-only
gpsd:ERROR: SER: read-only device open of /dev/ttyXTRX0 failed: Permission denied
gpsd:ERROR: initial GPS device /dev/ttyXTRX0 open failed
gpsd:ERROR: can't run with neither control socket nor devices open

I've gone through the setup at https://github.com/xtrx-sdr/images#non-root-access-for-devxtrx0 in order to have non-root access, as well as all other setup procedures in the images repo.
I also have gpsd and my user account included into the dialout group since I see that's what the XTRX is under.

I am able to see GPS data however by connection directly through serial via minicom -D /dev/ttyXTRX0

Any idea what's going on?

@arzulo arzulo mentioned this issue Oct 16, 2020
@mind22
Copy link

mind22 commented Aug 13, 2021

I had the same problem and solved it by adding "XTRX" into the apparmor config file (Ubuntu 20.04).

Steps to do:

sudo nano /etc/apparmor.d/usr.sbin.gpsd

# add 'XTRX' after 'AMA' into following lines:

# ------------------------------------------------------------------------------
# common serial paths to GPS devices
/dev/tty{,S,USB,AMA,ACM,XTRX}[0-9]*    rw,

# default paths feeding GPS data into chrony
/{,var/}run/chrony.tty{,S,USB,AMA,XTRX}[0-9]*.sock rw,
/tmp/chrony.tty{,S,USB,AMA,XTRX}[0-9]*.sock rw,
# ------------------------------------------------------------------------------

sudo systemctl restart apparmor

# test gpsd if service disabled, else restart service gpsd
sudo gpsd -N -n -D 5 /dev/ttyXTRX0 /dev/pps0

br

@calebschmurr
Copy link

calebschmurr commented Sep 2, 2024

Thanks for the help - I had a similar issue when using gpsfake.

I was receiving:
gpsfake:ERROR: SER: device open of /dev/pts/4 failed: Permission denied - retrying read-only

I had to add
/dev/pts/[0-9]* rw,
to the apparmor file. I don't think it matters where you stick that line, I placed it under the
#pps related devices
section.

Restart apparmor service as mind22 outlined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants