Ikhwan Saputera

Setiap Waktu adalah Belajar, Setiap Tempat adalah Sekolah, Setiap Orang adalah Guru

Monday, April 08, 2019

How to Install Gammu on Ubuntu 18.04

1. Install gammu and also gammu-smsd using the terminal, make sure it's connected to the internet. Enter commands in the terminal:

sudo apt-get install gammu gammu-smsd

 

2. Open a new tab in the terminal, then enter the command:

dmesg | grep tty

Later a port that will be connected to the modem will appear. If it doesn't appear, maybe the modem hasn't been plugged in or you need to install the modem driver.
This step aims to see whether the modem has been running properly on the computer or not.
 
3. After successfully installing Gammu. Now we are setting the gammu. Enter the command:

gammu-config
we configure it like this picture

4. If we already know the port that is connected to the modem, fill in the gammu configuration. Namely in the section:

port = / dev / ttyUSB0

ttyUSB0 is adjusted to the results of dmesg | grep tty.
We can leave the connection with at19200, or at115200, or adjust it to the type of modem.

connection = at115200

Our logfile is filled with the path where we want to store the log (or record) of gammu. Suppose we put it in / var / log / gammulog

logfile = / var / log / gammulog

For logformat we just select textall. Later, the record of the gammu application will be in the form of text.

logformat = textall


After that save, and the gammu configuration will be saved in the .gammurc file on the user's home folder that we are using.

~ /. gammurc

5. We turn off the gammu-smsd service first. Why ? Because if the service is running, we cannot use the gammu command. Enter the command:

sudo /etc/init.d/gammu-smsd stop

6. We check whether your gamm setting with the modem is correct or not. Enter the command:

sudo gammu --identify

If the identity of the modem that has stuck on our computer appears, the setting is complete.
 
 

 7. We check by trying to send an SMS using the command sudo gammu sendsms TEXT -text nohandphone "fill in the sms". Example:

sudo gammu sendsms TEXT +628135082xxx -text "this is the gammu message from UBUNTU"

If you successfully send an sms, it means that all settings are successful. But if we fail to send an sms, check the port settings in the Gammu configuration. Or repeat the above method from dmesg | grep tty and don't forget to change the port. If all of the ports we have already tried but still fail, try changing the connection.

8. Run the gammu service again

sudo /etc/init.d/gammu-smsd start



No comments:

Post a Comment