What's new

Closed Send and receive sms using gsm modem or phone on ubuntu

Status
Not open for further replies.

Draft

Administrator
Administrator
Joined
Jan 23, 2011
Posts
16,287
Solutions
104
Reaction
64,688
Points
10,618
I currently use mobile broadband as my primary Internet connection and this worked great on my Linux PCs for a while. The GSM modem I'm using every day is good old Huawei e220, but there is one aspect of this great hardware device I haven't used on my Linux PCs, and that is sending/receiving SMS messages. In this article I will show you how to send and receive SMS messages using GSM modem or phone on Ubuntu Linux PC.
Lets begin. We don't really want to enter our administration password every time we want to send SMS message, so first thing we must do is to add our selves to the dialout user group. All members of this group have permission to use modem-like devices on Ubuntu system. This is how we do it:

Code:
sudo adduser $USER dialout

Now we can install great Linux application You do not have permission to view the full content of this post. Log in or register now. and its GTK frontend Wammu, again here's how:

Code:
sudo apt-get install gammu wammu

Before configuring our modem we must know a few things about it. First thing you should do is go to the You do not have permission to view the full content of this post. Log in or register now. and find your GSM device. In this how to I will use my Huawei e220, with Gammu phone database page You do not have permission to view the full content of this post. Log in or register now.. On this page I've found first data we need to configure Gammu, the connection parametar that is at19200 in my case. You should obtain the connection parameter for your GSM device on its Gammu phone database page.
Also you must find your GSM device entries inside /dev directory. You will recognize this entries because they usually start with "tty" prefix. On my hardware this device entry is namedttyUSB0 and ttyUSB1. You can also check dmesg this way:

Code:
dmesg|grep tty

Here's output of this command on my hardware:

Code:
:~$ dmesg|grep tty
[	0.000000] console [tty0] enabled
[	8.103849] usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0
[	8.103998] usb 2-2: GSM modem (1-port) converter now attached to ttyUSB1

Now you can use gammu-config to configure your hardware or you can write Gammu configuration file manually. Here's how to do it using gammu-config:

Code:
gammu-config

Here's how you will setup your hardware with port ttyUSB0 and connection parameterat19200 I'm using for my Huawei e220 GSM modem:
gammu-config.png
After you set configuration options you can save changes and you will get Gammu configuration file .gammurc file inside you home directory. You can also save this file for future use once you are sure that configuration it contains is correct.
Important notice: Network manager has tendency to lock your GSM device once you start your GSM Internet connection. The device stays locked even after you disconnect so you must make sure that right click on Network manager -> Enable mobile broadband option is unchecked before you use Gammu. If this option is enabled you will get permission denied errors from Gammu.
After we got that right I will show you how to check your SIM card messages the CLI way and how to start the GTK Gammu GUI called Wammu. To view all messages on your SIM card using CLI you can use something like this:

Code:
gammu getallsms

For more about CLI usage you can check Linux manual pages usin man gammu command. To send and receive SMS messages using you GSM device you can also use GUI frontend to Gammu called Wamu. You will find this program by navigating to the Applications -> Accessories -> Wammu. Then you can go to Phone -> Connect. If the connection to the modem is successfully established you can use Retrieve menu to get messages or contacts from your SIM card and Create menu to send new SMS messages. If connection couldn't be established then you need to double check port and connection parameter you have used to configure Gammu. Cheers!

Credits: You do not have permission to view the full content of this post. Log in or register now.
 

Attachments

Thanks for sharing!.. I tried running the modem gui dashboard using wine.. well yeah it works just by showing the nice dashboard but was not able to detect the usb modem stick.. will try this one ;ater on my Linux Lite box ;-)
 
it works!.. I am using unlocked Globe Tattoo's Huawei E1550 using the same set-up.. additional note to the steps TS.. after adding the DIALOUT user "sudo adduser $USER dialout" and install Gammu Wammu don't forget to log-out or restart your system.. then on the part where you need to configure hardware "gammu-config" there is an image part there that did not appear on my screen but here it is.. just change the port part to tty USB0 click OK then click SAVE.. and that's it!

10698633_299575693578270_6821309119822507401_n.jpg
 
Status
Not open for further replies.

Similar threads

Back
Top