Sending SMS with cellphone on linux : gnokii
Posted: Sun Jan 06, 2008 3:17 pm
Gnokii is highly configurable and broadly used. Chances that you get your cell phone to send sms is very high. All works from command line ,thus can be integrated in scripts to get stuff send trough SMS.
WATCH IT : Depending on the model,this connection setup will probably change. But with a bit of googling around ,you'll get your cellphone quickly up and and running. For more on connectivity check the gnokii site : http://www.gnokii.org/cables.shtml
example with nokia 6300 : http://graemehunter.co.uk/2007/05/linki ... to-ubuntu/
I got mine to work : Nokia E50 (S60 symbian based)
OS : Ubuntu Gutsy 7.10 - alternate version
Cabling : Standard USB cable used to check the connection.
Phone mode : Data Suite (is asked on the phone when connecting cable)
OS phone version : V 2.26.01
I followed these guidelines :
Installing gnokii
sudo apt-get install gnokii
Testing USB connectivity : using wvdial
http://ubuntuforums.org/showthread.php? ... kii&page=2
This enabled me to see if connectivity was real,working and on what port.
First install wvdial
Configuring the gnokii config file : /etc/gnokiirc
http://dt.in.th/
An interesting command as well : gnokii --identify
WATCH IT : Depending on the model,this connection setup will probably change. But with a bit of googling around ,you'll get your cellphone quickly up and and running. For more on connectivity check the gnokii site : http://www.gnokii.org/cables.shtml
example with nokia 6300 : http://graemehunter.co.uk/2007/05/linki ... to-ubuntu/
I got mine to work : Nokia E50 (S60 symbian based)
OS : Ubuntu Gutsy 7.10 - alternate version
Cabling : Standard USB cable used to check the connection.
Phone mode : Data Suite (is asked on the phone when connecting cable)
OS phone version : V 2.26.01
I followed these guidelines :
Installing gnokii
sudo apt-get install gnokii
Testing USB connectivity : using wvdial
http://ubuntuforums.org/showthread.php? ... kii&page=2
This enabled me to see if connectivity was real,working and on what port.
First install wvdial
Code: Select all
sudo apt-get install wvdial
Code: Select all
root@ubuntu:~# lsusb
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 003: ID 0421:04c9 Nokia Mobile Phones
Bus 001 Device 001: ID 0000:0000
sudo /sbin/modprobe usbserial vendor=0×421 product=0×4c9
wvdialconf create
root@ubuntu:~# wvdialconf create
Editing `create'.
Scanning your serial ports for a modem.
Modem Port Scan<*1>: S0 S1 S2 S3
WvModem<*1>: Cannot get information for serial port.
ttyACM0<*1>: ATQ0 V1 E1 -- OK
ttyACM0<*1>: ATQ0 V1 E1 Z -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyACM0<*1>: Modem Identifier: ATI -- Nokia
ttyACM0<*1>: Speed 4800: AT -- OK
ttyACM0<*1>: Speed 9600: AT -- OK
ttyACM0<*1>: Speed 19200: AT -- OK
ttyACM0<*1>: Speed 38400: AT -- OK
ttyACM0<*1>: Speed 57600: AT -- OK
ttyACM0<*1>: Speed 115200: AT -- OK
ttyACM0<*1>: Speed 230400: AT -- OK
ttyACM0<*1>: Speed 460800: AT -- OK
ttyACM0<*1>: Max speed is 460800; that should be safe.
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
Found an USB modem on /dev/ttyACM0.
create<Warn>: Can't open 'create' for reading: No such file or directory
create<Warn>: ...starting with blank configuration.
Modem configuration written to create.
ttyACM0<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
http://dt.in.th/
For more gnokii commands : http://wiki.gnokii.org/index.php/User's_GuidePosted on January 2nd, 2008 at 1:09pm by the DtTvB
This post is about sending SMS from Linux. This time it needs some devices connected to your computer, which is... your mobile phone!
I have an E50, which, is Symbian, along with DKU-2 cable, connected to my laptop running Ubuntu 7.10.
Now, the program you need is: Gnokii. It is a program that can manage your mobile phone. You can use bluetooth also, but, my laptop doesn't has a Bluetooth. Uhhh, it was, but it is not working now. Both on Windows and Linux.
I ran this command on my laptop:
sudo apt-get install gnokii
And I got gnokii installed. The next thing you want to do is get your phone working. You should read gnokii's wiki and make a configuration file.
Here is mine (E50 connected via DKU2):
[global]
port = /dev/ttyACM0
connection = serial
model = AT
After I made a configuration file, I ran this command:
echo 'Hello World' | gnokii --config configfile --sendsms 089XXXXXXX
If it said Send succeeded! and you received your SMS, then it is working.
By getting your computer online all the day you can make your own SMS gateway! Using a bit PHP and shell scripts will make it possible.
An interesting command as well : gnokii --identify
Code: Select all
root@ubuntu:~# gnokii --identify
GNOKII Version 0.6.18
IMEI : 35xxxxxxxxxxxxxx1
Manufacturer : Nokia
Model : Nokia E50
Product name : Nokia E50
Revision : V 2.26.01