Martyparty
Posts: 93
Joined: Fri Mar 24, 2017 10:54 am

GPS error

Tue Apr 04, 2017 10:07 am

I am working with a GPS NEO 6M, and I finally get data from both the cat /dev/serial0, and the gpsmon /dev/serial0. But when running sudo gpsmon /dev/serial0, it suddenly stops and I get this message: Read error from device. What's the reason for this?

And when trying to run cgps -s, I get no information, and next to status it stands NO FIX (0 sec), what does this mean?

I am also wondering how I can get this information into a live stream of the coordinates?

Thank you for any answers.

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: GPS error

Tue Apr 04, 2017 12:15 pm

cgps is a client program for GPSD, is GPSD running ?

gpsmon is a program that reads directly from serialport. You should not run this program at the same time as GPSD, only one program should read from the serialport at any time.

Martyparty
Posts: 93
Joined: Fri Mar 24, 2017 10:54 am

Re: GPS error

Tue Apr 04, 2017 12:22 pm

topguy wrote:cgps is a client program for GPSD, is GPSD running ?

gpsmon is a program that reads directly from serialport. You should not run this program at the same time as GPSD, only one program should read from the serialport at any time.

I used this code
sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket

and then

sudo killall gpsd
sudo gpsd /dev/serial0 -F /var/run/gpsd.sock

and then

cgps -s

How do I get the GPSD to run?

Martyparty
Posts: 93
Joined: Fri Mar 24, 2017 10:54 am

Re: GPS error

Tue Apr 04, 2017 12:26 pm

Martyparty wrote:
topguy wrote:cgps is a client program for GPSD, is GPSD running ?

gpsmon is a program that reads directly from serialport. You should not run this program at the same time as GPSD, only one program should read from the serialport at any time.

I used this code
sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket

and then

sudo killall gpsd
sudo gpsd /dev/serial0 -F /var/run/gpsd.sock

and then

cgps -s

How do I get the GPSD to run?
I have also installed the gpsd with this code

sudo apt-get install gpsd gpsd-clients python-gps

Martyparty
Posts: 93
Joined: Fri Mar 24, 2017 10:54 am

Re: GPS error

Tue Apr 04, 2017 12:32 pm

topguy wrote:cgps is a client program for GPSD, is GPSD running ?

gpsmon is a program that reads directly from serialport. You should not run this program at the same time as GPSD, only one program should read from the serialport at any time.
Tried running this code, which is supposed to start gpsd

gpsd -D 5 -N -n /dev/serial0

And got this

gpsd:INFO: launching (Version 3.11)
gpsd:IO: opening IPv4 socket
gpsd:IO: opening IPv6 socket
gpsd:INFO: listening on port gpsd
gpsd:PROG: NTPD shmat(884745,0,0) succeeded, segment 2
gpsd:PROG: NTPD shmat(917514,0,0) succeeded, segment 3
gpsd:PROG: successfully connected to the DBUS system bus
gpsd:PROG: shmat() succeeded, segment 950283
gpsd:PROG: shared-segment creation succeeded,
gpsd:INFO: stashing device /dev/serial0 at slot 0
gpsd:INFO: opening GPS data source type 2 at '/dev/serial0'
gpsd:ERROR: device open failed: Permission denied - retrying read-only
gpsd:ERROR: read-only device open failed: Permission denied
gpsd:ERROR: initial GPS device /dev/serial0 open failed
gpsd:INFO: running with effective group ID 1000
gpsd:INFO: running with effective user ID 1000
gpsd:INFO: startup at 2017-04-04T12:31:00.000Z (1491309060)

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: GPS error

Tue Apr 04, 2017 12:39 pm

sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket
This is where you turned OFF the GPSD..
So to turn in on again you use the opposite commands ( "enable" and "start" )

But you have to contigure GPSD so it uses correct serialport and baudrate.

Martyparty
Posts: 93
Joined: Fri Mar 24, 2017 10:54 am

Re: GPS error

Fri Apr 21, 2017 10:22 am

topguy wrote:
sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket
This is where you turned OFF the GPSD..
So to turn in on again you use the opposite commands ( "enable" and "start" )

But you have to contigure GPSD so it uses correct serialport and baudrate.
Thank you. I got it working the other day, when turning it on, but today it is not working again.. I thought the serialport was supposed to be turned off?

Martyparty
Posts: 93
Joined: Fri Mar 24, 2017 10:54 am

Re: GPS error

Fri Apr 21, 2017 10:24 am

Error when using the code

gpsmon /dev/serial0

I get this message

tcp://localhost:2947:dev/seriaJSON slave driver>
(115) {"class":"VERSION","release":"3.11","rev":"3.11-3","proto_major":3,"proto_
minor":9,"remote":"tcp://localhost:2947"}
(59) {"class":"ERROR","message":"No such device as dev/serial0"}

What's the reason for this?

Martyparty
Posts: 93
Joined: Fri Mar 24, 2017 10:54 am

Re: GPS error

Fri Apr 21, 2017 11:09 am

Now when running gpsmon /dev/serial0

I get this error

gpsmon:ERROR: device open failed: No such file or directory - retrying read-only
gpsmon:ERROR: read-only device open failed: No such file or directory
gpsmon: activation of device /dev/serial0 failed, errno=2 (No such file or directory)

Does anyone know why this happens now?

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: GPS error

Fri Apr 28, 2017 8:11 am

Martyparty wrote:I am working with a GPS NEO 6M, and I finally get data from both the cat /dev/serial0, and the gpsmon /dev/serial0. But when running sudo gpsmon /dev/serial0, it suddenly stops and I get this message: Read error from device. What's the reason for this?

And when trying to run cgps -s, I get no information, and next to status it stands NO FIX (0 sec), what does this mean?

I am also wondering how I can get this information into a live stream of the coordinates?

Thank you for any answers.
Are you using a Pi for this? If so, why post in off-topic?
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Return to “Off topic discussion”