Hello,
As promised,here you have a guide that shows:
How to compile SMStools3 for OpenWRT - Tested with Barrier Breaker
1) Create a build root environment as described here: http://wiki.openwrt.org/doc/howto/buildroot.exigence
I used a Ubuntu PC to do it
2) Extract this file to the package/utils directory. The Makefiles and the directory structure is the correct one.
After this, you should have the following directory structure:
xxx@xxx:(your-build-root-path)$ ls -R
.:
files Makefile package.sh patches src
./files:
examples scripts
./files/examples:
language-ISO-8859-15.fi operator_logo1.sms README received_sms.sms send_sms_unicode.sms smsd.conf.full smsd.conf.non-root
language-UTF-8.fi operator_logo2.sms received_report.sms send_sms.sms smsd.conf.easy smsd.conf.net
./files/scripts:
callhandler email2sms eventhandler-utf-8 hex2bin load_balancing.sh pkill regular_run sms2html sms2xml smsevent smstest.php unicode2sms
checkhandler-utf-8 eventhandler_report forwardsms hex2dec mysmsd README sendsms sms2unicode sms3 smsresend sql_demo
./patches:
001-smsd.patch 010-makefile.patch
./src:
alarm.c blacklist.c cfgfile.c charset.c extras.c locking.c logging.c Makefile modeminit.h pdu.h smsd_cfg.c stats.c version.h whitelist.h
alarm.h blacklist.h cfgfile.h charset.h extras.h locking.h logging.h modeminit.c pdu.c smsd.c smsd_cfg.h stats.h whitelist.c
3) Go to the builroot root directory and run make menuconfig. You'll find the smstools3 option under utilities. Select it, and exit menuconfig.
Note that you may also need to select the correct architecture for your router. My router is a TL-WR1043N/ND so I had to select ar71xx in "make menuconfig".
4) Run make, and wait for some time (hours) to have all of it compiled.
5)You should find the installation package here: (your-build-root-path)/openwrt/bin/ar71xx/packages/base/smstools3_3.1.15-2_ar71xx.ipk
If you didn't want/weren't able to compile and trust pre-compiled binaries (I won't advise it) here you have the compiled installation file ready to install on a TL-1043ND
6) Copy this file to your router and install it with "opkg install smstools3_3.1.15-2_ar71xx.ipk"
I realised that running SMSTools3 as daemon was having some problems creating the log directories, and therefore fails to start, but if created manually it works.
Because of this, I created a workaround that works fine:
7) Create a file named /bin/smstools_wrapper and copy the code below to it:
#!/bin/sh
#Wrapper - creates the directories and log files before starting
# as it seems they arent saved during reboots
mkdir /var/log/smsd_stats
mkdir /var/spool/sms
mkdir /var/spool/sms/outgoing
mkdir /var/spool/sms/failed
mkdir /var/spool/sms/incoming
mkdir /var/spool/sms/checked
mkdir /var/spool/sms/sent
mkdir /var/run/smstools
#calls smsd
/usr/bin/smsd
8) In order to have it started automatically add "/bin/smstools_wrapper" to the file /etc/rc.local
And that's it! After these steps you should have a SMSTools3 daemon running in your OpenWRT router.
Note that you'll need to fill in the configuration file in order to match your SMS device, like you would do in any other linux box.
I add my config file just for reference. It works on an Huawei USB stick.
root@Mojito:~# cat /etc/smsd.conf | grep -v "#"
devices = GSM1
outgoing = /var/spool/sms/outgoing
checked = /var/spool/sms/checked
incoming = /var/spool/sms/incoming
logfile = /var/log/smsd.log
infofile = /var/run/smstools/smsd.working
pidfile = /var/run/smstools/smsd.pid
outgoing = /var/spool/sms/outgoing
checked = /var/spool/sms/checked
failed = /var/spool/sms/failed
incoming = /var/spool/sms/incoming
sent = /var/spool/sms/sent
stats = /var/log/smsd_stats
receive_before_send = no
autosplit = 3
eventhandler = /bin/sms-received
[GSM1]
device = /dev/ttyUSB1
incoming = yes
baudrate = 9600
Can anyone be able to add this to the OpenWRT repositories so everyone could benefit from it?
Thanks and good luck!
Jabss
(Last edited by jabss on 8 Nov 2014, 20:19)