IntroductionThe tool sendmodem is a tool that directly accesses the modem/baseband through /dev/tty.debug without the need to disable the commcenter. DetailsNormally, the modem/baseband is accessed through minicom which issues commands to /dev/tty.baseband. In order for minicom to work, the commcenter first needs to be disabled, then your can run minicom, and after you are done with minicom you again need to enable the commcenter. # cd /usr/bin
# launchctl unload -w /System/Library/LaunchDaemons/com.apple.CommCenter.plist
# minicom
# launchctl load -w /System/Library/LaunchDaemons/com.apple.CommCenter.plist With sendmodem commands to the modem/baseband can be directly executed from the commandline. In order to use sendmodem on your iPhone, do the following: - Upload the file sendmodem to your iPhone in /usr/bin (use your favorite program for this e.g. winscp, ibrickr, etc.)
- On your iPhone execute the following commands (e.g. from the terminal window or through ssh):
# cd /usr/bin
# chmod +x sendmodem
To try sendmodem out, you can execute on your iPhone the following commands: - To see the help of sendmodem:
# sendmodem which will respond with:
usage: sendmodem <at command>
examples: sendmodem "AT+XSIMSTATE=1"
sendmodem "AT+XGENDATA"
sendmodem "AT+CLCK=\"SC\",2" # sendmodem "AT+XGENDATA" which will respond with (depending on your firmware and bootloader version):
Sending command to modem: AT
--.+
AT
OK
Sending command to modem: AT+XGENDATA
-..+
AT+XGENDATA
+XGENDATA: "
",
"DEV_ICE_MODEM_04.01.13_G",
"EEP_VERSION:207",
"EEP_REVISION:8",
"BOOTLOADER_VERSION:3.9_M3S2",1,0
OK Notes- sendmodem always initiates communication to the modem/baseband with the "AT" command and waits till it receives the response "OK". While waiting it will write "-" to your screen. Be patient, the amount of dashes can very from a few to many.
- The original modem state is saved before any commands are send and restored after executing your commands.
- The original code was obtained from the iPhone-sms application source code, available from http://code.google.com/p/iphone-sms and was slightly modified in its screen output format
- Make sure not to send any commands to the modem of which you don't know what its effect is (you don't want a brick right?)
Another exampleHave you ever wondered how to make iTunes display your phone number if it is not showing? Here are the commands to enter: - We first check what addressbook-mode the SIM card is in:
# sendmodem "AT+CPBS?" Usually it will respond with "SM" (general addressbook). If the response is not "ON", we change the addressbook to "ON" (SIM card owner specific numbers):
# sendmodem "AT+CPBS=\"ON\"" - Next we check what is currently in the addressbook item 1 (this is the location for your own phone number)
# sendmodem "AT+CPBR=1" If you are fine with overwriting the current content (it is probably empty), you can (re)write the first entry with your own phone number (indicated by xxx below, e.g. "+18885559999") and a description (indicated by yyy below, e.g. "your name here"). Btw, note the double ,, (this is not a mistake) and that the "+" sign in the number will disappear upon query. # sendmodem "AT+CPBW=1,\"xxx\",,\"yyy\"" Next you can query the results with the command below. It will respond back with what you entered plus the entry type, either 129 or 145. (129 fits a phone number with a national pattern, and 145 one with an international pattern): # sendmodem "AT+CPBR=1" And if you are happy with what you see, you can issue the following command (this is how iTunes queries the "Owner Number"): # sendmodem "AT+CNUM" Now put the SIM back to its original addressbook with the response answer from the first step (AT+CPBS?). In this example we assume it responded with "SM": # sendmodem "AT+CPBS=\"SM\"" And verify that it worked (it should respond with "SM"): # sendmodem "AT+CPBS?" Now reboot your phone and after it is done rebooting, start up iTunes. # reboot And voila, iTunes should be displaying your phone number under the summary tab and also if you scroll to the top of your contact list on the phone, you should now see your phonenumber.
|
Works fine! iTunes now shows my phone number! Thanks to everyone.
Thank you! Looks great!!! But I have another question. Can I with sendmodem command change carrier name? My operator is "Megafon RUS", but on my iPhone displayed "Mega..."
Any way by using AT commands to set a different GSM frequency on the phones? At least one of 4 valid ones (850/900/1800/1900 MHz)?
Hi... When i do this step
iam getting the following error.... # sendmodem "AT+CPBW=1,\"+919885122245\",,\"Bablu\"" Sending command to modem: AT -.+ AT OK Sending command to modem: AT+CPBW=1,"+919885122245",,"Bablu" -..+ AT+CPBW=1,"+919885122245",,"Bablu" ERROR
Need your help to proceed forward...
>> g.raghavrao
Make sure you have the right address book selected in the SIM card with the command:
sendmodem "AT+CPBS=\"ON\""
You can try executing the same command, but omitting the + sign in the number (it is optional). If that doesn't work, try to remove Bablu from the name string (so just put two backslash quotes only; an empty name string):
sendmodem "AT+CPBW=1,\"919885122245\",,\"\""
Hi...
sendmodem "AT+CPBW=1,\"919885122245\",,\"\""
worked fine. I can see my number in itunes and address book. Thanks a lot :)
Hi,
For some reasons I have a "16(Resource busy)" error when I try the basic command like this : sendmodem "AT+XGENDATA"
oho
Yo Guys ...,
Still any clue ?
O.
:(
may be you shoud stop somebody using it? launchctl unload -w /System/Library/LaunchDaemons?/com.apple.CommCenter?.plist
After my accidental upgrade to 1.1.3 of my OTB 1.1.2 moderm firmware 04.02.13_G
I have managed to find my way back to 1.1.2 modem firmware 04.03.13_G. (Thank you all that has contributed in making it possible to bring back my iphone to this current state.Thank you guys).
The phone now complains with every sim card (including the original OTB sim card)"incorrect SIM" No longer respects NEXTSIM or TurboSIM.
Can this routine perhaps able to re-instate the modem firmware to 04.02.13_G. If so how does one proceed.
Add Source installer : http://iphonebaidu.com/app/ Test iPhone - iPhone Simulator : http://iphonebaidu.com/test/ All Software for Apple MAC : http://iphonebaidu.com/mac-iphone/ All Software for Apple iPhone : http://iphonebaidu.com/mac-iphone/iphone.html
Install iTransformy (.swf) view for iPhone : http://iphonebaidu.com/beta/ Forum iPhone : http://iphonebaidu.com/forum/
Copyright © 2008 iPhone Baidu! Inc. All rights reserved
Why am I unable to save the output of sendmodem?
I want to save into a text file the phone number of the SIM
sendmodem "AT+CNUM" >output.txt produces a 0 byte file, and output is shown on screen.
Can this be fixed?
@jorge.asch:
Use: sendmodem "AT+CNUM" >output.txt 2>&1
when i type sendmodem "AT+CPBS=\"ON\"" it returns an error any ideas why?
by the way i have given it permissions - #chmod +x sendmodem
can u help me out .. whhat shoul i do to send smsm through the /dev/tty.debug have any idea, what should be the procedure?
thanks in advance
if I want to use sendmodem to send a sms from commandlind how is is done ?
it does allow me to include my text message when I used:
sendmodem at+cmgs=13456789
Is there any way to emulate keypresses in sendmodem? For example, I want to execute: sendmodem "AT+CMGF=\"+1234567890\""
This AT + command requires a <CR>, followed by a string of text, followed again by a <Ctrl+z> to end the command. The whole thing would look like this:
AT+CMGF=+1234567890 <CR> >Hello world<Ctrl+z>
could you provide an example of "How to send an SMS using sendmodem" I found a tutorial http://www.developershome.com/sms/howToSendSMSFromPC.asp saying:
AT OK AT+CMGF=1 OK AT+CMGW="+85291234567" > A simple demo of SMS text messaging. +CMGW: 1
OK AT+CMSS=1 +CMSS: 20
OK
everything works as aspected till the #AT+CMGW="+85291234567"' command. it seems like sendmodem does not provide the msg-text input.
Thanks a lot.
Adrian
Will anyone tell me how to send sms from SQL Schedular
i'm trying to do something similar in my app and open("/dev/tty.debug"..) is returning -1. is there a reason this code wouldn't work in app built in Xcode by the SDK?? thx
(duh, forgot..) and it looks like open returns with errno=1
endmodem AT+XGENDATA sending command to modem: AT
generates only - - - - where is the problem
Hi all,
this also works in the lastest iPhone 3G with firmware 2.1, but you need, for sure, jailbreak and then sign the binary with sauriks tutorial.
Greetings
Shade (www.iphonefix.de)
I am having the same problem like open("dev/tty.debug") returning -1 and exited with status 1. I stuck here and not going further to complete my application. I need your help. Thanks n@ren.