Shop OBEX P1 Docs P2 Docs Learn Events
Cell phone text message/email interface — Parallax Forums

Cell phone text message/email interface

Jay KickliterJay Kickliter Posts: 446
edited 2011-03-20 13:20 in Propeller 1
After giving up for a while, I finally returned to this project. For some reason, I got it to work this time.

What it is:

Just a simple interface to a Motorola c168i cell phone. This code allows you to send text messages and emails from a Propeller chip. Nothing more at this point. It has no timeouts built in and can not receive commands yet. I'll need help figuring out how to do that. This is the same phone that OpenGPSTracker uses, and I did use their project as a reference. If you want to add tracking or status reports to your propeller project, this phones is a good choice.

You can get these for $15 at Radioshack. It is a pay as you go phone, so it is pretty cheap to use, especially if you get the monthly 1000, or unlimited messaging plans, at $10, and $20 respectively.

I'll post it in the object exchange when I add better documentation and get some comments from you guys. I a fairly casual programmer, so if any of you are interested adding features, feel free. Please let me know if you come up with anything cool. I'd like to add timeouts, and the ability to send commands to the Propeller remotely. But I don't have much time to work on this.

What you need:

Motorola c168i Phone ~ $15 (Radioshack/Target)
2.5 mm stereo connector ~ $2
At least 1 month of service (AT&T GoPhone) $15 (texts/emails are $.15 each, so I burned though a lot while testing)

Optional:

1000/Unlimited messages $9.99/$19.99

Legend for the 2.5 mm connector image attached:

1. Sleeve: Ground
2. Ring: Phone TX, Propeller RX
3. Tip: Phone RX, Propeller TX

Post Edited (Jay Kickliter) : 11/19/2008 2:57:50 AM GMT
300 x 203 - 35K
320 x 480 - 56K
800 x 600 - 159K

Comments

  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2008-10-08 14:43
    Wow,
    this is exactly what i have been looking for. Thanks Jay

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2008-10-08 15:01
    which radio shack were you able to get this for ~$15. i cant find it for less than $30

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • Jay KickliterJay Kickliter Posts: 446
    edited 2008-10-08 20:53
    I live in NYC, and found one for $15 in the Bronx. Yesterday I bought another one at Walgreens for $19. I hear Target carries them.

    What do you need this for? I'm going to use it as a backup locator in a high altitude balloon, but I can see many possibilities. If you're any good at spin, tear apart the code and let me know what you come up with. I think a lot of people could find use for a generic, modifiable cell phone link.
  • bdickensbdickens Posts: 110
    edited 2008-10-08 21:51
    Please do.

    My house needs a way to txt me when it's safe to go back (Hurricane) and the internet messaging was too unreliable. So if you can post this, it would be great.
    Thanks
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2008-10-09 03:39
    Sure. I am going to use it as remote data acquisition. i will go and buy a phone tomorow and begin playing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • Jay KickliterJay Kickliter Posts: 446
    edited 2008-10-09 04:08
    I have the beginnings of a basic locator. The attached is very incomplete, messy, and inefficient. But, hey, I'm learning.

    Post Edited (Jay Kickliter) : 10/11/2008 11:46:20 AM GMT
    320 x 480 - 37K
  • csfancsfan Posts: 14
    edited 2008-10-10 01:12
    Target, Best Buy and Radio Shack all have them on display, however, all three stores were out of them. Is this model being fazed out? Target and Radio Shack were $15 whereas Best Buy was $25 or $30. Haven't checked Walgreens yet.
  • Jay KickliterJay Kickliter Posts: 446
    edited 2008-10-11 11:42
    I wen to a local RadioShack yesterday, and they did have one in stock. Not sure if it is being discontinued, though.

    Here's a good site on SMS: www.developershome.com/sms/howToSendSMSFromPC.asp

    I'm going to try modifying Perry James Mole's gps parsing code to parse the status messages from the phone. I'll post if it works. Attached is the original code I posted, just cleaned up a little bit. Its still pretty ugly. It just shows the basic functionality of how to send a text message/email.

    I'm thinking it may be a good idea to send messages to memory, then send them. That way if there is an error, the code can try resending it later. The command to send to memory is: AT+CMGW
  • JonathanJonathan Posts: 1,023
    edited 2008-10-11 14:58
    I got one yesterday from RatShack for $15. However, it appears to be missing the "smart chip" thingy, I couldn't find it in the package and ATT customer service wasn't open yet. Grr. No getting it going before work today. [noparse]:([/noparse]

    The chip should have come with the phone, right? Or did I need to buy something else? Bummer is I am a 50 mile round trip from RatShack.

    Can't wait to play with it though, thanks for all the work you have done, looks pretty simple.

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Jay KickliterJay Kickliter Posts: 446
    edited 2008-10-11 16:04
    Yes, the card should have definitely been in the package. It is part of a credit card size piece of plastic, you have to twist it off. Maybe you threw it out by mistake?
  • RinksCustomsRinksCustoms Posts: 531
    edited 2008-10-11 17:00
    obtaining another SIM card could proove a headache. Awesome Application of an otherwise junk phone, but the terrorists beat ya to it, lol. This really is a cool project though, a cheap alternative for home security. I wonder if you could text 911?

    Post Edited By Moderator (Chris Savage (Parallax)) : 10/13/2008 3:24:26 PM GMT
  • JonathanJonathan Posts: 1,023
    edited 2008-10-11 22:41
    Yeah, my friends that picked up the phone for me musta lost it. However, it turns out that it don't matter, ATT phones don't work where I live anyway. Any ideas on a Verizon or Sprint phone that would work?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Jay KickliterJay Kickliter Posts: 446
    edited 2008-10-12 16:15
    There's a 9.99 Verizon phone I saw at Radioshack called the w174. It has a USB port, so I'm not sure if the 2.5 mm audio port doubles as a serial. I've been tempted to try it, since Verizon will have better reception in the places my ballon might land.
  • Jay KickliterJay Kickliter Posts: 446
    edited 2008-10-15 03:59
    The code is starting to come along. Mike showed me how to add timeouts. I cleaned it up a bunch.

    Now you can:

    Send email
    Send text message
    Send position report in a text or email
    Get the battery strength
    Get the signal strength
    Reset the phone

    For some reason, I cannot get the position reports to return the proper message number. They're parsing the same format text from the phone as the basic text/email methods, but seem to only respond with 4043 for the message ID. I think there might be a lot of redundant code, so if anyone has ideas on how to clean it up, let me know.

    Still needed to be done:

    Store messages to memory to be sent later
    Receive commands by SMS
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2008-10-21 02:54
    Jay,
    Should we be able to get data from the phone from text messages??

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • Jay KickliterJay Kickliter Posts: 446
    edited 2008-10-21 12:15
    Do you mean the ability to receive messages? I'd like that, but I don't know how to do it yet. I think the base code is in there that can be modified to check for and scann messages, but I haven't tackled that yet. I think the thing to do is check for incominging messages, read them, scan for some command between special characters, like $A1$, where A1 reperesencs the ascii representaion of a hex number which inturn corresponds to a command the user defines. The characters surrounding the command·need to be something easy to access on most cell phones.

    But like I said, I'm really not a very good, or experienced, programmer, so any help is welcome. I've gotten the cell phone interface to do most of the things I need it to, so I'm mainly concentrating on making a Propeller bases tracker/datalogger as a whole. I think I have that mostly working now, it fires a camera every 10 seconds, logs position reports with the air temperature to and SD, and sends text messages.
  • Mike HuseltonMike Huselton Posts: 746
    edited 2008-11-19 02:21
    Jay,

    How is the progress on your SMS messaging project? Have you wrapped it up to your satisfaction? I would like to expand upon your work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH - Electronics: Engineer - Programming: Professional
  • Jay KickliterJay Kickliter Posts: 446
    edited 2008-11-19 02:53
    I got it working as much as I needed it to. I'm attaching the code. I never did implement the ability to receive commands, since my application didn't need it. But I have a good idea about how to do it if you need the info.

    Post Edited (Jay Kickliter) : 11/19/2008 2:58:54 AM GMT
  • pgbpsupgbpsu Posts: 460
    edited 2010-11-22 20:02
    Jay-

    Did you migrate this to a Verizon phone or have any luck with the w174? I have an application for which this would be perfect, but Verizon is the only carrier.

    Thanks,
    Peter
  • pgbpsupgbpsu Posts: 460
    edited 2010-12-29 14:23
    Jay (or anyone else whos worked with this phone)-

    Did you have to do anything to tell the phone you wanted to use the serial port (rather than the head phones)?

    I've managed to get my hands on the exact phone you used but I can't get any response. I see from an older thread you were having trouble at first. Did it turn out that you'd blown the serial port, or was there something else?

    Any tips on how to get started would be great. I think I've got all my parts together, but now I can't seem to get off square one because I can't get any response from the phone. I've even tried connecting the phone's serial port to a PropClip and trying to issue AT commands directly to the phone via Hyperterm and PST. The phone doesn't react at all. Do you think I've blown the phone's serial port, or am I just not doing this correct? The phone seems to function find otherwise (i.e. I can send and receive text messages when entering them directly into the phone). So if I've damaged it, the damage is limited to the serial port. Unfortunately, that's the whole reason to use this phone.

    Thoughts? Anyone?
    Hope you're all having a Merry Christmas,
    Peter
  • idbruceidbruce Posts: 6,197
    edited 2010-12-29 16:52
    Jay

    Looks like another interesting project. I was thinking of something similar, but I was thinking more along the lines of using a modem and interfacing through a telephone jack, where the Prop would be stationary.

    Bruce
  • stuartXstuartX Posts: 88
    edited 2011-01-19 18:44
    Would you all happen to have the working code in BS2 mode? I'm not at the propeller chip level yet.
  • pgbpsupgbpsu Posts: 460
    edited 2011-03-20 13:20
    I was able to follow Jay's lead and getting this setup working. I did however have some trouble using standard AT commands. The following document help access some the phone's features (like listing and reading the messages on the phone).
Sign In or Register to comment.