Interfacing a cell phone?
achilles03
Posts: 247
I'm trying to emulate a project called "OpenGPSTracker", which was created for use with the Atmel AVR. I've also seen similar projects done with the Arduino. At the heart of it is the Motorola c168i, which can send and receive serial data through the 3/32" mic jack.
I'm trying to send a text message with a BS2, however I haven't been successful yet. I have the rx line of the phone attached connected through a 2/3 voltage divider (0 to ~3.7V), and they share a common ground. Below is the code I'm trying to use to get it to "wake up" the phone, then send an SMS:
SEROUT 3,396,["+++",13]
PAUSE 100
SEROUT 3,396,["AT",13]
PAUSE 100
SEROUT 3,396,["AT",13]
PAUSE 100
SEROUT 3,396,["AT+CMGF=1",13]
PAUSE 100
SEROUT 3,396,["AT+CMGS=",34,"+256337####",34,13]
PAUSE 20
SEROUT 3,396,["TESTMESSAGE",26]
Where 13=CR, 34 = quotation marks ("), and 26=CNTL-Z, which apparently you need to enter to get it to send the text. Also, the #### is just the last 4 digits of the number I'm trying to send it to 'blacked out' for posting. From what I've read, the phone can detect baud rate, although I'm trying to connect at 2400, but have also tried 4800. I've tried all the different options (inverted, true, driven, open, even parity, no parity), but still no SMS. On some baud rates, it'll beep and change screens (to "dialed calls" or something), but nothing more than that.
Anyone see anything obvious? Any suggestions?
Thanks!
Dave
I'm trying to send a text message with a BS2, however I haven't been successful yet. I have the rx line of the phone attached connected through a 2/3 voltage divider (0 to ~3.7V), and they share a common ground. Below is the code I'm trying to use to get it to "wake up" the phone, then send an SMS:
SEROUT 3,396,["+++",13]
PAUSE 100
SEROUT 3,396,["AT",13]
PAUSE 100
SEROUT 3,396,["AT",13]
PAUSE 100
SEROUT 3,396,["AT+CMGF=1",13]
PAUSE 100
SEROUT 3,396,["AT+CMGS=",34,"+256337####",34,13]
PAUSE 20
SEROUT 3,396,["TESTMESSAGE",26]
Where 13=CR, 34 = quotation marks ("), and 26=CNTL-Z, which apparently you need to enter to get it to send the text. Also, the #### is just the last 4 digits of the number I'm trying to send it to 'blacked out' for posting. From what I've read, the phone can detect baud rate, although I'm trying to connect at 2400, but have also tried 4800. I've tried all the different options (inverted, true, driven, open, even parity, no parity), but still no SMS. On some baud rates, it'll beep and change screens (to "dialed calls" or something), but nothing more than that.
Anyone see anything obvious? Any suggestions?
Thanks!
Dave
Comments
The first is - have you adjusted the pause delays you have at each step? Are these standard, specified as being fixed in some manner?
Have you tried sending the data as larger concatenations of chunks, as in SEROUT 3,396,["+++",13, "AT", 13, "AT", 13, "AT+CMGF=1",13]
What are CMGF and CMSG?
Should you be looking at any SERIN commands, like the serial equivalent of a CTS, an OK, or something?
Apologies if these are utterly unhelpful thoughts, they're just the things I'd be looking at if I was messing with it myself.
Dave
I did that much of it a few years ago, after reading this thread:
http://forums.parallax.com/showthread.php?105901-Motorola-c168i-Cell-Phone-and-Propeller&highlight=Motorola
You might go through that to see if anything there helps, though it's written for Propeller.