So I'm doing a project that involves getting sensor data from several sensors, and then sending them to an external server when a tragic occurs. But I've been having trouble figuring out how to send this data, and I am welcome to advice (I'm still relatively new to Arduino coding).
I'm using an Arduino mega, with a sim900 GSM shield and an SD card. The sensors are just analog reads and a GPS.
I've looked into FTP, a Xively account and http requests to a web server but couldn't figure it out.
-
Do you have internet service in that GSM shield?fabrosell– fabrosell2016年03月30日 21:21:47 +00:00Commented Mar 30, 2016 at 21:21
-
Yup. The shield has a SIM card with 3GGeneralno1– Generalno12016年03月31日 02:15:11 +00:00Commented Mar 31, 2016 at 2:15
-
You should check for: "Sim900 HTTP POST" on Google. There also should be a lot of libraries for this. You'll have to set up a webserver that accepts HTTP post messages. But you might try using a post dump test server first (posttestserver.com) this worked great for me in the past. But I had an PIC microcontroller.aaa– aaa2016年03月31日 09:12:49 +00:00Commented Mar 31, 2016 at 9:12
1 Answer 1
There is a good example of using the SubmitHttpRequest() in this article: GPRS Shield SIM900 Arduino
You could easily modify: mySerial.println("AT+HTTPPARA=\"URL\",\"www.yourwebsite.com/testing.php\"");
to include a string of the sensor value, and then using a PHP script to MySQL on your webserver. Maybe something like: http://yourwebsite.com/testing.php?sensor1=5&sensor2=10