Hi Eur,

For what you want, you may have a look at cherrypy: far simpler than
mod_python. mod_python is like mod_perl, you just have a python
interpreter within apache. And this can be very tricky to configure
it, even for hello world. This is however one the best way when
performance is needed.

If not, have a look at cherrypy (CP). This is a MVC framework. See
hello world, easy as 1,2,3. Also, to avoid forks, you should have a
look at a gnuplot python lib, can't rememer an URL, but it exists,
I've played with it. In your CP controller, you can use it to build a
picture (but you can also call the gnuplot exec), and server the
picture in a <img src="/path/to/controller/method"> tag. Each refresh
of the page would generate a new pix.If security is needed, you can
put an front-end Apache as proxy (lots of tutorials available).

Gnuplot is nice, but you can also have fun with SVG, js graphs, etc...
and also have a look at matplotlib: killer lib. Stef seems to use it a
lot.


Cheers,
Seb

On Nov 6, 6:12 pm, Eur van Andel <[EMAIL PROTECTED]> wrote:
> Hi All
>
> This might not be completely on-topic, but hey, you might learn  
> something.
>
> On 30 Oct 2008, at 23:44 , Sebastien LELONG wrote:
>
> >> A logger which logs temperature, humidity and CO2 levels to a PC
> >> serial port. The PC makes a gnuplot graph on request of a webpage (Do
> >> you know how to tie python scripts to webservers? Please tell me!)
>
> > Search mod_python for Apache.
> > I also use a lot cherrypy, full python-based. Nice to build small  
> > apps.
>
> I'm a bit lost in the mod_python documentation: the "hello world"  
> example is baffling. Where is the HTML code?
>
> OK, here is what I want.
>
> My PIC spews out a serial log:
>
> > Serial data from PIC16F876A powered CO2 & humidty logger
> > 3-11-2008  17:25:00        941       18.25  62.01
> > 3-11-2008  17:30:00        963       18.31  60.71
> > 3-11-2008  17:35:00        962       18.31  61.65
> > 3-11-2008  17:40:00        950       18.00  60.04
> > 3-11-2008  17:45:00        904       17.81  61.31
>
> I can already make nice gnuplots, see attach. Yes, the linewidth  
> sucks, that is a gnuplot 4 problem. I'm on FreeBSD 6.3, which has  
> troubles with gnuplot.
> Anyway, the graphs shows het central heating system kicking in at  
> 08:15 and my father entering the office at 09:00. at 22:00 I start  
> working at my Mac, this time much closer to the CO2 sensor.
>
> What I want is  web page that displays:
>
> > Time 17:45:00
>
> > CO2 904 ppm        Temperature 17.81C      Humidity 61%
>
> > GRAPH
>
> Where the values are read form the last line of the log file and the  
> graph is generated on each refresh. I plan to have a cron job that  
> fires up a python script that writess a new gnuplot file every day,  
> say today.plt, as:
>
>
>
> > set terminal png size 800,600
> > set title "CO2, temperature and humidity on 03 nov 2008, Fiwihex  
> > office, Almelo"
> > set output "today.png"
>
> > set xdata time
> > set timefmt "%H:%M:%S"
> > set format x "%H:%M"
>
> > set yrange [0 : 30]
> > set ytics nomirror 0, 5
> > set ylabel "temperature C"
>
> > set y2range [0 : 3000]
> > set y2tics 0, 500
> > set y2label "CO2 ppm"
>
> > plot       "2008_11_03.log" using 2:3  with lines lt 7  lw 3 ti "CO2  
> > concentration" axis x1y2,\
> >    "2008_11_03.log" using 2:4  with lines lt 5  lw 3 ti "Temperature",\
> >    "2008_11_03.log" using 2:5  with lines lt 6  lw 3 ti "Humidity"
>
> Where al the dates will be updated. So I keep a named graph (copied  
> to a specific name at 23:55) and a named log for every day. The  
> index.html file just points to the today.png.
>
> So do I tell mod_python to write a  new index.html file at every  
> refresh? If so, how? If not, how should it be done?
>
> Ob_topic: if all of this works, I'd like a place to put it all.
>
> A PIC project is seldom only JAL and a schematic. If your PIC is not  
> tied to the internet, how can others be sure it even exists?
> How can you be sure? Computers that are not connected might as well  
> be no computers at all, nobody will notice them.
>
> ---
> ir EE van Andel [EMAIL PROTECTED]  http://www.fiwihex.nl
> Fiwihex B.V. Wierdensestraat 74, NL7604BK Almelo, Netherlands
> tel+31-546-491106 fax+31-546-491107
>
> 
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to