Sending SMS with Linux and your mobile phone (the gnokii way)

Since a few days i'm trying to get my mobile phone (a basic nokia 3110c ) speaking with Linux. The idea is to make our users being able to post pictures via mms or sms sent to a mobile number (a phone connected to our server via usb cable).

I came across different resources on the web, the most advance SMS/WAP server being Kannel, but it seems that it doesn't accept connections frrom USB cables.
I found 2 softwares able to handle this : gnokii and gammu (gammu is a branch splitted from gnokii).

Here is what i did :

1) install gnokii : with apt or yum (but the versions installed is far from the latest so if it's not compatible with your phone, you may have to hand-install the latest one.

2) check the port where your mobile has been connected:
dmesg | tail (right after having connected your phone to usb)
check which port is returned:
for me, by seeing the following line I assume that the port is ttyACM0
cdc_acm 4-2:1.1: ttyACM0: USB ACM device
to be verify that this port is the right one, you can ls on dev directory to check if it is listed:
ls /dev/ttyAC* for exemple listed my port.

3) when you get the right port, you can start configuring gnokii
edit the gnokiirc vim /etc/gnokiirc
the main settings to change are:
port = /dev/ttyACM0
model = 3110 (for my mobile phone)
connection = dku2libusb (or AT if no other connection is available)
In fact AT is a basic communication protocol for most mobile phones, it will work to send sms and retrieve phone info, but you barely can do anything else with it. The best is to find if any other mean to connect to your phone using proprietary driver exists.
good resources can be found on the nokia website to see which cable does your mobile phone uses:
http://europe.nokia.com/A4678148
mine uses dke-2 which was not supported directly by gnokii and gammu, but trial and error made it work with dku2libusb for gnokii.
other useful resources (for my phone)
GNOKII
www.gnokii.org
http://www.nabble.com/Nokia-3110c-td19382514.html#a19386835
http://www.nabble.com/Gnokii-0.6.27-Cannot-Identify-Nokia-3110C-td205801...


Commentaires