steffo wrote:Now I can hardcode (or read from file) the tempertures to regulate upon but I would really like to learn how to have a web page to my raspberry where I change paremters on my JAR application.
Like if I have 70 degrees in the heater and I like to raise it to 75, Now i restart the program with new command line attributes but there must be a easy way to do this via WEB gui!
There is several ways that you can create a WEB gui, i will list some options:
webapplication using java EE server with GUI using jetty or tomcat
use one of the jetty or tomcat examples as a gui
http://www.eclipse.org/jetty/documentat ... mples.html
http://www.ntu.edu.sg/home/ehchua/progr ... mples.html
minimal webapplication using rupy
to test the rupy code you need to install ant
sudo apt-get install ant
example code: https://github.com/xranby/rupy-test
display a html5 GUI using swing + caciocavallo-web
write your GUI as a regular desktop swing GUI then when you want to deploy it as a WEB gui you use "cacio-web" to expose the server side gui to the web.
"cacio-web" is only available from source
it is easy to compile and setup if you first install mercurial and maven
Code: Select all
sudo apt-get install mercurial maven
then follow the guide at
https://rkennke.wordpress.com/2012/12/1 ... web-howto/
launch a CGI script using perl or php using the apache webserver that executes the commands to restart your java application.
instructions to setup apache and php: https://www.raspberrypi.org/documentati ... /apache.md
instructions how to write CGI using perl: http://httpd.apache.org/docs/2.2/howto/cgi.html
create a java application that opens a server socket and listen to bytes sent from a client
After your server socket is working you may write the client GUI using any language.