views:

799

answers:

3

I have Mio A701 communicator that I would like to use as GSM modem for sending SMS from my Mac.

What I've found so far is that one just can send an AT commands directly from terminal to special ports like /dev/ttyUSB0 if modem is connected via USB port or /dev/rfcomm0 if connection is handled via bluetooth. My problem is that when I try to issue a command I get a "permission denied" response:

"AT+CMGS=test\r" > /dev/ttyUSB0
-bash: /dev/ttyUSB0: Permission denied

Also "ls /dev" shows that neither ttyUSB0 nor rfcomm0 files are present there so I can't update permissions on these files.

Any help would be greatly appreciated, thanks in advance.

Update: problem is solved.
First of all Mio A701 appears to be wrong choice since it does not support AT commands for sending SMS.

This PHP code works fine with Nokia 3310c connected via bluetooth:

$number="<phone number in international format with + sign>";
$message="Hello World\ntest"; // as far as I've tested \n successfully turns into a line break in SMS on Mio, Nokia and Alcatel phones
$port="/dev/tty.phone"; // this path was set in "Mac preferences" -> bluetooth -> "configure ports" for selected device


if($fd = fopen($port, 'a')) {
    fwrite($fd, "AT+CMGF=1\r"); // text mode for SMS
    sleep(2);
    fwrite($fd, "AT+CMGS=\"$number\"\r");
    sleep(2);
    fwrite($fd, "$message\032");
    sleep(2);
    $fh = null;
} else
    echo "Phone unreachable";
A: 

Try smsd utility from smstools package, hope it will help

sultan
smstools is no longer an active project. use http://smstools3.kekekasvi.com instead.
yanokwa
A: 

Hi Anton, i'm trying to do the same thing with objective c but should also support recieving sms messages. Do you know any resources i can use? I'm not familiar with Python and the requirement is to do it in objective c with the mobile phone hooked into the mac.

I suppose you can take the similar strategy - define device access port as file in mac preferences and then constantly poll it checking for new messages in Objective C. You can read about SMS reading AT commands here: developershome.com/sms/howToReceiveSMSUsingPC.asp Also minicom or Zterm programs can help you during development - they allow for manual AT commands input and display phone responses on screen.
Anton
+1  A: 

best way to send sms and ussd messages is to install smstools3 (not smstools) and build on the sample scripts.

yanokwa