Setting up an SMS server on Ubuntu 21.04 using Minicom

Setting up an SMS server on Ubuntu 21.04 using Minicom

I have an SMS booking app running on Ubuntu and will be setting up SMS autoresponder using a HUAWEI Mobile Modem E1550.


Remove PIN from the SIM card

SIM card has to be without a PIN so if you have purchased a prepaid SIM card that has PIN enabled, you should follow instructions from your provider on how to disable the PIN.

After the PIN is disabled, put the SIM card into the modem and plug it into a Windows device.

Huawei Modem Unlocker

Download the Huawei Modem Unlocker app and follow the instructions from this article to unlock the modem so that it can be used with any service provider.

Choose DISABLE CD and click on UNLOCK button.

modem unlocker huawei - Setting up an SMS server on Ubuntu 21.04 using Minicom

Install on Ubuntu

Before starting, make sure that you already have the HUAWEI Mobile Modem E1550 plugged into the server running Ubuntu 18.04, it should be plugged in the first USB slot.

Run apt-get update and install the following packages

sudo apt-get install -y minicom
sudo apt-get install -y smstools
sudo apt-get install -y cifs-utils

Setup files

Copy app configuration files using WinSCP to  /home/user/

  • smsd.conf (configuration file for the USB-modem)
  • sendsms   (file that actually sends SMS)
  • get.sh    (script that mounts SMS’s from Windows to Linux device)
  • getsms.sh (just starts the get.sh file in background)

then copy them to appropriate locations:

sudo cp -r /home/user/smsd.conf /etc/
sudo cp -r /home/user/get.sh /root/
sudo cp -r /home/user/smsget.sh /root/
sudo cp -r /home/user/sendsms /usr/local/bin/sendsms

and give execute permissions:

sudo chmod +x /root/smsget.sh
sudo chmod +x /root/get.sh
sudo chmod +x /usr/local/bin/sendsms

Edit rc.local file so that scripts and SMS service are started automatically with system boot:

sudo nano /etc/rc.local

Content:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/usr/sbin/smsd
nohup /root/smsget.sh &
exit0

Setup Minicom service

minicom -s

In the menu choose serial port setup then A/E:

  • “A –    Serial Device      : /dev/ttyUSB0”
  • “E –    Bps/Par/Bits       : 115200 8N1”

test if the minicom works by typing “AT” – should give “OK”


Test if SMS works

Try sending emails from the terminal with the command

sendsms +38163NUMBER "MESSAGE TEXT"

replace:

  • +38163 with your local area code
  • NUMBER with recipients phone number
  • MESSAGE TEXT with the text to be sent
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.