gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-users] syslog error message with new version - kernel PPS fail


From: hans mayer
Subject: Re: [gpsd-users] syslog error message with new version - kernel PPS failed Connection timed out
Date: Thu, 06 Aug 2015 22:16:13 +0200
User-agent: Mozilla/5.0 (Windows NT 6.0; rv:24.0) Gecko/20100101 Thunderbird/24.1.1


Yo Gary,

> OK.  Be aware that driver can only use one edge...

I know. Actually it didn't work on a Banana PI at all.
With Bananian Linux! version: 15.04 - kernel 3.4.108+
It only worked on Raspberry PI.
I had to add this patch  https://github.com/infinet/bananapi
And I do not know how to use the other edge - and how ?
I don't need it.
So it's not an issue for me (currently).


> Yes, sub optimal, only for testing and historical interest.

Therefore I am looking for a better solution.


> Yes, because you have not told gpsd how to access the /dev/pps0,

How can I ?


> How are you starting gpsd?

/usr/local/sbin/gpsd -n -F /var/run/gpsd.sock -P /var/run/gpsd.pid /dev/ttyS2


> You are starting gpsd as root, right?

Yes, of course.


> What are the permissions on your /dev/pps0?

Original - after a boot - it is this:
crw------- 1 root root    242, 0 Aug  6 14:09 /dev/pps0
and I also changed group and permissions
crw-rw---- 1 root dialout 242, 0 Aug  6 14:09 /dev/pps0
no change in the behaviour

BUT !!

I started gpsd in debug mode
/usr/local/sbin/gpsd -n -N -F /var/run/gpsd.sock -D 4 /dev/ttyS2
I do not know why I hadn't this idea earlier. :-(

And I have seen it creates it's own /dev/pps1

gpsd:PROG: KPPS:/dev/ttyS2 checking /sys/devices/virtual/pps/pps0/path,
gpsd:PROG: KPPS:/dev/ttyS2 checking /sys/devices/virtual/pps/pps1/path, /dev/ttyS2
gpsd:INFO: KPPS:/dev/ttyS2 RFC2783 path:/dev/pps1, fd is 7

ls shows:
crw------- 1 root root    242, 1 Aug  6 21:54 /dev/pps1

If the process terminates then also the device is gone.

Of course it runs into a time-out if it does not use the one
provided from the system.
Attached the debug trace of some seconds running gpsd with -D 5.
This rises the question why is it creating pps1 instead
of using pps0 ?


> You can not have followed the time service howto and used rpi_gpio_ntp
> at the same time.

You are completely right.
But you can imagine I walked a stony way. As I said:
>> And I run the NTP configuration you mentioned in this doc.
Because of the fact that gpsd is currently not doing as I expect
I was happy to bring it up and running with "rpi_gpio_ntp"
in the first attempt.
But in any case. Your page is a big help if one carries together
all these puzzle stones of a new big puzzle.

I am looking forward to find a solution.


Kind regards
Hans



Am 05.08.2015 23:44, schrieb Gary E. Miller:
Yo hans!

On Wed, 05 Aug 2015 23:27:32 +0200
hans mayer <address@hidden> wrote:

For easy reading I pick out the relevant parts.
I hope this is convenient.

Except you tend to remove relevant parts!

  > But you fail to mention how you enabled /dev/pps0.

I put a line with "pps-gpio" into /etc/modules
and file /etc/modprobe.d/pps-gpio.conf has:
options pps-gpio gpio_pin=18
and after a reboot it was there and available for ppstest

OK.  Be aware that driver can only use one edge...

  >> and NTP also working fine with PPS/ATOM support 127.127.22.0
  > Using what config?

# Enabling PPS/ATOM support
server 127.127.22.0 minpoll 5 maxpoll 6
fudge 127.127.22.0 refid PPS time1 -0.0053
fudge 127.127.22.0 flag3 1  # enable kernel PLL/FLL clock discipline

# gpsd shared memory clock
server 127.127.28.0 minpoll 5 maxpoll 6 prefer  # PPS requires at
least one preferred peer
fudge 127.127.28.0 refid GPS
fudge 127.127.28.0 time1 +0.110  # coarse processing delay offset

Uh, don't do that!  See the gpsd time server howto for how to use SHM
instead of having ntpd directly access the GPS.

  >> And how ?
  > By opening /dev/pps0

hmm ??
I thought NTP is doing this.

No.  Please read the gpsd time service howto.

The ntpd driver for atom/gps is pretty primitive.  If you insist on doing
it this way then gpsd can not access the PPS, KPPS or GPS since ntpd has
already opened those devices.

But obviously there are at least 2 methods to do it.

Obviously.

But this error message is also coming without running NTP.
So it's not a thing of "you are not allowed because I do"

Which would be the bases for a different thread.  let us not try
to do two things at once.

  > And your confusion is?

The error message itself: ERROR: KPPS:/dev/ttyS2
What has ttyS2 to do with kernel PPS ?

They are both connected to the GPS, and gpsd needs both of them to
access the GPS time.  But you already configured ntpd to grab those
resources.

ttyS2 is RxData pin and the kernel PPS is generated in my case out of
GPIO pin 18, which is a different pin.

Correct.  And the gpsd time service howto will tell you how to associate
them.

So how to interpret this message: ERROR: KPPS:/dev/ttyS2 ?

That you can do better.  gpsd is not getting KPPS time, which shoould
be obvious since you told ntpd to manage the GPS.  That is a bad plan.

  > Since gpsd is outputting the KPPS error you obviously built with
  > pps=yes.

This is the default. So the answer is yes.

Yes.

  >> The 1PPS is directly managed by the ntp daemon itself.
  > It can be, but that is not the best way.
  > The best way is to have gpsd do it.

Ok, this doesn't contradict the information I found, but is
slightly different.
Originally I run a programm called "rpi_gpio_ntp". Maybe you know it.
It reads the GPIO pin and writes to shared memory.
I read this is not an optimum as this task runs in user space ( as
it is the same with "gpsd" ) and generated an additional jitter.
It's better NTP reads directly the KPPS.

Yes, sub optimal, only for testing and historical interest.

This is what I have seen. Maybe not true.

Yes, true, and not relevant to the current problem.

  > If you are in fact telling ntpd to open /dev/pps0 then that
  > perfectly explains why gpsd can not open /dev/pps0.

Partly not. As I said, even if "ntpd" is NOT running I have this
error.

Yes, because you have not told gpsd how to access the /dev/pps0, or
it has permissions that do not allow gpsd to read it.  You need to
follow the gpsd time service howto to configure your setup.

Just for debugging purposes:

How are you starting gpsd?

You are starting gpsd as root, right?

What are the permissions on your /dev/pps0?

  > Read the gpsd time service howto for the preferred configuration.

I found your page weeks ago. Thanks, very useful.
And I run the NTP configuration you mentioned in this doc.

Good.

But - as I said - I used "rpi_gpio_ntp". Very obviously I didn't have
success with having this error.

You can not have followed the time service howto and used rpi_gpio_ntp
at the same tim. rpi_gpio_ntp is suboptimal and only usefull for testing
and historical interest.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1(541)382-8588

Attachment: gps_trace.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]