views:

83

answers:

1

Hi,

I'm working on a personal project that consists of a linux dev board and temperature sensor. I'd like to see a nice web 2.0 real time plot of the tempature from anywhere in the house. Coming from hardware/driver background so i'm not very familar with databases or webservers. I'm stuck trying to figure out how i can send new temperature values from an application to a local web server (also running on the dev board) which can be simulataneously viewed from a client web browser. I've attached a picture which shows what i'm trying to do:

http://img193.imageshack.us/img193/4742/92898822.jpg

I've written the driver, application and played around making an app using GWT. I'm stuck trying to figure out how to make the server-side application and database i.e. Do i need to make a seperate executable that embeds SQL to talk to both application and client via http or is there an easier, existing way to do this?

Thanks in advance.

Kevin

A: 

GWT is usually used with a Java application server. You can use JSON or XML to communicate with any kind of server, but I don't know how easy this is.

In a not embedded server you would install Java and an application server. You would also install a database server, but for simple projects you could avoid this by using an embedded DB like HSQL or Derby. For your situation I don't believe this is necessary.

The question is what kind of application server can you use in your platform? All application servers support some kind of CGI communication. This way you could connect your server with the application that samples the temperature values. I don't think there is a need for SQL or an embedded database.

kgiannakakis
Thanks for your reply. I realise that temperature values are quite simple, but i wanted to create a design that could easily be scaled to include more complex and many more sensors, and could keep track of possibly months/years of data, and so that was my thought in needing a database.I took a look at HSQL and Derby, and both of those appear to be Java based SQL servers. It seems if I was using a web server running Java this would be straight forward, I could just use XML/JSON between application, server and client app.
Kevin
So i think what i need is a standalone application server that supports something like XML/CGI for communication and supports an SQL or similar database for storage. I've had a look around and most application servers i can see don't really seem to fill this need. Do you think it would just be easier to embed a webserver/database in my application to start with?
Kevin
For your needs it is definitely simpler to embed the web server and the database in your application. What application servers have you looked at? I believe that most of them would support CGI. The SQL part will be covered by your application. There are embedded databases that aren't Java, like Firebird and SQLite.
kgiannakakis
I was looking at things like Zope and other non-Java applications servers i could see. I'm beginning to think i'm making things more difficult than i should be for myself. i.e. If i just have a web based server not only can i access it anywhere, i can use all the existing Java server application stuff. So i'm thinking now i can just send XML data from my program to the webserver (and then into a database) and this can be read by the client GWT application. I think this sounds a lot easier (do you agree) and probably be better anyway. Thanks for your advice!
Kevin
I think your idea is good. The embedded device only serves a single file with the temperature values in XML or some other convenient format. A full-blown application server reads the file at regular intervals, inserts the values in a database and serves the client requests. Sounds great to me.
kgiannakakis
cool.. that's what i'll do. Thanks!
Kevin