Go Down

Topic: Sending data from arduino+ethernet/wifi shield to a sql server (MS) on the web (Read 7217 times) previous topic - next topic

luther

Hi, this is my first post in Arduino's forum, I find this community great and helpful.

My new project is to use Arduino to:

*sensor my room temperature and store data in a sd card
*with the use of a wifi/Ethernet shield, send every 2min the data stored in my sd card to a SQL Server (MS)
*I've created a website that will retrieve data from the sql server and display all the data in browser, so that when I'm away from home I can monitor my home temp.

I've read many solutions, but in most cases i need a pc that acts like a bridge between the arduino and the sql server.
Furthermore I'm using MS azure as sql server and clearly coding the arduino with ado.net is impossible and it's not an elegant solution.

I've also considered using Netduino but I want to stick to Arduino

terryking228

Hi, I don't know how to code all this myself, but it can be done using existing online sites..  Basically they use HTTP PUT and GET or UDP PAckets so that you don't have to mess with opening router ports etc.

KSduino.org is one example.. Here's my live house data: http://ksduino.org/?devices&device_id=3330

Example Arduino code is here: http://arduino-info.wikispaces.com/ksduino-tests1 

I plan to make that into a much better how-to page on the http://ArduinoInfo.Info WIKI

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

wildbill

How much help do you want? By which I mean is this a learning experience or are you looking to get it working quickly by adapting existing code? If it's the latter, you might find this interesting: http://arduino.cc/forum/index.php/topic,69165.0.html

luther

Mostly it’s learning experience, but the goal is to build basic domotic devices for my house and eventually, if everything is good, sell them, for this reason the system needs to be robust.

According to the greenhouse project and from what I seem to understand, he is using wiserver.h library for the wifi shield to communicate via PHP to the Mysql server?

This implies that I can’t send data to a sql server but only to a mysql using php?

thanks

wildbill

No, your PHP server can use whatever database suits you. The only reason I used MySQL was because I already had a web server (LAMP) set up with it ready to go. You can use the same GET method to send the data to the PHP driven site, what it does with that data is up to you.

luther

thanks for your help, I'll give it a try using PHP, since I'm used to ASP.net I hope to get some results in short term.

drhirn

Hi!

There's no need to use PHP for this, you can write this in ASP.NET as well.
Your Arduino just has to call a website like http://www.mydomain.tlc/index.aspx?temp=[SensorOutput]
This website reads out the parameter "temp" and writes it to the database.

Bye
Stefan

laadams85

If you want a solution that doesn't need an external PC you may want to consider using a Raspberry PI to host the webserver.
http://www.penguintutor.com/linux/raspberrypi-webserver

Go Up