Programming help

Hi I can successfully use Explorer/Firefox to interrogate HAH parameters via the webserver applet ie http://***********:8080/dbzoo.livebox.Controller:1wire.1/input.state/displaytext I'm messing with Java and Android and have issued an httpGET request for same URL and keep getting "client protocol exception" Probably something obvious but I'm out of my depth. Any help? John

Member for

16 years 10 months

brett

14 years 4 months ago

John,

The web server caching applet is a bit of a toy webserver in that it implements a very minimal amount of protocol to send back data via a http request.  I wrote it in response to a problem that Gary was having integrating an iPhone app.  It does work with the various devices I've used to prod it.   To debug you will need a little more depth in your knowledge of HTTP protocols.  You do have full source code for the lua applet if you care to play around.

Brett

Member for

14 years 6 months

magill

14 years 4 months ago

Brett My wife has an Iphone and I have been using Garry's recommended "Mote" app to request data. However I'm also putting together a java app on my Android. Is it possible, without messing with your server applet, for me to to implement a different method of requesting the data? thanks John

Member for

14 years 6 months

magill

14 years 4 months ago

Brett I did a bit of research and downloaded a web debugger called "fiddler" which suggested a problem in The response's status line local message = "HTTP/1.0 200/OK\r\n" I changed this to local message = "HTTP/1.0 200 /OK\r\n" and all comes good! Happy now thanks John

Member for

16 years 10 months

brett

14 years 4 months ago

Yes that line is wrong in fact I'm not sure why the slash was there in the first place.  As you say it should be:

local message = "HTTP/1.0 200 OK\r\n"

I'll update the code and check that sample back in.  Thx.

Brett

Member for

14 years 6 months

magill

14 years 4 months ago

Member for

15 years 7 months

garrydwilms

14 years 4 months ago

 Think you need to reload the crontab once updated. It's "crontab root" from command line. 

Maybe you can echo it from a script?

 

Garry

Member for

14 years 6 months

magill

14 years 4 months ago

Garry
Thanks, but I don't know how to do that. Seems curious though because when I update the file using crontab -e (VI editor I think) it all works without reloading cron. Surely that's just the same process as the script which opens, modifies, and closes the file.
John

Member for

15 years 7 months

garrydwilms

14 years 4 months ago

I think by doing crontab -e you automatically update the Cron scheduler. By just text editing not sure you do. 

 

Maybe try this:

os.execute("crontab /etc/crontabs/root") 

 

 

Although, reading up on Cron. I now agree with you that Cron should update on its own when it sees that the file has been changed??

 

Garry

Member for

14 years 6 months

magill

14 years 4 months ago

Garry

You're a star. Works now.

John

Member for

15 years 7 months

garrydwilms

14 years 4 months ago

Cool. In that case I'll use it myself from now on instead if google calendar!!!

 

Garry