Here we have 10 steps that you need to follow one step at a time and in order.
Please stop, do not continue to the next step, and post questions in playSMS Forum when you experienced difficulties or found error during following this manual.
Let's start.
-
Make sure you have root access
sudo su -
-
Install required packages for building Gammu from source in Ubuntu
apt-get install libcurl4-openssl-dev libusb-1.0-0-dev libbluetooth-dev libmysqlclient-dev cmake
-
Download Gammu, navigate to Gammu source package file location and extract
Download
gammu-1.36.2.tar.bz2
from http://wammu.eu and save it in/usr/local/src
cd /usr/local/src wget -c http://dl.cihar.com/gammu/releases/gammu-1.36.2.tar.bz2 tar -jxf gammu-1.36.2.tar.bz2
-
Enter extracted Gammu source package directory and compile Gammu
cd gammu-1.36.2 ./configure make make test make install ldconfig
Note:
- Do not forget to run
ldconfig
- Do not forget to run
-
Create required directories
mkdir -p /var/log/gammu /var/spool/gammu/{inbox,outbox,sent,error}
Note:
- The directory names are case-sensitive
-
Setup Gammu spool directories owner and permission
In this example your webserver's user and group is
www-data
chown www-data:www-data -R /var/spool/gammu/*
You can also set files and folders permission to world-writable
chmod 777 -R /var/spool/gammu/*
-
Get example of
gammu-smsdrc
and copy to/etc/
wget -c https://raw.githubusercontent.com/antonraharja/playSMS/master/contrib/gammu/linux/gammu-smsdrc cp gammu-smsdrc /etc/
Note:
- Before continue to the next step you have to take a look at
/etc/gammu-smsdrc
and edit the file accordingly - Try to identify your modem by running
gammu --config /etc/gammu-smsdrc identify
- You may need to adjust the
port
andconnection
options - Mostly you do not need to change other options
- Do not change the file or directory paths
- Before continue to the next step you have to take a look at
-
Get
gammu_smsd_start
andgammu_smsd_stop
scripts from playSMS package and copy to/usr/local/bin
wget -c https://raw.githubusercontent.com/antonraharja/playSMS/master/contrib/gammu/linux/gammu_smsd_start wget -c https://raw.githubusercontent.com/antonraharja/playSMS/master/contrib/gammu/linux/gammu_smsd_stop cp gammu_smsd_start gammu_smsd_stop /usr/local/bin chmod +x /usr/local/bin/gammu_smsd* ls -l /usr/local/bin/gammu_smsd*
Note:
- Do not forget to set executable permission to those files (
chmod +x
) - You might also want to put
/usr/local/bin/gammu_smsd_start
in/etc/rc.local
to getgammu-smsd
started on boot
- Do not forget to set executable permission to those files (
-
Run
gammu_smsd_start
to startgammu-smsd
gammu_smsd_start
-
Verify if
gammu-smsd
is runningps ax | grep -v grep | grep gammu-smsd
Monitor Gammu smsd log file:
tail -f /var/log/gammu/smsd.log