Pages: [1]   Go Down
Author Topic: sending sms from arduino using free sms website...  (Read 1399 times)
0 Members and 1 Guest are viewing this topic.
USA Nebraska
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

I looked around and found http://txtdrop.net

They let you send an sms via a web form.

after looking over some old threads

Here is the text of the form at txtdrop.net

Code:
<table width="382" height="100" border="0" cellpadding="2" cellspacing="0">
                <td width="120"><tr>
<form action="" method="post" form name="tabform">
                  <td width="158">From:</td>
                  <td width="179"><div align="center">

<input type="text" name="name" id="name" size="24" maxlength="21" />
                  </div></td>
                </tr>
                <tr>
                  <td>To:</td>
                  <td width="258">
                  <input name="number" type="text" id="number" size="13" onKeyup="autotab(this, document.tabform.body)" maxlength="13" /></td>
                </tr>
<tr>
<td>Carrier:</td>
<td>
<select name="carrier" id="carrier" class="style3">
<option value="38"> AT&T Wireless</option>
</select></class></td>
</tr>
                <tr>
                  <td>Message:</td>
                  <td><textarea name="body" cols="28" rows="3" wrap="PHYSICAL" class="style4" id="textarea" onkeyup="onTypeNotes()"></textarea></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td>
  <input type="hidden" name="submitted" value="1"> <input type="submit" name="submit" value="Send" /></td>

So I can up with:

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");

Is this right?

does the "submit=Send" have to be in there?

Thanks
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can someone help with a way to call a simple fuction to use txtdrop.com to send txt message from arduino?

There is a widget at the site to create html code for websites. http://www.txtdrop.com/generate.php
The code generated sends variables to http://www.txtdrop.com/send.php

Maybe Browseurl or a get command?

Maybe a function and pass string variable to change to change the message.

I use ethercard library and am trying to do this any help would be appreciated.

Logged

Maine
Offline Offline
Sr. Member
****
Karma: 10
Posts: 413
Caution: Explosives in use.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"Anyone who isn't confused really doesn't understand the situation."

Electronic props for Airsoft, paintball, and laser tag -> www.nightscapetech.com

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Txtdrop.com is php.  I need a simple command to use them.

this is the code generated by thier widget

p><center>
<form>action="http://www.txtdrop.com/send.php" method="POST" target="_blank"><input type="hidden" name="number" value="xxxxxxxxxx">
<textarea>name="body" rows="3" cols="25" size="145">Drop Me A Txt</textarea><br>
<a href=http://www.txtdrop.com>txtDrop.com</a><input type=submit value="Text Me"></form>
</center></p>

this is somthing I came up with and doesnt work. needs more variables?

Stash::prepare(PSTR("GET http://www.txtdrop.com/send.php? type="hidden" name="number" value="xxxxxxxxxx" body="cold" HTTP/1.1"


ether.browseUrl(PSTR("GET http://www.txtdrop.com/send.php?type=hidden name=number value=xxxxxxxxxx body=cold HTTP/1.1")



This should be easy I am just missing something



Logged

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can use SMTP to send SMS:

http://arduino.cc/forum/index.php?action=printpage;topic=119014.0
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Pages: [1]   Go Up
Jump to: