Skip to content
Markus Neuhold edited this page Oct 13, 2015 · 30 revisions

On systems running Linux

The following manual installation was tested on Debian8.

Software requirement

For all components

  • Python3 (Debian8: sudo apt-get install python3)
  • Python3-pip (Debian8: sudo apt-get install python3-pip)
  • Git (Debian8: sudo apt-get install git)
  • pkg-config (Debian8: sudo apt-get intall pkg-config)
  • cmake (Debian8: sudo apt-get install cmake)
  • zlib1g-dev (Debian8: sudo apt-get install zlib1g-dev)
  • libxml2-dev (Debian8: sudo apt-get install libxml2-dev )
  • libxslt-dev (Debian8: sudo apt-get install libxslt1-dev )

For PID only

  • USB-modeswitch (Debian8: sudo apt-get install usb-modeswitch)
  • If you plan to run the PID without root privileges change the owner of the usb-device in usb-modeswitch rules (Debian8: sodo vi /lib/udev/rules.d/40-usb_modeswitch.rules) Add OWNER="username" to the line starting with KERNEL=="ttyUSB*", OWNER="username", ATTRS.....
  • Gammu in Version 1.34.0 or higher (Debian8: get the code and compile it: )

Compile Gammu 1.36.6 on Debain8

  • Using verison 1.36.6 or higher has more throughput if you decide to use the smsgateway in wrapped mode.
  • sudo su
  • wget "http://dl.cihar.com/gammu/releases/gammu-1.36.6.tar.bz2"
  • tar -jxvf gammu-1.36.6.tar.bz2
  • cd gammu-1.36.6/
  • ./configure
  • make
  • make install
  • ldconfig

Python3 PIP packages required

  • lxml (Debian8: sudo pip3 --proxy http://<urlto_proxy>:<port> install lxml
  • ws4py (Debian8: sudo pip3 install ws4py) Raspbain: Error at yield from self... is ok
  • pycrypto (Debian8: sudo pip3 install pycrypto)
  • cherrypy (Debian8: sudo pip3> install cherrypy)
  • ldap3 (Debian8: sudo pip3 install ldap3) Raspbain: Error at datachunk = u'butternut squash' ... is ok
  • python-gammu (Debian8: sudo pip3 install python-gammu

Installing smsgateway software

  • To install the smsgateway software just git clone it:
    git clone https://github.com/n0r1sk/smsgateway.git
  • Afterwards change the directory to the smsgateway folder. Inside you find the install-initd-systemd.py Python script. This script will install a Debian compatible System init script or a Systemd service unit. Run it with root privileges. (Debian/Raspbian/Arch: sudo ./install-initd-systemd.py)
  • Verify the Gammu configuration See the configuration help in the smsgateway wiki.
  • After the installation you have to configure the smsgateway for your needs. At minimum you have to configure the modemlist key. In that case has to be set. See the configuration help in the smsgateway wiki.

Starting the smsgateway software

After installation you can start the smsgateway software by using the smsgw.py Python script. You could run smsgw.py -h to show the help message:

# ./smsgw.py
usage: smsgw.py [-h] module

SMS-Gateway start script.

positional arguments:
  module      module to start, one of wis.py, pis.py, pid.py

optional arguments:
  -h, --help  show this help message and exit

Every SMS-Gateway module (WIS, PIS, PID) must be started on its own. To start all modules you can type:

# ./smsgw.py wis.py
# ./smsgw.py pis.py
# ./smsgw.py pid.py

The software will run in the background. You have to kill the equivalent process via a manual kill.

With System V init.d or Systemd

To install the SMS-Gateway as system service you can start the install-initd-systemd.py script. The script will guide you through the creation process of Debian compatible System V init.d scripts or general Systemd units.

After run, the script will provide additional information. For example a Systemd install run:

# ./install-initd-systemd.py
Are you using Debin initd or general systemd (initd | systemd)? [systemd]?
Specify systemd service unit install directory or initd directory [/etc/systemd/system]:
Specify the the daemon user the smsgateway run with [smsgw]:
Which module should be installed (wis | pis | pid | all)? [all]:
To enable the service unit use:
	systemctl enable smsgw-wis.service
To start the service unit use:
	systemctl start smsgw-wis.service
To enable the service unit use:
	systemctl enable smsgw-pis.service
To start the service unit use:
	systemctl start smsgw-pis.service
To enable the service unit use:
	systemctl enable smsgw-pid.service
To start the service unit use:
	systemctl start smsgw-pid.service

Getting ready for production

To get up and running a productive environment you have at least to change the important default sections in the configuration file. The important sections in the configuration are written in bold text. CHANGE THEM! Otherwise you will face mature security problems!

Clone this wiki locally