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

GPS error

Fri Apr 21, 2017 12:37 pm

I have tried using cat /dev/serial0, cgps -s and gpsmon /dev/serial0, and it all worked last time I tried, but today when

Trying to run gpsmon /dev/serial0

I get this message

gpsmon: ERROR: device open failed:Permission denied - retrying read only
gpsmon: ERROR: read-only device open failed: Permission denied
gpsmon: activation of device /dev/serial0 failed, errno=13 (Permission denied)

Does anyone know what's the reason for this? Is it possible that my battery on my GPS neo 6M is flat?

User avatar
bensimmo
Posts: 4621
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: GPS error

Fri Apr 21, 2017 1:33 pm

What does gpsmon on its own say?

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

Re: GPS error

Fri Apr 21, 2017 1:36 pm

bensimmo wrote:What does gpsmon on its own say?
tcp://localhost:2947 JSON slave driver>
(115) {"class":"VERSION","release":"3.11","rev":"3.11-3","proto_major":3,"proto_
minor":9,"remote":"tcp://localhost:2947"}
(227) {"class":"DEVICES","devices":[{"class":"DEVICE","path":"tcp://localhost:29
47#/dev/serial0","activated":"2017-04-21T12:55:58.293Z","native":0,"bps":115200,
"parity":"N","stopbits":1,"cycle":1.00}],"remote":"tcp://localhost:2947"}
(154) {"class":"WATCH","enable":true,"json":false,"nmea":false,"raw":2,"scaled":
false,"timing":false,"split24":false,"pps":true,"remote":"tcp://localhost:2947"}

User avatar
bensimmo
Posts: 4621
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: GPS error

Fri Apr 21, 2017 1:57 pm

cd /dev
ls

Can you see ttyAMA0 or serial0

Which Pi are you.

I just hooked mine up to test for you.
I had to disable serial in Raspberry config and reboot, them enable again and reboot.
ttyAMA0 then reappeared in the list (Pi2 here) for some reason it had vanished.

I then cd /dev to check it was there and then
sudo cat ttyAMA0
Is generating the GPS style code.
(Edit or serial0 works now too just tested)

Though neither gpsmon or sudo gpsmon are getting past what you display, but i do have no lock. It did used to go the the screen, just with no lock.

That at least shows the GPS is seeing something.

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

Re: GPS error

Fri Apr 21, 2017 2:07 pm

bensimmo wrote:cd /dev
ls

Can you see ttyAMA0 or serial0

Which Pi are you.

I just hooked mine up to test for you.
I had to disable serial in Raspberry config and reboot, them enable again and reboot.
ttyAMA0 then reappeared in the list (Pi2 here) for some reason it had vanished.

I then cd /dev to check it was there and then
sudo cat ttyAMA0
Is generating the GPS style code.
(Edit or serial0 works now too just tested)

Though neither gpsmon or sudo gpsmon are getting past what you display, but i do have no lock. It did used to go the the screen, just with no lock.

That at least shows the GPS is seeing something.

What do you mean by cd/dev?

I have a raspberry pi 2 model B. I have serial0, which I have used the whole time.
I started with the code
sudo nano /boot/cmdline.txt
and removed console=serial0,115200

But now I tried using this again, and I can see that it has appeared again, so I will delete it once more, and see if it works :)

User avatar
bensimmo
Posts: 4621
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: GPS error

Fri Apr 21, 2017 2:10 pm

Basic file navigation
cd (change directory)
/dev (the directory)

..

I'm checking you can see the data stream off the GPS.

Mine currently sat waiting for a lock then I'll try gpsmon and cgps again.

User avatar
bensimmo
Posts: 4621
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: GPS error

Fri Apr 21, 2017 2:13 pm

Try
sudo gpsmon /dev/serial0 9600

Just noticed it not defaulting to 9600 on you text for gpsmon

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

Re: GPS error

Fri Apr 21, 2017 2:14 pm

bensimmo wrote:Basic file navigation
cd (change directory)
/dev (the directory)

..

I'm checking you can see the data stream off the GPS.

Mine currently sat waiting for a lock then I'll try gpsmon and cgps again.
My serial is disabled.
I still don't get anything. What do you mean by lock?

User avatar
bensimmo
Posts: 4621
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: GPS error

Fri Apr 21, 2017 2:15 pm

Martyparty wrote:
bensimmo wrote:Basic file navigation
cd (change directory)
/dev (the directory)

..

I'm checking you can see the data stream off the GPS.

Mine currently sat waiting for a lock then I'll try gpsmon and cgps again.
My serial is disabled.
I still don't get anything. What do you mean by lock?
GPS satellites lock.

But read just above again.

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

Re: GPS error

Fri Apr 21, 2017 2:17 pm

bensimmo wrote:Try
sudo gpsmon /dev/serial0 9600

Just noticed it not defaulting to 9600 on you text for gpsmon
Now it's working for a few seconds. I get a table with information. Why does it suddenly stop?

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

Re: GPS error

Fri Apr 21, 2017 2:18 pm

Martyparty wrote:
bensimmo wrote:Try
sudo gpsmon /dev/serial0 9600

Just noticed it not defaulting to 9600 on you text for gpsmon
Now it's working for a few seconds. I get a table with information. Why does it suddenly stop?
I get the message "read error from device"

User avatar
bensimmo
Posts: 4621
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: GPS error

Fri Apr 21, 2017 2:24 pm

That's happening to mine and i have a fix(lock).

What does

sudo cat /dev/serial0 give?
It should be the GPS data stream, do you have a lock (aka fix) and any position data?

Some update along the way has messed it up (mines up-to-date as of today).
I never had to use sudo before if i remember correctly and it never failed with that error.
I think gpsmon also detected it as a ublox as trigger it drive (you can force it with. gpsmon (blah blah) -t u-blox )if you want)

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

Re: GPS error

Fri Apr 21, 2017 2:25 pm

When trying to run sudo cat /dev/serial0 I get a long list with NMEA unknown msg*58, which I also got earlier, but solved by using
stty -a -F /dev/serial0
stty -F /dev/serial0 9800
stty -F /dev/Serial0 -echo

to turn off echoing, but no I only get permission denied. How can I solve this?

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

Re: GPS error

Fri Apr 21, 2017 2:28 pm

bensimmo wrote:That's happening to mine and i have a fix(lock).

What does

sudo cat /dev/serial0 give?
It should be the GPS data stream, do you have a lock (aka fix) and any position data?

Some update along the way has messed it up (mines up-to-date as of today).
I never had to use sudo before if i remember correctly and it never failed with that error.
I think gpsmon also detected it as a ublox as trigger it drive (you can force it with. gpsmon (blah blah) -t u-blox )if you want)
Earlier today when I got a table from this code cgps -s, but I got NO FIX (0 sec) and n/a

User avatar
bensimmo
Posts: 4621
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: GPS error

Fri Apr 21, 2017 2:53 pm

Nmea unknown is fine and expected.


BUT i just found out my problem.
I turned on/off serial in the PIXEL raspian settings, it faulty and shouldn't be used.

sudo raspi-config
works.

It allows you to set console to off and device to on

Pixels version doesn't, it either all on or all off?

Anyway.

Check
The file. /boot/config.txt
Has
enable_uart=1

(Not =0) as pixel settings sets

You already have the console removed from you details above
Reboot, wait for a bit and just gpsmon should work with nothing else.
That'll teach me not to check the files they should be setting and trusting it....

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

Re: GPS error

Fri Apr 21, 2017 2:59 pm

bensimmo wrote:Nmea unknown is fine and expected.


BUT i just found out my problem.
I turned on/off serial in the PIXEL raspian settings, it faulty and shouldn't be used.

sudo raspi-config
works.

It allows you to set console to off and device to on

Pixels version doesn't, it either all on or all off?

Anyway.

Check
The file. /boot/config.txt
Has
enable_uart=1

(Not =0) as pixel settings sets

You already have the console removed from you details above
Reboot, wait for a bit and just gpsmon should work with nothing else.
That'll teach me not to check the files they should be setting and trusting it....
Yes its been set to enable_uart=1 the whole time. But what should I do if I have changed it in raspi-config, the P6 serial Enable/disable shell and kernal messages. What should it be set to?

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

Re: GPS error

Fri Apr 21, 2017 3:06 pm

It works now! Thank you so much!!

Do you know any simple way to get the information into a coordinate system? And how can I get the positions without being logged on the Raspberry, but see it online on a computer? :)

User avatar
bensimmo
Posts: 4621
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: GPS error

Fri Apr 21, 2017 3:31 pm

Martyparty wrote:It works now! Thank you so much!!

Do you know any simple way to get the information into a coordinate system? And how can I get the positions without being logged on the Raspberry, but see it online on a computer? :)
Ah you collect the data from /dev/serial0
Strip it and take the bits you need. (Do note and check the coordinate system in use)
And then do whatever you want with it.
In python the module pynmea2 (you'll probably need to install it) can do a lot of it for you and then just a few lines of code is needed.
Then read the file or send it somewhere else.

I do believe gpsd if setup can be use to remotely connect directly to it's stream from another computer, I've not done or tried it.
Something in my to-do but since we've not used GPS here for sometime and nobody seems to need it yet, I've not bothered.

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

Re: GPS error

Fri Apr 21, 2017 3:34 pm

bensimmo wrote:
Martyparty wrote:It works now! Thank you so much!!

Do you know any simple way to get the information into a coordinate system? And how can I get the positions without being logged on the Raspberry, but see it online on a computer? :)
Ah you collect the data from /dev/serial0
Strip it and take the bits you need. (Do note and check the coordinate system in use)
And then do whatever you want with it.
In python the module pynmea2 (you'll probably need to install it) can do a lot of it for you and then just a few lines of code is needed.
Then read the file or send it somewhere else.

I do believe gpsd if setup can be use to remotely connect directly to it's stream from another computer, I've not done or tried it.
Something in my to-do but since we've not used GPS here for sometime and nobody seems to need it yet, I've not bothered.
Ah, I understand. But is it necessary with a python script?
I still don't get cgps -s to work though, any explanations for this?

User avatar
bensimmo
Posts: 4621
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: GPS error

Fri Apr 21, 2017 3:42 pm

Martyparty wrote:
bensimmo wrote:
Martyparty wrote:It works now! Thank you so much!!

Do you know any simple way to get the information into a coordinate system? And how can I get the positions without being logged on the Raspberry, but see it online on a computer? :)
Ah you collect the data from /dev/serial0
Strip it and take the bits you need. (Do note and check the coordinate system in use)
And then do whatever you want with it.
In python the module pynmea2 (you'll probably need to install it) can do a lot of it for you and then just a few lines of code is needed.
Then read the file or send it somewhere else.

I do believe gpsd if setup can be use to remotely connect directly to it's stream from another computer, I've not done or tried it.
Something in my to-do but since we've not used GPS here for sometime and nobody seems to need it yet, I've not bothered.
Ah, I understand. But is it necessary with a python script?
I still don't get cgps -s to work though, any explanations for this?
Cgps needs gpsd setup and running if i remember rightly.


Use python only if that's what you want to use, you have a stream of data coming into /dev/serial0 interface or read it and do with it in many different ways.

That's probably another topic, if you need advice start something new up as a project and see what people can come up with.
It's more than likely been done and just needs tweaking for a 2017 Raspian setup.

profeciak
Posts: 16
Joined: Tue Aug 02, 2016 1:55 pm

Re: GPS error

Tue May 09, 2017 9:36 am

Martyparty wrote:It works now! Thank you so much!!

Do you know any simple way to get the information into a coordinate system? And how can I get the positions without being logged on the Raspberry, but see it online on a computer? :)
And how exactly You made it works? I still cannot make it run

Return to “HATs and other add-ons”