<div dir="ltr">On Sun, Mar 6, 2016 at 8:43 PM, Tony Anderson <span dir="ltr"><<a href="mailto:tony_anderson@usa.net" target="_blank">tony_anderson@usa.net</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi, Adam<br>
<br>
That is surprising. I thought that was the goal of your micro server
program. Does this mean that you are using the laptops as clients
with access to <br>
an sdcard local to that machine only?<br></div></blockquote><div><br></div><div>In some Haiti schools, yes: self-sufficient XO-1's each containing 32GB SD cards and there is no school server, no network, no food for the kids, etc.<br></div><div> <br></div><div>PS Am cc'ing School Server mailing lists so that your offline-NTP-via-schoolserver contribution below is appreciated!<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
The backup is performed on the XO. This routine provides the
'synchronization'.<br>
<br>
import os, re, sys, time<br>
from urllib2 import URLError, HTTPError, urlopen<br>
from subprocess import Popen, PIPE, call<br>
import datetime<br>
<br>
<br>
<br>
def sync_time_to_xs():<br>
<br>
try:<br>
xstime = urlopen('<a href="http://schoolserver/kls/time" target="_blank">http://schoolserver/kls/time</a>')<br>
except:<br>
print 'urlopen exception', sys.exc_info()[2]<br>
return<br>
response = xstime.read().replace('\n','')<br>
"""<br>
cmd = 'su'<br>
call(cmd, shell=True)<br>
cmd = 'date --set="' + response + '"'<br>
call(cmd, shell=True)<br>
call('exit ',shell=True)<br>
"""<br>
txtout = 'sudo date --set="' + response + '"'<br>
print txtout<br>
fout = open('/tmp/xstime','w')<br>
fout.write(txtout)<br>
fout.close()<br>
<br>
kls is a django app so the url gets time 'now' from the server and
returns it via urllib2. The txtout uses subprocess to execute the
date set command. <br>
The problem is that the date --set command must be done by root from
a tty (e.g. cli). <br>
<br>
So, I don't know if xsce is using django. In any case, a script
urllib command can be made to retrieve the current time on the
school server. A script executed from the XO can use this time to
set the XO time. All of this could be set up as a button in the
control panel (cpsection). Such a button would meet the tty
requirement. Naturally, all of this depends on having the xsce
server with the correct time (in any case as the master whether
correct or not). The date command allows for showing the time in the
local timezone although the master time is kept in UTC.<br>
<br>
Tonu<div><div class="h5"><br>
<br>
<div>On 03/07/2016 08:36 AM, Adam Holt
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">On Sun, Mar 6, 2016 at 6:58 PM, Tony Anderson <span dir="ltr"><<a href="mailto:tony_anderson@usa.net" target="_blank">tony_anderson@usa.net</a>></span>
wrote:<br>
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Adam<br>
<br>
I have a script that attempts to accomplish this through
ds_backup. The goal is to have all of the clients with
the same time as the school server (may not be internet
accurate but at least gives some consistency to time
stamps). The problem is that this must be done by a
command issued from a tty. In the case <br>
of xsce, this could be done at connect-time when the XO1
time is off by more than X.<br>
</div>
</blockquote>
<div><br>
</div>
<div>Cool, please post?<br>
</div>
<div><br>
</div>
<div>My problem is there are many school in Haiti that do
not and will not have school servers -- for the forseeable
future -- so let's attack this problem from both angles --
thanks!<br>
</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Tony
<div>
<div><br>
<br>
<div>On 03/07/2016 01:19 AM, Adam Holt wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div>
<div dir="ltr">
<div>(Apologies I forgot to mention that
auto-mounting and auto-dismounting the USB
stick is likely the hard part -- untrained
teachers simply cannot handle mount-point
ambiguities, if they can handle the
command-line at all -- suggestions on how to
solve this elegantly most appreciated!)<br>
<br>
</div>
PS we are happy to mandate that teachers must
supply an empty/formatted FAT32 stick or similar
if that's the best practice?<br>
<br>
<div>
<div>
<div class="gmail_extra">
<div class="gmail_quote">On Sun, Mar 6,
2016 at 12:08 PM, Adam Holt <span dir="ltr"><<a href="mailto:holt@laptop.org" target="_blank"></a><a href="mailto:holt@laptop.org" target="_blank">holt@laptop.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">In short, <a href="http://NTP.org" target="_blank"></a><a href="http://NTP.org" target="_blank">http://NTP.org</a>
- by - sneakernet, not carrier
pigeon :>
<div>
<div><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On
Sun, Mar 6, 2016 at 12:06
PM, Adam Holt <span dir="ltr"><<a href="mailto:holt@laptop.org" target="_blank"></a><a href="mailto:holt@laptop.org" target="_blank">holt@laptop.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">Clarifs
below~<br>
<div><span><br>
On Sun, Mar 6, 2016
at 11:51 AM, Adam
Holt <span dir="ltr"><<a href="mailto:holt@laptop.org" target="_blank"></a><a href="mailto:holt@laptop.org" target="_blank">holt@laptop.org</a>></span>
wrote:<br>
</span>
<div class="gmail_extra">
<div class="gmail_quote"><span>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>In Haiti
many teachers
and kids would
prefer the
time was set
correctly on
their XO-1
laptops, no
matter if the
time is off by
a couple
minutes. So
they could
really use a
script that
creates the
following
/boot/olpc.fth,
writing it out
to an attached
USB stick:<br>
</div>
<div>
<pre style="margin-left:40px">\ Open Firmware
select /rtc decimal 0 0 0 1 1 1804 set-time
\ Optionally unlock XO
disable-security
</pre>
Then the
teacher/operator
can walk
around the
room to fix
all XO's
clocks
(refreshing
the USB time
as often as
she/he
wants). Of
course not
every day can
be Haitian
Independence
Day (Jan 1
1804!) so what
the script
should really
do is create a
timestamp 1
minute into
the future,
filling out
those 6
numbers above
correctly.<br>
<br>
The untrained
operator
(teacher
typically)
will then move
the USB stick
to the XO(s)
in need, to
set their
RTC's
(real-time-clocks).
Some ambitious
teachers will
want to do
this every
month/semester
it appears, to
sanitize/harmonize
all clocks in
their
classroom/school
as much as
possible!<br>
<br>
</div>
<div>Any
recommended
approaches to
getting the UX
clean, so that
such untrained
operator have
a visual
confirmation
that the USB
stick has been
updated with a
proper
time-stamp,
and (perhaps
just as
important??)
the stick
mounted+unmounted
effortlessly
without too
much risk,
when this USB
stick is
recreated
hundreds of
times within 1
day? A
non-confusing
command line
script can
work, that
says basically
2 things:<br>
<ul>
<li>PLEASE
INSERT A USB
STICK<br>
</li>
<li>USB STICK
READY: REMOVE
IT NOW!</li>
</ul>
The less
keyboard
activity
required from
the teacher
the better.
But I'm
tempted by
command syntax
as follows:<br>
</div>
</div>
</blockquote>
</span>
<div><br>
<div style="margin-left:40px">usb-timestamper
<minute<u><b>s</b></u>-into-the-future></div>
</div>
<span>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>Such that
running
"/bin/usb-timestamper
5" would
create USB
sticks
timestamped 5
minutes into
the future.
The default
should be 1
minute into
the future, so
running
"/bin/usb-timestamper"
would be
equivalent to
"/bin/usb-timestamper
1".<br>
<br>
Conclusion: am
just looking
for general
suggestions
from everyone
as we cook up
something
simple!</div>
</div>
</blockquote>
</span>
<div><br>
We do not want
to rely on
networking or
mesh At All.
KISS (key it
simple/stupid)
at the firmware
level allows the
teacher/operator
to move thru the
classroom quite
rapidly, fixing
the time on each
XO laptop as
often as s/he
wants. 2
examples
scenarios,
showing how this
will be used:<br>
</div>
<div>
<ol>
<li>Teacher/operator
may choose to
run
"usb-timestamper
10" once as
s/he enters
each
classroom, if
she wants to
timestamp the
USB stick
10min into the
future, and
then apply
this rapidly
to all 50 XO's
in a
classroom/lab
over the
coming
20minutes.
Works great
ifs/he does
not care that
the XO's
clocks are off
by +/- 10min!</li>
<li>Or if
teacher/operator
is
perfectionist,
then
usb-timestamper
(interactive
command-line
program) can
be left
running on hir
own XO laptop
that s/he
carries around
the room --
updating the
USB stick
repeatedly
while walking
around the
classroom --
such that each
of that room's
50 XO laptops
has an
almost-exact
clock,
accurate
within a
minute or so.</li>
</ol>
</div>
<span>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>in this
case, as USB
sticks are the
most reliable
and quick
approach in
this case.<br>
<br>
</div>
<div>Clarif: I
will of course
train the
teacher/operator
to set the
clock
correctly on
their own
XO-1, which
will typically
be running
OLPC OS 13.2.7
-- so that all
these
"offline-NTP
sticks" are
created based
on a
reasonably
accurate
baseline
timestamp :)<br clear="all">
<br>
--<br>
<div>
<div dir="ltr">Unsung
Heroes of
OLPC,
interviewed
live @ <a href="http://unleashkids.org" target="_blank"></a><a href="http://unleashkids.org" target="_blank">http://unleashkids.org</a>
!</div>
</div>
</div>
</div>
</blockquote>
</span></div>
<span><br>
<br clear="all">
<br>
-- <br>
<div>
<div dir="ltr">Unsung
Heroes of
OLPC,
interviewed
live @ <a href="http://unleashkids.org" target="_blank"></a><a href="http://unleashkids.org" target="_blank">http://unleashkids.org</a>
!<br clear="all">
<br>
-- <br>
<div>
<div dir="ltr">Unsung
Heroes of
OLPC,
interviewed
live @ <a href="http://unleashkids.org" target="_blank"></a><a href="http://unleashkids.org" target="_blank">http://unleashkids.org</a>
!<br clear="all">
<br>
-- <br>
<div>
<div dir="ltr">Unsung
Heroes of
OLPC,
interviewed
live @ <a href="http://unleashkids.org" target="_blank"></a><a href="http://unleashkids.org" target="_blank">http://unleashkids.org</a>
!</div>
</div>
</div>
</div>
</div>
</div>
</span></div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
-- <br>
Unsung Heroes of OLPC, interviewed live @ <a href="http://unleashkids.org" target="_blank"></a><a href="http://unleashkids.org" target="_blank">http://unleashkids.org</a>
!<br>
</div>
</div>
--- <br>
You received this message because you are subscribed
to the Google Groups "Unleash Kids" group.<br>
To unsubscribe from this group and stop receiving
emails from it, send an email to <a href="mailto:unleashkids+unsubscribe@googlegroups.com" target="_blank"></a><a href="mailto:unleashkids+unsubscribe@googlegroups.com" target="_blank">unleashkids+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/optout</a>.<br>
</blockquote>
<br>
</div>
<span>
-- <br>
Unsung Heroes of OLPC, interviewed live @ <a href="http://unleashkids.org" target="_blank"></a><a href="http://unleashkids.org" target="_blank">http://unleashkids.org</a> !<br>
</span>
--- <br>
You received this message because you are subscribed to
the Google Groups "Unleash Kids" group.<br>
To unsubscribe from this group and stop receiving emails
from it, send an email to <a href="mailto:unleashkids+unsubscribe@googlegroups.com" target="_blank">unleashkids+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/optout</a>.<br clear="all">
<br>
-- <br>
<div>
<div dir="ltr">Unsung Heroes of OLPC, interviewed live @
<a href="http://unleashkids.org" target="_blank">http://unleashkids.org</a>
!</div>
</div>
</blockquote>
</div>
</div>
</div>
-- <br>
Unsung Heroes of OLPC, interviewed live @ <a href="http://unleashkids.org" target="_blank"></a><a href="http://unleashkids.org" target="_blank">http://unleashkids.org</a>
!<br>
--- <br>
You received this message because you are subscribed to the Google
Groups "Unleash Kids" group.<br>
To unsubscribe from this group and stop receiving emails from it,
send an email to <a href="mailto:unleashkids+unsubscribe@googlegroups.com" target="_blank">unleashkids+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/optout</a>.<br>
</blockquote>
<br>
</div></div></div><div class="HOEnZb"><div class="h5">
<p></p>
-- <br>
Unsung Heroes of OLPC, interviewed live @ <a href="http://unleashkids.org" target="_blank">http://unleashkids.org</a> !<br>
--- <br>
You received this message because you are subscribed to the Google Groups "Unleash Kids" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:unleashkids+unsubscribe@googlegroups.com" target="_blank">unleashkids+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/optout</a>.<br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr">Unsung Heroes of OLPC, interviewed live @ <a href="http://unleashkids.org" target="_blank">http://unleashkids.org</a> !</div></div>
</div></div>
</blockquote></div></div></div>