Re: [Dorset] Raspberry Pi Issue with hwclock

2017-09-10 Thread Terry Coles
On Sunday, 10 September 2017 18:01:50 BST Ralph Corderoy wrote:
> > There's a fair amount of work gone into configuring the system at the
> > moment and I'd rather not have to rebuild it if I don't have to.
> 
> I didn't mean trash your existing SD card's content, but use a spare
> one.  :-)

:-)  I realised that.  It's what I'd have to do to get the clean installation 
to a fully working sumppi that I was referring to.

> I suppose the slaves could send their readings to the master to log
> centrally, then they wouldn't care what time it was.  :-)

The actual software that is monitoring the levels does that, but we want the 
logs so we can see what went wrong and when.  For example the electrics at the 
WMT are sadly in need of an overhaul and the power trips from time to time.  
It's useful to known when this happens, especially since the Pi features a 
fake hwclock which picks up from where it left off, which is useful, but 
confusing in these circumstances.  Probably more relevant to normal ops is 
knowing that the Butts pump cut out at the right time; when the butts were 
nearly full.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-10-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Raspberry Pi Issue with hwclock

2017-09-10 Thread Ralph Corderoy
Hi Terry,

> There's a fair amount of work gone into configuring the system at the
> moment and I'd rather not have to rebuild it if I don't have to.

I didn't mean trash your existing SD card's content, but use a spare
one.  :-)

> It is really confusing if the Sump Pi says that there was 700 mm of
> water in the sump at 10:45 on the 11th and at the same time the Butts
> Pi is recording 100 mm of water in the butts at 17:50 on the 10th.

I suppose the slaves could send their readings to the master to log
centrally, then they wouldn't care what time it was.  :-)

Cheers, Ralph.

-- 
Next meeting:  Bournemouth, Tuesday, 2017-10-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Raspberry Pi Issue with hwclock

2017-09-10 Thread Terry Coles
On Sunday, 10 September 2017 16:24:51 BST Ralph Corderoy wrote:
> > this makes us wait for up to 10 minutes before the system syncs, but
> > when it does the two clocks are exactly the same.
> 
> That's pretty lousy.  It would be nice for the NTP server to know to
> trust the RTC and be happy to start serving it from the off.

Yes.  But we can live with this if we have to.

> > The bad news is that I have got very unreliable timekeeping from the
> > realtime clock on the master Pi.  Sometimes it appears to be keeping
> > time, sometimes it gains or loses several minutes in an hour.
> 
> Start with a freshly downloaded Raspbian image, do the minimum required
> from the instructions to use the RTC, do not add NTP, etc.  Just see if
> the RTC, the kernel, and userspace play well together over the hours and
> days.  Then you'll know it's your tinkering that's the problem.  It
> still smells like multiple parties are trying to adjust for creep.

I'm kind of doing the other thing at the moment; eg disabling NTP and then 
using the hwclock-set script from the Bells system if that doesn't work.  
There's a fair amount of work gone into configuring the system at the moment 
and I'd rather not have to rebuild it if I don't have to.

Having said that, I did upgrade both Pis from Jessie to Stretch, so I may end 
up having to start from scratch.

> Did I ask this before?  Why do the Pis need to be in sync, and to what
> accuracy?  Do they need to know the actual time on the audience's
> wrists, or just be in agreement with each other that it's 15 minutes
> since they last gave us a twirl?

Both Pis are taking readings and logging them to a file.  It is really 
confusing if the Sump Pi says that there was 700 mm of water in the sump at 
10:45 on the 11th and at the same time the Butts Pi is recording 100 mm of 
water in the butts at 17:50 on the 10th.

If NTP proves to be the problem and I'm not able to suss out why, then we'll 
write a script to run at boot-up on the Butts Pi to read the system clock on 
the Sump Pi and then set its own clock accordingly.  It's not hard to do, I 
suspect, but NTP seemed to be designed to do that, so that's what we did.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-10-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Raspberry Pi Issue with hwclock

2017-09-10 Thread Ralph Corderoy
Hi Terry,

> this makes us wait for up to 10 minutes before the system syncs, but
> when it does the two clocks are exactly the same.

That's pretty lousy.  It would be nice for the NTP server to know to
trust the RTC and be happy to start serving it from the off.

> The bad news is that I have got very unreliable timekeeping from the
> realtime clock on the master Pi.  Sometimes it appears to be keeping
> time, sometimes it gains or loses several minutes in an hour.

Start with a freshly downloaded Raspbian image, do the minimum required
from the instructions to use the RTC, do not add NTP, etc.  Just see if
the RTC, the kernel, and userspace play well together over the hours and
days.  Then you'll know it's your tinkering that's the problem.  It
still smells like multiple parties are trying to adjust for creep.

Did I ask this before?  Why do the Pis need to be in sync, and to what
accuracy?  Do they need to know the actual time on the audience's
wrists, or just be in agreement with each other that it's 15 minutes
since they last gave us a twirl?

Cheers, Ralph.

-- 
Next meeting:  Bournemouth, Tuesday, 2017-10-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Raspberry Pi Issue with hwclock

2017-09-10 Thread Terry Coles
Guys,

I'm still having problems with our installation at the WMT.  I got NTP to work 
on the 
remote Pi by using Ralph's ntp-wait work-round; this makes us wait for up to 10 
minutes 
before the system syncs, but when it does the two clocks are exactly the same.

That's the good news.  The bad news is that I have got very unreliable 
timekeeping from 
the realtime clock on the master Pi.  Sometimes it appears to be keeping time, 
sometimes 
it gains or loses several minutes in an hour.  One problem is that everything I 
try 
necessitates a delay of at least an hour or so before anything useful can be 
seen (and of 
course if it is keeping time then I have to wait even longer) ;-(

The setup I have is that the master Pi has a RASClock purchased from ModMyPi, 
but 
sourced from Afterthought Software.  The setup instructions are here:
https://afterthoughtsoftware.com/products/rasclock.

I originally posted on the ModMyPi Forum about this, but the response was 
fairly poor.  
One issue I had was that we have updated the installation on the two Pis to 
Raspbian 
Stretch; the last time I used one of these it was for the Bells software on 
Jessie.

Now to the question.  I was comparing the hwclock-set file on my Bells SD Card 
with the 
same file on the Sump Pi SD Card and I noticed a difference.  The Bells config 
is missing 
two changes from the Afterthought website:

 *  Comment out or remove the two lines which contain --systz
buts that 's version that works!

I've been reading the man page for hwclock to see what --hctosys and --systz do 
and have 
been struggling to see how relevant this might be and I note the reference to 
NTP.  
Bearing in mind that the NTP server is running on the master Pi (the same one 
that has 
the clock), I'm not sure if it's an issue or not.

Does anyone have any thoughts on this?  I'll quite happily fiddle with the 
settings, to try to 
fix this, but I'd like to know what I'm doing and the inherent delay means that 
it could be 
days before I know if I've fixed it.

-- 



Terry Coles
-- 
Next meeting:  Bournemouth, Tuesday, 2017-10-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR