Skip to content

A simple way to send data from an Arduino and save it to a database (MySQL) over WiFi.

Notifications You must be signed in to change notification settings

bsalinas/POST-Arduino-Data

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

POST-Arduino-Data

A simple way to send data from an Arduino and save it to a database (MySQL) over WiFi.

Items You'll Need

Arduino (Uno or similar)
Arduino WiFi Shield
USB cable for Arduino

Getting Started

Setup MySQL Database

  1. Create MySQL Database
  2. Create MySQL User
  3. Give newly created MySQL User access to your newly created MySQL Database
  4. Give newly created MySQL User full privileges to your newly created MySQL Database
  5. Create a table for your database
  6. Add 2 columns to your table: yourdata, timestamp
  7. For timestamp column, change the type to DATETIME and the index to PRIMARY

Edit INSERT script

  1. Download insert_mysql.php
  2. Edit the $username, $password, $database, and $tablename to match your setup
  3. Upload insert_mysql.php to your web-host (remember this URL for later)

POST Arduino data to MySQL Database

  1. Download arduino_post/arduino_post.ino
  2. Edit yournetwork (wireless network), yourpassword (wireless password) to connect to your router
  3. Edit www.yourdomain.com (for char server[]) to the domain you are hosting insert_mysql.php (not the full path to the file)
  4. Edit the POST url to match the path to insert_mysql.php
  5. Edit the Host: www.yourdomain.com to the domain you are hosting insert_mysql.php (not the full path to the file)
  6. Connect the Arduino WiFi shield to your Arduino
  7. Connect your Arduino to your computer using your USB cable
  8. Upload your sketch to your Arduino
  9. You should now be POSTing data from your Arduino to your MySQL database. Yippee!

Credits

Dhaval Karwa
Ben Salinas
Tom Igoe's WiFiWebClientRepeating sketch

About

A simple way to send data from an Arduino and save it to a database (MySQL) over WiFi.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 85.0%
  • PHP 15.0%