Re: [time-nuts] beaglebones, time, web services

2015-07-08 Thread Jim Lux

On 7/7/15 9:59 PM, Brian Inglis wrote:

On 2015-07-04 07:13, Jim Lux wrote:

I've got a project I'm working on to make a sophisticated sundial with
moving mirrors.  I've got a batch of Arduinos that move the mirrors to
the appropriate places, given the current sun angle, etc.
I've got a beaglebone that runs some python code to calculate sun
angle based on time
The beaglebone will have a GPS feeding it to get time.
BUT now, I'd like to add a web interface, so that it can be
manipulated by a mobile device using a browser.
One way I can think of is to run some sort of limited web server.
there are a couple that come with the beaglebone, including the python
"simplehttpserver".
But I'm sort of stuck on the interface between the webserver and the
other code running.
I've done this kind of thing where the one task goes out and updates
files in the tree that's being served by the web server, and that
works fine for "status display" kinds of things that don't update very
quickly. It's also nicely partitioned.
but I want to be able to change the behavior of the system (e.g. by
having the server respond to a PUT or something)
Is the best scheme to go in and modify the webserver code to look for
specific URLs requested, and then fire off some custom code to do what
I want?


May want to start with a control web page with an HTML FORM element and
embedded input elements - easy even if you have not done much form
design and entry implementation.
Submit target can be any URL designating a Python CGI script, which
generates at least a Content-type header and HTML on stdout returned to
the browser.
HTML output normally includes a copy of the original FORM (with values
passed selected for editing) as well as HTML output and maybe inline or
linked graphics.
You only need a web server that supports the CGI interface, with some
way to configure it and say where the scripts are.
See Python cgi, html, http module docs to DIY.




Yes, that seems to be the way..
The interesting thing is that the cgi needs to return reasonably fast, 
or the user client will timeout, so it's not a good way to do something 
that takes a long time.  Great for "put parameters in a file" or "send 
short command out IO device", not so great for "start long running 
process that needs to continue after user has gone on to do other things.


So it comes down to lashing up some sort of interprocess communication, 
whether it's a named pipe, a file that is shared between two processes, 
IP sockets, etc.



___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-08 Thread Brian Inglis

On 2015-07-04 07:13, Jim Lux wrote:

I've got a project I'm working on to make a sophisticated sundial with moving 
mirrors.  I've got a batch of Arduinos that move the mirrors to the appropriate 
places, given the current sun angle, etc.
I've got a beaglebone that runs some python code to calculate sun angle based 
on time
The beaglebone will have a GPS feeding it to get time.
BUT now, I'd like to add a web interface, so that it can be manipulated by a 
mobile device using a browser.
One way I can think of is to run some sort of limited web server. there are a couple that 
come with the beaglebone, including the python "simplehttpserver".
But I'm sort of stuck on the interface between the webserver and the other code 
running.
I've done this kind of thing where the one task goes out and updates files in the tree 
that's being served by the web server, and that works fine for "status display" 
kinds of things that don't update very quickly. It's also nicely partitioned.
but I want to be able to change the behavior of the system (e.g. by having the 
server respond to a PUT or something)
Is the best scheme to go in and modify the webserver code to look for specific 
URLs requested, and then fire off some custom code to do what I want?


May want to start with a control web page with an HTML FORM element and 
embedded input elements - easy even if you have not done much form design and 
entry implementation.
Submit target can be any URL designating a Python CGI script, which generates 
at least a Content-type header and HTML on stdout returned to the browser.
HTML output normally includes a copy of the original FORM (with values passed 
selected for editing) as well as HTML output and maybe inline or linked 
graphics.
You only need a web server that supports the CGI interface, with some way to 
configure it and say where the scripts are.
See Python cgi, html, http module docs to DIY.

--
Take care. Thanks, Brian Inglis
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-08 Thread Chris Albertson
The other complication with simple CGI BIN scripts is if you have
multiple clients eating using their own browser.  You have to manage
cookies or track IP addresses.  Or for a simple home server, just let
thing fail if a second client starts making changes

On Mon, Jul 6, 2015 at 7:24 PM, Jim Lux  wrote:
> On 7/6/15 3:19 PM, Tom Harris wrote:
>>
>> Since you want simple just use a CGI script written in your language of
>> choice. Very easy technology to learn, Python has support libraries out of
>> the box if you want. You have a webpge with carious simple controls on it
>> like buttons etc, you click a special button that posts a request to a
>> URL,
>> the webserver runs a script that generates the response, the webserver
>> serves it out, your browser displays it. Why bother with learning a
>> framework? Messing about with mechanics is far more fun!
>>
>>
>
>
>
> The only hiccup with the cgi approach (and with "directly code the action in
> the guts of the server" like with flask) is that the subprocess that's
> spawned has to complete before control returns (e.g. to serve stdout to the
> user). So if you want to fire off a task that will run in parallel with the
> webserver's other stuff, you need to have some sort of interprocess
> communication (e.g. a named pipe, socket, file, MPI communicator, etc.).
> (or you do something like run "at" or "batch", which is basically using a
> file as a interprocess communication, and the at daemon watches the file)
>
>
>
>
> ___
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to
> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.



-- 

Chris Albertson
Redondo Beach, California
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-07 Thread John Laur
A small task queue or message queue would serve the purpose of tying the
webserver to the other external tasks: 1) Web server queues job; 2) polls
via ajax for status or they could run syncronously. Python is not my forte
but there are a number that look like they integrate very well with python.
A couple that look like they might be suitable from a quick google are huey
or celery.

John

On Tue, Jul 7, 2015 at 6:13 AM, Bob Camp  wrote:

> Hi
>
> Having done this on *very* small machines with cgi before, the lag has
> never been
> an issue. Yes, the things I do are “tweaks” to variables, or data
> requests. I do not try
> to spawn a piece of code to compute PI to 800 places and wait for the
> result.
>
> Bob
>
> > On Jul 6, 2015, at 10:24 PM, Jim Lux  wrote:
> >
> > On 7/6/15 3:19 PM, Tom Harris wrote:
> >> Since you want simple just use a CGI script written in your language of
> >> choice. Very easy technology to learn, Python has support libraries out
> of
> >> the box if you want. You have a webpge with carious simple controls on
> it
> >> like buttons etc, you click a special button that posts a request to a
> URL,
> >> the webserver runs a script that generates the response, the webserver
> >> serves it out, your browser displays it. Why bother with learning a
> >> framework? Messing about with mechanics is far more fun!
> >>
> >>
> >
> >
> >
> > The only hiccup with the cgi approach (and with "directly code the
> action in the guts of the server" like with flask) is that the subprocess
> that's spawned has to complete before control returns (e.g. to serve stdout
> to the user). So if you want to fire off a task that will run in parallel
> with the webserver's other stuff, you need to have some sort of
> interprocess communication (e.g. a named pipe, socket, file, MPI
> communicator, etc.).  (or you do something like run "at" or "batch", which
> is basically using a file as a interprocess communication, and the at
> daemon watches the file)
> >
> >
> >
> > ___
> > time-nuts mailing list -- time-nuts@febo.com
> > To unsubscribe, go to
> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> > and follow the instructions there.
>
> ___
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to
> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
>
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-07 Thread Bob Camp
Hi

Having done this on *very* small machines with cgi before, the lag has never 
been
an issue. Yes, the things I do are “tweaks” to variables, or data requests. I 
do not try
to spawn a piece of code to compute PI to 800 places and wait for the result.

Bob

> On Jul 6, 2015, at 10:24 PM, Jim Lux  wrote:
> 
> On 7/6/15 3:19 PM, Tom Harris wrote:
>> Since you want simple just use a CGI script written in your language of
>> choice. Very easy technology to learn, Python has support libraries out of
>> the box if you want. You have a webpge with carious simple controls on it
>> like buttons etc, you click a special button that posts a request to a URL,
>> the webserver runs a script that generates the response, the webserver
>> serves it out, your browser displays it. Why bother with learning a
>> framework? Messing about with mechanics is far more fun!
>> 
>> 
> 
> 
> 
> The only hiccup with the cgi approach (and with "directly code the action in 
> the guts of the server" like with flask) is that the subprocess that's 
> spawned has to complete before control returns (e.g. to serve stdout to the 
> user). So if you want to fire off a task that will run in parallel with the 
> webserver's other stuff, you need to have some sort of interprocess 
> communication (e.g. a named pipe, socket, file, MPI communicator, etc.).  (or 
> you do something like run "at" or "batch", which is basically using a file as 
> a interprocess communication, and the at daemon watches the file)
> 
> 
> 
> ___
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-06 Thread Chris Albertson
Yes cgi scripts take a few hours to learn and take only a small processor.
Drubbing a dims and all is overkill and will not perform well on the BBB.


On Monday, July 6, 2015, Tom Harris  wrote:

> Since you want simple just use a CGI script written in your language of
> choice. Very easy technology to learn, Python has support libraries out of
> the box if you want. You have a webpge with carious simple controls on it
> like buttons etc, you click a special button that posts a request to a URL,
> the webserver runs a script that generates the response, the webserver
> serves it out, your browser displays it. Why bother with learning a
> framework? Messing about with mechanics is far more fun!
>
>
> Tom Harris >
>
> On 4 July 2015 at 23:13, Jim Lux >
> wrote:
>
> > I've got a project I'm working on to make a sophisticated sundial with
> > moving mirrors.  I've got a batch of Arduinos that move the mirrors to
> the
> > appropriate places, given the current sun angle, etc.
> >
> > I've got a beaglebone that runs some python code to calculate sun angle
> > based on time
> >
> > The beaglebone will have a GPS feeding it to get time.
> >
> > BUT now, I'd like to add a web interface, so that it can be manipulated
> by
> > a mobile device using a browser.
> >
> > One way I can think of is to run some sort of limited web server. there
> > are a couple that come with the beaglebone, including the python
> > "simplehttpserver".
> >
> > But I'm sort of stuck on the interface between the webserver and the
> other
> > code running.
> >
> > I've done this kind of thing where the one task goes out and updates
> files
> > in the tree that's being served by the web server, and that works fine
> for
> > "status display" kinds of things that don't update very quickly. It's
> also
> > nicely partitioned.
> >
> > but I want to be able to change the behavior of the system (e.g. by
> having
> > the server respond to a PUT or something)
> >
> > Is the best scheme to go in and modify the webserver code to look for
> > specific URLs requested, and then fire off some custom code to do what I
> > want?
> >
> > I'm not particularly interested in javascript, and would prefer python.
> >
> >
> > Or are there libraries that make this more cookbook? (the little "getting
> > started with beaglebone" book talks about flask)
> >
> > There's quite a few websites out there where someone has done some sort
> of
> > "home automation", but they tend to be a bit light on the analysis of
> pros
> > and cons of implementation architectures: "I built X using Y and Z and it
> > sort of works".
> >
> >
> > Actually, along a similar line.. my "solar position" code isn't very
> > pretty (it's sort of replicating some code I wrote in Basic a long time
> > ago, with some changes from stuff I cribbed from ccmatlab).  If someone
> > knows of a python package that just "does this", I'd love to hear about
> > it.  Either Az El, or X,Y,Z in ECI or ECF would do.
> >
> >
> >
> > ___
> > time-nuts mailing list -- time-nuts@febo.com 
> > To unsubscribe, go to
> > https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> > and follow the instructions there.
> >
> ___
> time-nuts mailing list -- time-nuts@febo.com 
> To unsubscribe, go to
> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
>


-- 

Chris Albertson
Redondo Beach, California
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-06 Thread Jim Lux

On 7/6/15 3:19 PM, Tom Harris wrote:

Since you want simple just use a CGI script written in your language of
choice. Very easy technology to learn, Python has support libraries out of
the box if you want. You have a webpge with carious simple controls on it
like buttons etc, you click a special button that posts a request to a URL,
the webserver runs a script that generates the response, the webserver
serves it out, your browser displays it. Why bother with learning a
framework? Messing about with mechanics is far more fun!






The only hiccup with the cgi approach (and with "directly code the 
action in the guts of the server" like with flask) is that the 
subprocess that's spawned has to complete before control returns (e.g. 
to serve stdout to the user). So if you want to fire off a task that 
will run in parallel with the webserver's other stuff, you need to have 
some sort of interprocess communication (e.g. a named pipe, socket, 
file, MPI communicator, etc.).  (or you do something like run "at" or 
"batch", which is basically using a file as a interprocess 
communication, and the at daemon watches the file)




___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-06 Thread Tom Harris
Since you want simple just use a CGI script written in your language of
choice. Very easy technology to learn, Python has support libraries out of
the box if you want. You have a webpge with carious simple controls on it
like buttons etc, you click a special button that posts a request to a URL,
the webserver runs a script that generates the response, the webserver
serves it out, your browser displays it. Why bother with learning a
framework? Messing about with mechanics is far more fun!


Tom Harris 

On 4 July 2015 at 23:13, Jim Lux  wrote:

> I've got a project I'm working on to make a sophisticated sundial with
> moving mirrors.  I've got a batch of Arduinos that move the mirrors to the
> appropriate places, given the current sun angle, etc.
>
> I've got a beaglebone that runs some python code to calculate sun angle
> based on time
>
> The beaglebone will have a GPS feeding it to get time.
>
> BUT now, I'd like to add a web interface, so that it can be manipulated by
> a mobile device using a browser.
>
> One way I can think of is to run some sort of limited web server. there
> are a couple that come with the beaglebone, including the python
> "simplehttpserver".
>
> But I'm sort of stuck on the interface between the webserver and the other
> code running.
>
> I've done this kind of thing where the one task goes out and updates files
> in the tree that's being served by the web server, and that works fine for
> "status display" kinds of things that don't update very quickly. It's also
> nicely partitioned.
>
> but I want to be able to change the behavior of the system (e.g. by having
> the server respond to a PUT or something)
>
> Is the best scheme to go in and modify the webserver code to look for
> specific URLs requested, and then fire off some custom code to do what I
> want?
>
> I'm not particularly interested in javascript, and would prefer python.
>
>
> Or are there libraries that make this more cookbook? (the little "getting
> started with beaglebone" book talks about flask)
>
> There's quite a few websites out there where someone has done some sort of
> "home automation", but they tend to be a bit light on the analysis of pros
> and cons of implementation architectures: "I built X using Y and Z and it
> sort of works".
>
>
> Actually, along a similar line.. my "solar position" code isn't very
> pretty (it's sort of replicating some code I wrote in Basic a long time
> ago, with some changes from stuff I cribbed from ccmatlab).  If someone
> knows of a python package that just "does this", I'd love to hear about
> it.  Either Az El, or X,Y,Z in ECI or ECF would do.
>
>
>
> ___
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to
> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
>
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-06 Thread Björn
If looking at using the bbb for driving steppers.

http://blog.machinekit.io/p/hardware-capes.html?m=1

/Björn


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


[time-nuts] beaglebones, time, web services

2015-07-05 Thread Chris Albertson
Keep it simple, use a Cgi bin script.  Your url is can be any executable.
Any language you like. The script can do anything and then it writes out
html to stdout. Simple enough.  .


On Saturday, July 4, 2015, Jim Lux  wrote:

> I've got a project I'm working on to make a sophisticated sundial with
> moving mirrors.  I've got a batch of Arduinos that move the mirrors to the
> appropriate places, given the current sun angle, etc.
>
> I've got a beaglebone that runs some python code to calculate sun angle
> based on time
>
> The beaglebone will have a GPS feeding it to get time.
>
> BUT now, I'd like to add a web interface, so that it can be manipulated by
> a mobile device using a browser.
>
> One way I can think of is to run some sort of limited web server. there
> are a couple that come with the beaglebone, including the python
> "simplehttpserver".
>
> But I'm sort of stuck on the interface between the webserver and the other
> code running.
>
> I've done this kind of thing where the one task goes out and updates files
> in the tree that's being served by the web server, and that works fine for
> "status display" kinds of things that don't update very quickly. It's also
> nicely partitioned.
>
> but I want to be able to change the behavior of the system (e.g. by having
> the server respond to a PUT or something)
>
> Is the best scheme to go in and modify the webserver code to look for
> specific URLs requested, and then fire off some custom code to do what I
> want?
>
> I'm not particularly interested in javascript, and would prefer python.
>
>
> Or are there libraries that make this more cookbook? (the little "getting
> started with beaglebone" book talks about flask)
>
> There's quite a few websites out there where someone has done some sort of
> "home automation", but they tend to be a bit light on the analysis of pros
> and cons of implementation architectures: "I built X using Y and Z and it
> sort of works".
>
>
> Actually, along a similar line.. my "solar position" code isn't very
> pretty (it's sort of replicating some code I wrote in Basic a long time
> ago, with some changes from stuff I cribbed from ccmatlab).  If someone
> knows of a python package that just "does this", I'd love to hear about
> it.  Either Az El, or X,Y,Z in ECI or ECF would do.
>
>
>
> ___
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to
> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
>


-- 

Chris Albertson
Redondo Beach, California
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-05 Thread Bob Camp
Hi

> On Jul 5, 2015, at 3:17 PM, Jim Lux  wrote:
> 
> On 7/5/15 8:43 AM, Bob Camp wrote:
>> Hi
>> 
>>> On Jul 5, 2015, at 8:46 AM, Jim Lux  wrote:
>>> 
>>> On 7/4/15 7:53 PM, Hal Murray wrote:
 
 jim...@earthlink.net said:
> Exactly... I've got an array of mirrors on az/el mounts (two servos
> stacked) and the reflection from the mirrors on the wall forms the 
> display.
 
 How many pixels in that display?  Or what is the unit of quality 
 measurement?
 
 What sort of ADEV are you aiming for?  If your goal is solar time rather 
 than
 TAI or UTC, you should be able to get pretty good.
 
>>> 
>>> 
>>> Prototype is 6 pixels to demonstrate concept and work out the bugs. Long 
>>> term, probably several dozen.
>>> 
>>> Time Accuracy? better than a second
>>> 
>>> Turns out, having done some experimenting, the real issue is angular 
>>> accuracy. RC servos aren't all that great, and have significant jitter 
>>> (probably not an issue in their design application which tends to have good 
>>> mechanical low pass filtering).  They're cheap and easy to use (as in, I 
>>> had a bunch in the garage I could cannibalize out of another project).
>>> 
>>> But if you have 3x3 inch mirrors (call it 7.5 cm), and want to create a 
>>> picture on the wall that's, say, 10 meters away, you really need angular 
>>> pointing of 0.007 radians.. that's about 1/2 degree.  An RC servo has 
>>> roughly 270 degree rotation corresponding to 256 steps of PWM (in the 
>>> Arduino implementation).
>> 
>> Probably a good place to use the “drive a stepper as a selsyn trick. 
>> Steppers are dirt cheap these days and you can either program the drive 
>> yourself or get chips that will do it for you. You have essentially zero 
>> load and zero acceleration. There is no need for anything big.
>> 
> Indeed, microstepping might be the way to go in a production system.
> 
> But steppers don't have convenient mechanical mounting stuff like RC servos 
> do. I could assemble my prototype with zip ties, double sided foam tape and a 
> few screws.   For a stepper scheme I'd need to design and build (e.g. 
> fabricate) bracketry.  It's also more complex than just plugging a servo into 
> a pin on the Arduino; that's pretty easy.

*Small*steppers (which is all you need) don’t take much in the way of mounts. 
More or less that’s why they invented 3D printing. A printed mount is plenty 
good enough in this case.

> 
> And then you also get into the "do you really want to use an arduino, why not 
> program a X microcontroller  on a custom board you've designed for the 
> purpose with all the driver components, etc.”

Feature creep - that’s my middle name …...

> 
> If I were building up a full scale system, that's probably what I'd do.  BUT, 
> in the mean time, my 6 RC servo az/el thingys are good to fool with and get a 
> feel for various configurations and what the design issues on a larger system 
> would be.

A *lot* of home built milling machines are lashed together out of steppers with 
various drivers. It is a bit of a step up from R/C servos, but not *that* bit a 
step.

> 
> 
> The virtue of the BBB and Arduino scheme is mostly that it can be cobbled 
> together without much work. And you can leverage large consumer equipment 
> volumes for the actuators, servos are <$10 each in any sort of quantity; it 
> would be hard to find a packaged motor/gear train with a feedback pot for 
> that much (leaving aside surplus).

That’s not all that different than the way home made mills are built.

> 
> I used to have a box of small 200 step/rev motors (floppy drive positioners), 
> but they had a weird sized shaft, so we're back to the fabrication of mounts: 
> the servo has a nice splined nylon shaft that mates with cheap other 
> injection molded stuff.

3D printing ….You *must* have a friend with a printer ….

Bob

> 
> 
> 
> ___
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-05 Thread Jim Lux

On 7/5/15 8:43 AM, Bob Camp wrote:

Hi


On Jul 5, 2015, at 8:46 AM, Jim Lux  wrote:

On 7/4/15 7:53 PM, Hal Murray wrote:


jim...@earthlink.net said:

Exactly... I've got an array of mirrors on az/el mounts (two servos
stacked) and the reflection from the mirrors on the wall forms the display.


How many pixels in that display?  Or what is the unit of quality measurement?

What sort of ADEV are you aiming for?  If your goal is solar time rather than
TAI or UTC, you should be able to get pretty good.




Prototype is 6 pixels to demonstrate concept and work out the bugs. Long term, 
probably several dozen.

Time Accuracy? better than a second

Turns out, having done some experimenting, the real issue is angular accuracy. 
RC servos aren't all that great, and have significant jitter (probably not an 
issue in their design application which tends to have good mechanical low pass 
filtering).  They're cheap and easy to use (as in, I had a bunch in the garage 
I could cannibalize out of another project).

But if you have 3x3 inch mirrors (call it 7.5 cm), and want to create a picture 
on the wall that's, say, 10 meters away, you really need angular pointing of 
0.007 radians.. that's about 1/2 degree.  An RC servo has roughly 270 degree 
rotation corresponding to 256 steps of PWM (in the Arduino implementation).


Probably a good place to use the “drive a stepper as a selsyn trick. Steppers 
are dirt cheap these days and you can either program the drive yourself or get 
chips that will do it for you. You have essentially zero load and zero 
acceleration. There is no need for anything big.


Indeed, microstepping might be the way to go in a production system.

But steppers don't have convenient mechanical mounting stuff like RC 
servos do. I could assemble my prototype with zip ties, double sided 
foam tape and a few screws.   For a stepper scheme I'd need to design 
and build (e.g. fabricate) bracketry.  It's also more complex than just 
plugging a servo into a pin on the Arduino; that's pretty easy.


And then you also get into the "do you really want to use an arduino, 
why not program a X microcontroller  on a custom board you've designed 
for the purpose with all the driver components, etc."


If I were building up a full scale system, that's probably what I'd do. 
 BUT, in the mean time, my 6 RC servo az/el thingys are good to fool 
with and get a feel for various configurations and what the design 
issues on a larger system would be.



The virtue of the BBB and Arduino scheme is mostly that it can be 
cobbled together without much work. And you can leverage large consumer 
equipment volumes for the actuators, servos are <$10 each in any sort of 
quantity; it would be hard to find a packaged motor/gear train with a 
feedback pot for that much (leaving aside surplus).


I used to have a box of small 200 step/rev motors (floppy drive 
positioners), but they had a weird sized shaft, so we're back to the 
fabrication of mounts: the servo has a nice splined nylon shaft that 
mates with cheap other injection molded stuff.




___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-05 Thread Didier Juges
I have been working on and off on that kind of project for a while.
One type of issue you have when trying to control hardware from a web page is 
that any hardware access from a web server poses many issues, such as 
permissions and the fact that web servers are basically stateless and many are 
multitasking. 
What happens if your web page (or the python script behind it) tries to send 
data on a serial port (for instance) and another request for the same thing 
comes along?

The current approach I am using is to have a separate process that maintains 
the device status in files that be easily accessed by the web server, so that 
simple status requests can be serviced immediately without needing to query the 
device each time, and use a fifo to pipe commands between the web page script 
and the process. The process is the only one that talks to the hardware, so 
there is no contention.

On the client side, you can use Ajax to keep the web page updated with fresh 
data without reloading everything each time. It is JavaScript, but there is not 
too much of it. That part is relatively easy, unless you want to make it really 
pretty. In that case, it takes a different set of skills (art major with CSS 
experience...)

Here is a demo:

http://www.ko4bb.com/AjaxDemo/x-web.html

The back end of that runs on php, but it could be python just the same.

Obviously failing the "pretty" test :)

Didier KO4BB


On July 4, 2015 8:13:06 AM CDT, Jim Lux  wrote:
>I've got a project I'm working on to make a sophisticated sundial with 
>moving mirrors.  I've got a batch of Arduinos that move the mirrors to 
>the appropriate places, given the current sun angle, etc.
>
>I've got a beaglebone that runs some python code to calculate sun angle
>
>based on time
>
>The beaglebone will have a GPS feeding it to get time.
>
>BUT now, I'd like to add a web interface, so that it can be manipulated
>
>by a mobile device using a browser.
>
>One way I can think of is to run some sort of limited web server. there
>
>are a couple that come with the beaglebone, including the python 
>"simplehttpserver".
>
>But I'm sort of stuck on the interface between the webserver and the 
>other code running.
>
>I've done this kind of thing where the one task goes out and updates 
>files in the tree that's being served by the web server, and that works
>
>fine for "status display" kinds of things that don't update very 
>quickly. It's also nicely partitioned.
>
>but I want to be able to change the behavior of the system (e.g. by 
>having the server respond to a PUT or something)
>
>Is the best scheme to go in and modify the webserver code to look for 
>specific URLs requested, and then fire off some custom code to do what
>I 
>want?
>
>I'm not particularly interested in javascript, and would prefer python.
>
>
>Or are there libraries that make this more cookbook? (the little 
>"getting started with beaglebone" book talks about flask)
>
>There's quite a few websites out there where someone has done some sort
>
>of "home automation", but they tend to be a bit light on the analysis
>of 
>pros and cons of implementation architectures: "I built X using Y and Z
>
>and it sort of works".
>
>
>Actually, along a similar line.. my "solar position" code isn't very 
>pretty (it's sort of replicating some code I wrote in Basic a long time
>
>ago, with some changes from stuff I cribbed from ccmatlab).  If someone
>
>knows of a python package that just "does this", I'd love to hear about
>
>it.  Either Az El, or X,Y,Z in ECI or ECF would do.
>
>
>
>___
>time-nuts mailing list -- time-nuts@febo.com
>To unsubscribe, go to
>https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
>and follow the instructions there.

-- 
Sent from my Motorola Droid Razr HD 4G LTE wireless tracker while I do other 
things.
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-05 Thread Bill Dailey
These are pricey but offer 5900 steps over 120 degrees.  0.02 degree per step.  
At least you could try a couple.  If you have many of them it would get 
expensive quickly.

http://www.horizonhobby.com/ds8231-ultra-precision-servo-jrps8231

Sent from mobile

> On Jul 5, 2015, at 7:46 AM, Jim Lux  wrote:
> 
>> On 7/4/15 7:53 PM, Hal Murray wrote:
>> 
>> jim...@earthlink.net said:
>>> Exactly... I've got an array of mirrors on az/el mounts (two servos
>>> stacked) and the reflection from the mirrors on the wall forms the display.
>> 
>> How many pixels in that display?  Or what is the unit of quality measurement?
>> 
>> What sort of ADEV are you aiming for?  If your goal is solar time rather than
>> TAI or UTC, you should be able to get pretty good.
> 
> 
> Prototype is 6 pixels to demonstrate concept and work out the bugs. Long 
> term, probably several dozen.
> 
> Time Accuracy? better than a second
> 
> Turns out, having done some experimenting, the real issue is angular 
> accuracy. RC servos aren't all that great, and have significant jitter 
> (probably not an issue in their design application which tends to have good 
> mechanical low pass filtering).  They're cheap and easy to use (as in, I had 
> a bunch in the garage I could cannibalize out of another project).
> 
> But if you have 3x3 inch mirrors (call it 7.5 cm), and want to create a 
> picture on the wall that's, say, 10 meters away, you really need angular 
> pointing of 0.007 radians.. that's about 1/2 degree.  An RC servo has roughly 
> 270 degree rotation corresponding to 256 steps of PWM (in the Arduino 
> implementation).
> ___
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-05 Thread Bob Camp
Hi

> On Jul 5, 2015, at 8:46 AM, Jim Lux  wrote:
> 
> On 7/4/15 7:53 PM, Hal Murray wrote:
>> 
>> jim...@earthlink.net said:
>>> Exactly... I've got an array of mirrors on az/el mounts (two servos
>>> stacked) and the reflection from the mirrors on the wall forms the display.
>> 
>> How many pixels in that display?  Or what is the unit of quality measurement?
>> 
>> What sort of ADEV are you aiming for?  If your goal is solar time rather than
>> TAI or UTC, you should be able to get pretty good.
>> 
> 
> 
> Prototype is 6 pixels to demonstrate concept and work out the bugs. Long 
> term, probably several dozen.
> 
> Time Accuracy? better than a second
> 
> Turns out, having done some experimenting, the real issue is angular 
> accuracy. RC servos aren't all that great, and have significant jitter 
> (probably not an issue in their design application which tends to have good 
> mechanical low pass filtering).  They're cheap and easy to use (as in, I had 
> a bunch in the garage I could cannibalize out of another project).
> 
> But if you have 3x3 inch mirrors (call it 7.5 cm), and want to create a 
> picture on the wall that's, say, 10 meters away, you really need angular 
> pointing of 0.007 radians.. that's about 1/2 degree.  An RC servo has roughly 
> 270 degree rotation corresponding to 256 steps of PWM (in the Arduino 
> implementation).

Probably a good place to use the “drive a stepper as a selsyn trick. Steppers 
are dirt cheap these days and you can either program the drive yourself or get 
chips that will do it for you. You have essentially zero load and zero 
acceleration. There is no need for anything big.

Bob

> ___
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-05 Thread Jim Lux

On 7/4/15 7:53 PM, Hal Murray wrote:


jim...@earthlink.net said:

Exactly... I've got an array of mirrors on az/el mounts (two servos
stacked) and the reflection from the mirrors on the wall forms the display.


How many pixels in that display?  Or what is the unit of quality measurement?

What sort of ADEV are you aiming for?  If your goal is solar time rather than
TAI or UTC, you should be able to get pretty good.




Prototype is 6 pixels to demonstrate concept and work out the bugs. Long 
term, probably several dozen.


Time Accuracy? better than a second

Turns out, having done some experimenting, the real issue is angular 
accuracy. RC servos aren't all that great, and have significant jitter 
(probably not an issue in their design application which tends to have 
good mechanical low pass filtering).  They're cheap and easy to use (as 
in, I had a bunch in the garage I could cannibalize out of another project).


But if you have 3x3 inch mirrors (call it 7.5 cm), and want to create a 
picture on the wall that's, say, 10 meters away, you really need angular 
pointing of 0.007 radians.. that's about 1/2 degree.  An RC servo has 
roughly 270 degree rotation corresponding to 256 steps of PWM (in the 
Arduino implementation).

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-04 Thread Hal Murray

jim...@earthlink.net said:
> Exactly... I've got an array of mirrors on az/el mounts (two servos
> stacked) and the reflection from the mirrors on the wall forms the display. 

How many pixels in that display?  Or what is the unit of quality measurement?

What sort of ADEV are you aiming for?  If your goal is solar time rather than 
TAI or UTC, you should be able to get pretty good.

-- 
These are my opinions.  I hate spam.



___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-04 Thread Jim Lux

On 7/4/15 1:42 PM, Simon Marsh wrote:




Pretty much every webserver ever written allows you to run a script in
response to a request. Nowadays there are frameworks that integrate
closely with the language of your choice and do all the heavy lifting
for you.

If fact, the problem is really too much choice, here's a list of
frameworks from the Python wiki:
https://wiki.python.org/moin/WebFrameworks


Yep.. that's exactly the problem... So I was consulting the hivemind 
here... we tend to be building little widgets that are more than a 
blinky light, but also aren't serving airline reservation systems.






If you want lots of functionality then head for the top of the list, but
these are overkill for what you are trying to do.

Scroll down to the 'Non Full Stack Frameworks' and pick one that makes
sense to you. These should all allow you to route a URL to some Python
code, and the process should be simple enough that if you spend more
than 15 mins to get an example up and running then just ditch it and
move on to the next one.


That's where I am...

flask does reasonably good..
I haven't tried firing off a second thread yet..






One caveat, if you are planning to put this on the public internet then
it's a very good idea to proxy the service behind a 'full-fat' webserver
(e.g. apache) that can safely manage access, load, security etc. I
wouldn't expose a BBB directly to the Internet, especially one that is
controlling expensive physical things.



Nope.. just local access from *my* phone on *my* network

And the hardware isn't breakable(!)  at least not by anything that any 
of the processors can do.




___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-04 Thread Jim Lux

On 7/4/15 12:31 PM, Bob Camp wrote:

Hi

As silly as it sounds, having a separate board for the user i/o is probably the 
best way to go.
You already have an empire of devices that (somehow) chat with each other. The 
barrier of
“it’s all on one device” has been broken even before i/o has been added.


Well, sure.. that's what the BBB is for.. mostly the UI.  but at some 
point, the web server has to tell someone else what to do.  You can fire 
off another process, send a message to another processor (or thread), or 
whatever.


And I was looking for a simple(!) webserver that supports this level of 
sophistication.  There's plenty of very lightweight examples out there 
(that run on Arduinos for instance) that are basically single threaded.. 
you intercept the "GET /myfunction" (or whatever) and that turns into a 
"call abc(parameters)"... and while "abc()" is running, the webserver 
isn't.  That's fine for "setting parameters", but not good if the abc 
process is going to take minutes.







Once you get past that part of it, it’s all a bunch of “that depends” and 
personal preference. There is very little
right and wrong. For very little money, you can go from a single core to a quad 
core device on your i/o
processor. The same is true of RAM and flash. If this is a one up (or few 
dozen) sort of thing, optimizing the
board probably makes less sense than attacking the (inevitable) multitude of 
Ardunio gear controlling the
rest of it.

=

Assuming that we’re not already way off track - I’d use a “real” web server to 
feed the user. You get the full
range of modules that way. You can handle anything you decide you need as the 
feature list expands. I’d back
it up with Python, just because it seems to work fine and I already have worked 
my way up the learning curve. Others
would (I’m sure) recommend languages that they are more familiar with. They all 
will get you to the same end
result. If you want to be cool, there’s always Node.js …



Yeah, that's where I'm heading.. but I was looking for something between 
"single threaded webserver with direct calls" and "install apache"



___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-04 Thread Jim Lux

On 7/4/15 11:55 AM, Mike Magin wrote:

Somewhat new time-nut here (had one of the Samsung-branded Z3805s for a
few months as a house 10mhz ref, but it really got out of control when
I acquired a Wavecrest DTS, multiple frequency counters, an old Astron
1250a, a Lucent RFTG-u pair, etc.), thought I should finally de-lurk
since I can perhaps offer some useful opinion on this.  Comments inline.

On Sat, Jul 04, 2015 at 06:13:06AM -0700, Jim Lux wrote:

I've got a project I'm working on to make a sophisticated sundial
with moving mirrors.  I've got a batch of Arduinos that move the
mirrors to the appropriate places, given the current sun angle, etc.


I guess you are making a human-readable sundial,


Exactly... I've got an array of mirrors on az/el mounts (two servos 
stacked) and the reflection from the mirrors on the wall forms the display.






I was thinking recently

about building a computerized mean-solar-noon tracker, just to see what
sort of accuracy I can get.  Haven't decided between a cheap fisheye
camera behind a dark filter (welding lens?) versus a sort of slot-lens
(like a pinhole, but to tolerate the seasonal change in north-south
elevation) with a wide-range light sensor (CdS or a modern ambient light
sensor IC).


How accurate do you need to be..

two/four solar cells with a hole that projects an image of the sun on 
the cells, and compare the outputs (classic sun sensor for a satellite)


spinning mirror and fixed solar cell, timing of pulse tells you where 
the sun is


camera with a wide angle lens, and then do multi-pixel centroiding (0.1 
pixel is easy)


camera sensor with a plate with tiny holes in it, with the spacing of 
the holes slightly different than the pixels, so the "sun spots" have 
slightly different coverages of each pixel.








I've got a beaglebone that runs some python code to calculate sun
angle based on time

[...]

Or are there libraries that make this more cookbook? (the little
"getting started with beaglebone" book talks about flask)


In a previous contract job, I did some work with Flask, it's pretty
nice, especially for the basic case of "make this subset of the URL
space be handled by this function".

I haven't set it up from scratch, but the Flask documentation seems pretty
good, and if you're already familiar with Python, I'd highly recommend it.


Well, I got it to do the beginner "click here and turn on/off the LED" 
thing..


What I'd like, though, is to separate the "web serving" thread and the 
"doing stuff thread". I suppose I can fire off a thread from the 
webserver python.


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-04 Thread Jim Lux

On 7/4/15 11:45 AM, Bill Dailey wrote:

Pysolar

Sent from mobile



"Pysolar: staring directly at the sun since 2007"


excellent.. thanks..

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-04 Thread Simon Marsh


On 04/07/2015 14:13, Jim Lux wrote:
...
BUT now, I'd like to add a web interface, so that it can be 
manipulated by a mobile device using a browser.

...
Is the best scheme to go in and modify the webserver code to look for 
specific URLs requested, and then fire off some custom code to do what 
I want?

...

No, almost certainly not.

Pretty much every webserver ever written allows you to run a script in 
response to a request. Nowadays there are frameworks that integrate 
closely with the language of your choice and do all the heavy lifting 
for you.


If fact, the problem is really too much choice, here's a list of 
frameworks from the Python wiki:

https://wiki.python.org/moin/WebFrameworks

If you want lots of functionality then head for the top of the list, but 
these are overkill for what you are trying to do.


Scroll down to the 'Non Full Stack Frameworks' and pick one that makes 
sense to you. These should all allow you to route a URL to some Python 
code, and the process should be simple enough that if you spend more 
than 15 mins to get an example up and running then just ditch it and 
move on to the next one.


One caveat, if you are planning to put this on the public internet then 
it's a very good idea to proxy the service behind a 'full-fat' webserver 
(e.g. apache) that can safely manage access, load, security etc. I 
wouldn't expose a BBB directly to the Internet, especially one that is 
controlling expensive physical things.



Simon


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-04 Thread Steve Berl
pyEphem will get the sun position stuff for you.

-steve

On Sat, Jul 4, 2015 at 6:13 AM, Jim Lux  wrote:

> I've got a project I'm working on to make a sophisticated sundial with
> moving mirrors.  I've got a batch of Arduinos that move the mirrors to the
> appropriate places, given the current sun angle, etc.
>
> I've got a beaglebone that runs some python code to calculate sun angle
> based on time
>
> The beaglebone will have a GPS feeding it to get time.
>
> BUT now, I'd like to add a web interface, so that it can be manipulated by
> a mobile device using a browser.
>
> One way I can think of is to run some sort of limited web server. there
> are a couple that come with the beaglebone, including the python
> "simplehttpserver".
>
> But I'm sort of stuck on the interface between the webserver and the other
> code running.
>
> I've done this kind of thing where the one task goes out and updates files
> in the tree that's being served by the web server, and that works fine for
> "status display" kinds of things that don't update very quickly. It's also
> nicely partitioned.
>
> but I want to be able to change the behavior of the system (e.g. by having
> the server respond to a PUT or something)
>
> Is the best scheme to go in and modify the webserver code to look for
> specific URLs requested, and then fire off some custom code to do what I
> want?
>
> I'm not particularly interested in javascript, and would prefer python.
>
>
> Or are there libraries that make this more cookbook? (the little "getting
> started with beaglebone" book talks about flask)
>
> There's quite a few websites out there where someone has done some sort of
> "home automation", but they tend to be a bit light on the analysis of pros
> and cons of implementation architectures: "I built X using Y and Z and it
> sort of works".
>
>
> Actually, along a similar line.. my "solar position" code isn't very
> pretty (it's sort of replicating some code I wrote in Basic a long time
> ago, with some changes from stuff I cribbed from ccmatlab).  If someone
> knows of a python package that just "does this", I'd love to hear about
> it.  Either Az El, or X,Y,Z in ECI or ECF would do.
>
>
>
> ___
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to
> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
>



-- 
-steve
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-04 Thread Bob Camp
Hi

As silly as it sounds, having a separate board for the user i/o is probably the 
best way to go.
You already have an empire of devices that (somehow) chat with each other. The 
barrier of 
“it’s all on one device” has been broken even before i/o has been added. 

The world of user input is a bit messy. The typical expectations for speed, 
help, and fancy looking pages
are pretty high these days. Between input validation, context based help, and 
feature expansion, the 
i/o processor may be fairly busy from time to time. 

=

Once you get past that part of it, it’s all a bunch of “that depends” and 
personal preference. There is very little
right and wrong. For very little money, you can go from a single core to a quad 
core device on your i/o 
processor. The same is true of RAM and flash. If this is a one up (or few 
dozen) sort of thing, optimizing the
board probably makes less sense than attacking the (inevitable) multitude of 
Ardunio gear controlling the 
rest of it. 

=

Assuming that we’re not already way off track - I’d use a “real” web server to 
feed the user. You get the full
range of modules that way. You can handle anything you decide you need as the 
feature list expands. I’d back
it up with Python, just because it seems to work fine and I already have worked 
my way up the learning curve. Others
would (I’m sure) recommend languages that they are more familiar with. They all 
will get you to the same end
result. If you want to be cool, there’s always Node.js …

Bob

> On Jul 4, 2015, at 9:13 AM, Jim Lux  wrote:
> 
> I've got a project I'm working on to make a sophisticated sundial with moving 
> mirrors.  I've got a batch of Arduinos that move the mirrors to the 
> appropriate places, given the current sun angle, etc.
> 
> I've got a beaglebone that runs some python code to calculate sun angle based 
> on time
> 
> The beaglebone will have a GPS feeding it to get time.
> 
> BUT now, I'd like to add a web interface, so that it can be manipulated by a 
> mobile device using a browser.
> 
> One way I can think of is to run some sort of limited web server. there are a 
> couple that come with the beaglebone, including the python "simplehttpserver".
> 
> But I'm sort of stuck on the interface between the webserver and the other 
> code running.
> 
> I've done this kind of thing where the one task goes out and updates files in 
> the tree that's being served by the web server, and that works fine for 
> "status display" kinds of things that don't update very quickly. It's also 
> nicely partitioned.
> 
> but I want to be able to change the behavior of the system (e.g. by having 
> the server respond to a PUT or something)
> 
> Is the best scheme to go in and modify the webserver code to look for 
> specific URLs requested, and then fire off some custom code to do what I want?
> 
> I'm not particularly interested in javascript, and would prefer python.
> 
> 
> Or are there libraries that make this more cookbook? (the little "getting 
> started with beaglebone" book talks about flask)
> 
> There's quite a few websites out there where someone has done some sort of 
> "home automation", but they tend to be a bit light on the analysis of pros 
> and cons of implementation architectures: "I built X using Y and Z and it 
> sort of works".
> 
> 
> Actually, along a similar line.. my "solar position" code isn't very pretty 
> (it's sort of replicating some code I wrote in Basic a long time ago, with 
> some changes from stuff I cribbed from ccmatlab).  If someone knows of a 
> python package that just "does this", I'd love to hear about it.  Either Az 
> El, or X,Y,Z in ECI or ECF would do.
> 
> 
> 
> ___
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-04 Thread Mike Magin
Somewhat new time-nut here (had one of the Samsung-branded Z3805s for a
few months as a house 10mhz ref, but it really got out of control when
I acquired a Wavecrest DTS, multiple frequency counters, an old Astron
1250a, a Lucent RFTG-u pair, etc.), thought I should finally de-lurk
since I can perhaps offer some useful opinion on this.  Comments inline.

On Sat, Jul 04, 2015 at 06:13:06AM -0700, Jim Lux wrote:
> I've got a project I'm working on to make a sophisticated sundial
> with moving mirrors.  I've got a batch of Arduinos that move the
> mirrors to the appropriate places, given the current sun angle, etc.

I guess you are making a human-readable sundial, I was thinking recently
about building a computerized mean-solar-noon tracker, just to see what
sort of accuracy I can get.  Haven't decided between a cheap fisheye
camera behind a dark filter (welding lens?) versus a sort of slot-lens
(like a pinhole, but to tolerate the seasonal change in north-south
elevation) with a wide-range light sensor (CdS or a modern ambient light
sensor IC).

> I've got a beaglebone that runs some python code to calculate sun
> angle based on time
[...]
> Or are there libraries that make this more cookbook? (the little
> "getting started with beaglebone" book talks about flask)

In a previous contract job, I did some work with Flask, it's pretty
nice, especially for the basic case of "make this subset of the URL
space be handled by this function".  

I haven't set it up from scratch, but the Flask documentation seems pretty
good, and if you're already familiar with Python, I'd highly recommend it.

Mike
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] beaglebones, time, web services

2015-07-04 Thread Bill Dailey
Pysolar 

Sent from mobile

> On Jul 4, 2015, at 8:13 AM, Jim Lux  wrote:
> 
> I've got a project I'm working on to make a sophisticated sundial with moving 
> mirrors.  I've got a batch of Arduinos that move the mirrors to the 
> appropriate places, given the current sun angle, etc.
> 
> I've got a beaglebone that runs some python code to calculate sun angle based 
> on time
> 
> The beaglebone will have a GPS feeding it to get time.
> 
> BUT now, I'd like to add a web interface, so that it can be manipulated by a 
> mobile device using a browser.
> 
> One way I can think of is to run some sort of limited web server. there are a 
> couple that come with the beaglebone, including the python "simplehttpserver".
> 
> But I'm sort of stuck on the interface between the webserver and the other 
> code running.
> 
> I've done this kind of thing where the one task goes out and updates files in 
> the tree that's being served by the web server, and that works fine for 
> "status display" kinds of things that don't update very quickly. It's also 
> nicely partitioned.
> 
> but I want to be able to change the behavior of the system (e.g. by having 
> the server respond to a PUT or something)
> 
> Is the best scheme to go in and modify the webserver code to look for 
> specific URLs requested, and then fire off some custom code to do what I want?
> 
> I'm not particularly interested in javascript, and would prefer python.
> 
> 
> Or are there libraries that make this more cookbook? (the little "getting 
> started with beaglebone" book talks about flask)
> 
> There's quite a few websites out there where someone has done some sort of 
> "home automation", but they tend to be a bit light on the analysis of pros 
> and cons of implementation architectures: "I built X using Y and Z and it 
> sort of works".
> 
> 
> Actually, along a similar line.. my "solar position" code isn't very pretty 
> (it's sort of replicating some code I wrote in Basic a long time ago, with 
> some changes from stuff I cribbed from ccmatlab).  If someone knows of a 
> python package that just "does this", I'd love to hear about it.  Either Az 
> El, or X,Y,Z in ECI or ECF would do.
> 
> 
> 
> ___
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


[time-nuts] beaglebones, time, web services

2015-07-04 Thread Jim Lux
I've got a project I'm working on to make a sophisticated sundial with 
moving mirrors.  I've got a batch of Arduinos that move the mirrors to 
the appropriate places, given the current sun angle, etc.


I've got a beaglebone that runs some python code to calculate sun angle 
based on time


The beaglebone will have a GPS feeding it to get time.

BUT now, I'd like to add a web interface, so that it can be manipulated 
by a mobile device using a browser.


One way I can think of is to run some sort of limited web server. there 
are a couple that come with the beaglebone, including the python 
"simplehttpserver".


But I'm sort of stuck on the interface between the webserver and the 
other code running.


I've done this kind of thing where the one task goes out and updates 
files in the tree that's being served by the web server, and that works 
fine for "status display" kinds of things that don't update very 
quickly. It's also nicely partitioned.


but I want to be able to change the behavior of the system (e.g. by 
having the server respond to a PUT or something)


Is the best scheme to go in and modify the webserver code to look for 
specific URLs requested, and then fire off some custom code to do what I 
want?


I'm not particularly interested in javascript, and would prefer python.


Or are there libraries that make this more cookbook? (the little 
"getting started with beaglebone" book talks about flask)


There's quite a few websites out there where someone has done some sort 
of "home automation", but they tend to be a bit light on the analysis of 
pros and cons of implementation architectures: "I built X using Y and Z 
and it sort of works".



Actually, along a similar line.. my "solar position" code isn't very 
pretty (it's sort of replicating some code I wrote in Basic a long time 
ago, with some changes from stuff I cribbed from ccmatlab).  If someone 
knows of a python package that just "does this", I'd love to hear about 
it.  Either Az El, or X,Y,Z in ECI or ECF would do.




___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.