Go Down

Topic: Standalone Datacollecting Webserver (Read 8 times) previous topic - next topic

tjgerow

Hello,

I have been searching the web for a while trying to find some direction on how to proceed with a project I am working on.

I have an arduino board with ethernet shield (webserver) reading temperature data and logging it to an SD card.  The Ethernet shield is connected to a wifi router using an RJ45 cable.  The wifi router is used to create a local wifi network so someone in the area with a mobile device (android, iphone, tablet, laptop,etc.) can connect to the network and access the Arduino webserver.

This whole setup is in a remote location with no cell coverage or internet access. 

The user can use a mobile wifi device with a browser to access the Arduino webserver and see current temperatures.  They can also go to webpages to calibrate the sensors and change other settings like logging frequency. 

Another feature I need to add is the ability to download the log files from the SD card through the HTML interface.  I am working on that now and have found lots of examples.

It is not ideal to have someone remove the SD card to get the data.  Thus the use of a wifi network.


Where I need help is the next step:  How can I graph data in HTML so that the user can see historical temperatures on their device?

I have found a bunch of examples using javascript but they all reference the javascript files on a different server connected to the internet.  This project has to be self contained and will not be able to access remote servers.

Is there a way to embed a graphing javascript/applet in the arduino webserver?

I have also found examples of installing DD-WRT firmware on the router and then using the router to host .css and .js files.  I really would like to avoid modifying the router firmware, unless that is the best option.

This recent topic:http://arduino.cc/forum/index.php/topic,143431.0.html is sort of similar and has a reference to a weather station project: http://arduino.cc/forum/index.php/topic,129122.0.html that is close to what I am trying to do (nice graphs).  I just don't have any internet access to call the javascript functions to do the graphs.

I need some direction, or a reality check to let me know this can not be done with just an Arduino, Ethernet Shield and a wifi router.

Thanks,
Tom

draythomp

There's a couple of reasons we use javascripts off of other servers.  The biggest being we don't want to write them ourselves since there are so darn many out there already, and the other big reason is that they are freaking huge.  However, if you follow the source trail to the actual code that puts up the graph, you can certainly do it.  The path I would use is to get one script at a time, these things seem to call script, after script, after script, modifying it to work locally on a laptop.  You WILL eventually get to the end of the various scripts and have a fully working set of code on the laptop. Then, you have to somehow shoehorn it onto the arduino.

Since you're already using an SD card, you may be able to do this pretty well, but it might take some time to get it all off the card and out over the air.

The possible problem with this is the license on the code.  Be sure to take a look at the various controls the authors have put on the pieces.  It's very likely you won't have any problem, but be sure to check this out best you can.
Trying to keep my house under control http://www.desert-home.com/

tjgerow

draythomp,

Thanks for the idea.  That will be my weekend project, to track down the actual scripts for graphing data.  I haven't spent a lot of time actually looking for the javascript source code because I was hoping there was already a library out there I could use.

Thanks again,
Tom

rockwallaby

#3
Jan 26, 2013, 12:57 am Last Edit: Jan 26, 2013, 02:29 am by rockwallaby Reason: 1
Tom,

I first noticed your post in the thread by Llukkari and replied there, but now reading this post I understand a little better your setup.

I understand the Arduino is in the forest and is not connected to the outside world in any way?
But a person can go up to the weather station which has WiFi capabilities and can connect to it this way.

I am guessing you will be only wanting certain authorised personnel having access to the weather station?

I have a thought, but it needs more thinking,
It should be possible to store on the laptop that goes to site, all the needed html and javascript and css files.
This could be relatively easy if your laptop uses linux, such as Ubuntu, or if you have Mac laptops as these have built in web servers already to go.
I am unsure how you do this if you use that confounded other well known OS, which will remain nameless.

To do this you would need to configure your laptop as a server, so essentially you would serve your own resources.
Again, I haven't done this, but I think such an idea might work.
It would be very fast.

You want graphing?
I use highcharts, I like it as it is very customisable and able to represent your data very nicely.
I am currently playing around with this on my site, and am looking to having many more features for displaying data as I do in my industrial SCADA systems.

On my system (in my sig and under development), the Arduino is both a server and a client as well as running UDP to get correct time from a time sever.
All the content is now hosted off the Arduino, but earlier I had it being served from the Arduino.
Keep us posted.

Kind regards,
Paul

draythomp

There may well be complete, transportable charting software somewhere, I just haven't been able to find it.  I have managed to put together large chunks of the stuff, but never all of it.  Since I'm not limited as you are to not having web access, I went the other way and put everything out on the web so my little tiny arduino could do pretty sophisticated graphs and displays on the client browser.

As you progress through the various code, the development tools in Chrome could help you.  If you do an 'inspect element' (right click on the screen to get the menu) you can find the various sites that the code grabs from, then looking there, you can find the next one, etc.  It may turn out to be easier than I think and only a couple of things are needed to get the job done.

Have fun.
Trying to keep my house under control http://www.desert-home.com/

Go Up