I'm thinking of using a ethernet arduino as a water leak detector (sponges with stainless steel probes with one side having a resistor and the other side going to a digital input).
But I want it to be able to send my phone an SMS if there is a leak detected and also a daily sms so I know everything is working.
client.println("POST HTTP/1.1")
client.println("Host: www.mysite.com")
client.println("User-Agent: Mozilla/4.0")
client.println("Content-Length: 39") // Change to be number of characters in POST line between quotes
client.println("Content-Type: application/x-www-form-urlencoded")
client.println("name=yes@no.com&number=1234567890&carrier=38&textarea=HELP!! Water leak in BASEMENT SENSOR #1&submit=Send");
When you use one of these services to send a text, they are just sending an email to a specific number. Each cell carrier uses a different email address. For example, to send a text to an AT&T phone, you would send an email to x@txt.att.net, where x = the person's 10 digit phone number. Most of these services just use a lookup table to find out what email address to use with what phone number. Here a site listing all the addresses: http://www.emailtextmessages.com/
Its really simple to use PHP to send an email, just look around for tutorials online.
Definitely can use SMTP to send an SMS as you said, but it's definitely more complex to handle the full bi-directional session of SMTP, rather than just issuing a quick GET... command over port 80.. That's why I'm also looking to do the same thing..
In my case, I'm using a WiFly which is configured for a different port for it's main purpose, and as such, if I have to do more than a packet or two, it's going to interfere with it's normal operation, but I am pretty sure I can at least send the one TCP transaction reliably without messing with my otherwise working syslogging config...
So.. Anyone have any idea of a good way to send a text via a quick HTTP request?
The simplest way to work out what you need to send is to do it in the Chrome browser with developer mode turned on (F12). This will capture the HTTP request from the browser in the network tab. Make sure you click on "view source" to view the raw request.
Now that you have a working HTTP request, you just need to reproduce the same request from the Arduino using your wifi board.
If you want to test your request outside of the browser, you can use the Postman add on for Chrome.
Its nice to send sms using arduino forum via free sms and if you are require sms in bulk for commercial purpose than you can use other software like Top 5 Bulk SMS Service Provider in India with SMS API because its way to connect with customers.