sudo apt-get install gammu gammu-smsdCreate a gammu configuration file /etc/gammurc, whose contents look like this
[gammu]Test that the SMS functionality by sending a message like this
port=/dev/ttyUSB0
connection=at9600
$ echo "Test message"|gammu sendsms TEXT <Phone Number>Setting up the SMS Daemon
A prerequisite is that a MySQL server is installed (either local or remote). Create the necessary tables in the database by running the SQL statements in /usr/share/doc/gammu/examples/sql/mysql.sql.gz. Create a gammu-smsd configuration file /etc/gammu-smsdrc
[gammu]Now test that the daemon is receiving the messages by sending an SMS to the number associated with the SIM in the modem. Verify that the message is written into the table named "Inbox". Similarly you can send a message out by creating a row in the "Outbox" table.
port = /dev/ttyUSB0model =
connection = at19200
synchronizetime = yes
logfile =
logformat = nothing
use_locking =
gammuloc =
[smsd]
debuglevel = 255
logfile = smsd.log
Service = mysql
User = root
Password = <Password>
Database = smsd
Notes:
- You can inject sms into the daemon from the command line with gammu-smsd-inject example:
- echo "All your base are belong to us" | gammu-smsd-inject TEXT 123456
- Gammu-smsd also supports other backends like txt files in a specified folder
- To use SMSD as a daemon, you might want to use the init script which is shipped with Gammu in contrib/init directory. It is not installed by default, either install it manually or check INSTALL file for instructions.
No comments:
Post a Comment