Standalone Datacollecting Webserver

Spoke too soon. When I actually got to trying the charts out, they need supporting libraries from other sites. I was several layers into other sites and finally gave up. As far as their appearance, they are really nice and they can be dynamic; meaning that they can be made to change as new data is available. They support tooltips that expand data when you hover over the data points, zooming in on certain areas, and many other nice features.

I just don't see how they can work well with an isolated arduino in the middle of nowhere.

One notable thing was that the forum and example they provide didn't have a clear example of how to actually get data from some repository and display it on the screen as a graph. Yes, they have examples, and offer them up to be examined by jsFiddle, but the dynamic and repository examples don't work in jsFiddle (at least I couldn't get them to)

Nice set of tools if you want to spend a week or two diving into the API and experimenting to get it right, but they don't seem to fit the bill for way far away devices that aren't big web servers.

Hi,
I was wondering if you found the solution to this i am also having this same problem have sensors reading in and displayed on the server just need to get it graphed and logged

ArduinoGreenHouse wrote:
have sensors reading in and displayed on the server just need to get it graphed and logged

Firstly, welcome to Arduino land.
When you say you have sensors reading and displayed on the server, I'm having trouble understanding what server are you displaying on?
Can you describe better your setup, are you using an external host site as your server, or the Arduino as server.

On what do you wish to graph, a computer screen, such as in a web browser or some other application?

Paul

Well at the moment i am using the Arduino to display the server, but have been looking on the form and thinking of using an external host, My plan is to have the sensors graphed in real time on the server with a datalogger with a RTC, my goal would be to have my server to have graphics like this example http://www.cs.helsinki.fi/u/ljlukkar/weatherstation
with 3/4 sensors been on the graph

ArduinoGreenHouse:
Well at the moment i am using the Arduino to display the server, but have been looking on the form and thinking of using an external host, My plan is to have the sensors graphed in real time on the server with a datalogger with a RTC,

Sounds like a job for cosm?

https://cosm.com/feeds/83152

You don't actually need an RTC to do it, but it is still a good idea to have it for backup.

OK, I understand better now, thanks.

I took a lot of the concepts and ideas from Lasse Lukkari from an earlier project he worked on, and yes, it I think it looks good.
So, initially I had real time data being displayed on such a graph, but quickly came to the realisation that it had a few issues for me.
If you use such a configuration, that is, just displaying real-time data, you don't get to see the past data, so, no historical data is graphed.
And when you are displaying the real-time data, it all looks nice, but if you leave the page or re-fresh the page, it starts from a clean slate again.

Work out if that is all you need to do.
Or do you prefer to be able to look back through the data and graph it?
You can try it out by looking at mysetup, go to http://paulalting.com/hydrosolar/hydrosolar.php# and go to the 'trend' page.

It uses the very same graphing library as the weather station from Lasse Lukkari.

Nick wrote:
sOUNDS LIKE AJOB FOR COSM

Yes, you could do that, but you are dependant on that service and I think rather limited in how you can display your data.
If you have no web host site, it would be an alternative.

But in reality, you can also store the data onboard the Arduino on SD card, and then when a client connects, have the data sent to the client and displayed in a graphing program.

Right then, you better show your code (use the code tags).
Just to get an idea of your level of understanding;
Do you have some understanding and experience with in coding Arduino and web languages?

Describe your project in more detail;
List your hardware;

  • What Arduino board are you using
  • What ethernet chipset have you got
  • What type of sensors are you using

Your software;

  • Have you got a hosted site you can use
  • At what stage is your program as it is now

I am still in the middle of developing and many more features are to come yet, also for trending which is at a very basic stage at present.
I can look at getting my code online somehow, there's a bundle of Arduino files as well as files for server and the client side.
Or I can post some relevant sections of the code in a new topic maybe?

For the graphing, go to http://www.highcharts.com/ and have a play around with their demos, this is what is used.

I hope you will have some patience 8)

I have done a few projects with Arduino and also know C and know a Bit of web development

I am using the Arudino mega with the Ethernet shield
the sensors I have are thermistor LDR and a Humidity sensor

Yea I have a hosting site not much done on it!
So far i have the 3 sensors reading the values and printing them on the Ethernet server

oh thats sound cool

Yea I have looked into that site for graphing seems good

Thanks

ArduinoGreenHouse, sorry for the delay getting back to you, I have been working on the project some more, getting the solar current sensor electronics installed and configured in the program.
Hopefully that will start to show values on the overview page as well as the trend page when the sun comes up in the morning Australian time.
For the next few days I unfortunately will not have a chance to do anything in the way of presenting the software as I will be away, though will do at the first opportunity.

Sounds like you have the right hardware bits for this to work, especially need the Mega with the extra memory as the program is too big for the smaller processors.
It might be that you have no need for sections of my code, such as the PID control loop for turbine and for solar dumping of excess energy.

If you are using the Arduino IDE I need to confirm that you can simply use my files from Eclipse IDE, which are filename.cpp and filename.h for the header, by renaming them?
If anybody following this thread knows, then it would be good to know.

Paul

Hi, thanks for replying
yea ok thats fine, yea I have the right hardware and yea i wouldn't think i need them sections of that code, basically my server will show a nice graphical webpage with a graph that shows the 3 sensors over a period of time which can be saved in a certain time intervals.

If you are using the Arduino IDE I need to confirm that you can simply use my files from Eclipse IDE, which are filename.cpp and filename.h for the header, by renaming them?

I not sure what you mean by this :confused:

ArduinoGrenHouse wrote in reply:

If you are using the Arduino IDE I need to confirm that you can simply use my files from Eclipse IDE, which are filename.cpp and filename.h for the header, by renaming them?

I not sure what you mean by this :confused:

I use Eclipse as my IDE for all my programming, arduino, html, javascript and so on. I haven't used the Arduino IDE for some time now.
My question is more about confirming that the files I use in Eclipse, you can directly use in the Arduino IDE if that is what you use.
I think you may need to change the file extension of cpp to ino, i.e. 'main.cpp' to main.ino' for it to work in Arduino IDE.
Can anybody else confirm this?
If you use Eclipse, then that is great.

I can't attach the files in these posts as some of them exceed the file size that can be use on the forum.
What I propose, is to use dropbox as the file storage location.

To get you started, I have copied the main section of code, where the setup and main loop are. It's not so big.
You need to look at them and start to see if you can make sense of them, they are documented.
Then as you start to understand the various components and can successfully compile it you should be right to make the necessary chamges for your setup.
I am not going to strip stuff out that you may not need, that will be up to you.

The dropbox location is Dropbox - Error - Simplify your life

I will continue to clean up the other files over the coming days and pop them into dropbox as well.
Let me know if you can access the two files.

Start a new project and check that you have the libraries listed at the top of main.cpp.
They are Ethernet, EthernetUDP, TimerThree (from the Arduino playground) as well you will need Webduino library from its Github location, GitHub - sirleech/Webduino: Arduino WebServer library.

Paul

Hi, Just out of curiosity, I have the hosting sever set up, uploaded basic HTML website , Just wondering couldn't I use the arduino to send the data of the three singals to pachube and get pachube to graph and send the graph onto my site? Was looking into this and I guess I found some example of this a setting up a trigger of some sort, can this be done? if so is it anygood/reliable, would cut my time alot!

Ok will give that a shot, have and great looking website now will try with eclipse!

ArduinoGreenHouse:
Couldn't I use the arduino to send the data of the three singals to pachube and get pachube to graph and send the graph onto my site?

I think there has been recent discussion on the cosm forum about this. I just use the cosm site for the graphs.

Also note Desert Home: Alternatives to Cosm (Pachube)

ArduinoGreenHouse:
Just wondering couldn't I use the arduino to send the data of the three singals to pachube and get pachube to graph and send the graph onto my site?

Yes, you could, COSM exists for that reason.
Though you don't get COSM to send the graph to your site, rather, your site gets it from COSM.

ArduinoGreenHouse:
Was looking into this and I guess I found some example of this a setting up a trigger of some sort, can this be done? if so is it anygood/reliable, would cut my time alot!

You 'guess' or you 'did' find an example and if you did, then by implicitly of statement and by my reckoning, it can be done.
A trigger to do what exactly?

I thought from what you were saying;

ArduinoGreenHouse:
My plan is to have the sensors graphed in real time on the server with a datalogger with a RTC, my goal would be to have my server to have graphics like this example http://www.cs.helsinki.fi/u/ljlukkar/weatherstation with 3/4 sensors been on the graph

Has 'your goal' now changed?

ArduinoGreenHouse:
Ok will give that a shot, have and great looking website now will try with eclipse!

Give what a shot?
Are you saying you have a great looking website (now?), if you are willing to share could we have a look?

Seems like you have raised more questions for me.
To help me, as I prefer to not guess and assume, would you be willing to be more clear and concise with your comments?


Paul

Though you don't get COSM to send the graph to your site, rather, your site gets it from COSM.

ok i see, any idea of how that works? I have my temp being graphed on cosm but the temp value isnt right

find an example and if you did, then by implicitly of statement and by my reckoning, it can be done.
A trigger to do what exactly?

well this is what I was looking into for the trigger http://cosm.com/docs/v2/trigger/

My goal hasn't changed still want to have the 3 sensors graphed on the site

So far here is what I have done for my website still in a working progress http://www.glasshouseenvironment.com/index.php

Stephen, so if one wishes to see anything on your web site, it seems one needs to login, is that right?
If so, are you willing to give details on logging in, so as to allow us to gain further insight?

On your 'about' page you have the following;

Hi! my name is Stephen I am a 4th year Student, that is studying Computer Engineering

Generally we refer to one's self as 'who' not 'that'.

Home and commercial growers can have a great piece of mind by knowing how a glasshouse or polytunnel is performing in their absence and that they can check it from a remote computer or mobile device

You are telling the world that home and commercial growers potentially can have a great piece of mind?
I think you are meaning to say something like this, please excuse my editing;
'Today, home and commercial agricultural growers can enjoy a better peace of mind knowing their automated glasshouses or poly-tunnels can be carefully monitored and controlled with Stephen's magic box'

You need to run your spell checker, lest your final year project attracts less marks.


Paul

Yea that's very true thanks for that, will make changes so!

name stephen password 1110557

what is shown at the moment is a table of the user info, in the editor i have this part as private so when the user (me) logs in it displays that table.

The plan,
when I Login I hope to have the graphs of the sensor displayed!

I collect and store data on cosm for my house; have been doing this for a few years now. I have an arduino 2560 that acts as a collector for the various sensors and controls around the house and I send some of the data up to cosm, emoncms, and thingspeak. The reason I send it to all three of these is that I wanted to try out as many of the cloud storage services for this kind of thing as I could. The arduino collector also serves as a web server for control and monitoring of the house. I can load its web page and it will tell me what's going on and I can change things if I want to.

I put together some json code and it runs in the user's browser to present a graph of temperature and power usage for a 24 hour period. I did it this way because I wanted it to be as close to real time as possible and I wanted to be able to expand the graph enough to see what appliances were running (you get to know them intimately over time). The cool thing about using the user's browser is that the arduino doesn't have to do any work, it just sends code to the browser. The json code is held on a cloud server as well so that it doesn't take up space on the arduino.

You can see the screen I put up to monitor the house, but remember, it's an arduino with 4 simultaneous connections, so you may have to try a couple of times to actually get in. Once you get in and the page starts to load, the data for the last 24 hours is gathered and presented on your browser, so it may take 10 seconds or so to collect, and sometimes cosm will time out first. The timeout doesn't happen very often so it doesn't bother me. If you hit it with a cell phone, the little browsers on them sometimes don't like the iframe that holds the graphs and gauges, just use a different browser or use a pc.

This is very much a work in progress and probably will be for a long time. I change it pretty often, mostly because I can, but sometimes I add or change something based on experience. The little arduino is at <link>, but be kind to it, it's only a little arduino, not a bank of servers like google or bing.

Oh, I also write about this setup on my blog, see the signature line for the link.

So yea got my temperature being graphed on my website so now I have to get the other two working so does anyone know if you can send data of 3sensors to cosm? or is there away to graph all three onto a single graph?

You can send the data from a lot of sensors to cosm. I send several to them. The provide an easy way to get graphs, one data set at a time. If you want to graph temperature and humidity, it's easy to send them the data and get graphs for each of them. If you want both of them on the same graph, it gets harder. The graph I have is temperature and power usage; that took some javascript code to do. I just used the google graph api and some javascript code to do mine.

Take an actual look at cosm, they have a ton of articles on how to send the data and get it back to do something with.