HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   SMS Gateway Ubuntu server 9.10 Playsms Smstools3. (http://www.howtoforge.com/forums/showthread.php?t=47641)

letsharehowto 29th July 2010 17:04

SMS Gateway Ubuntu server 9.10 Playsms Smstools3.
 
5 Attachment(s)
Today I will tell you howto setup box which run SMS Gateway with Ubuntu server 9.10, playsms and smstools3.

My box: Intel P4
My cell phone: picture

Create new box with Ubuntu server 9.10. If you don't know, you can google

Softwares install: only choose SSH

Install finished ->Reboot->Logon then active root account, code:

sudo passwd root

Logout then login with root and we later we do everything with root too.
Upgrade box, code:

apt-get update
apt-get upgrade -y

Install some software, code:

apt-get install -y apache2 mysql-server php5 php5-cli php5-cgi php-pear php-db phpmyadmin make gcc sendmail lynx

When box ask password, I choose 111111 for all
Add playsms user, code:

adduser playsms

Then, code:

mkdir -p /var/www/playsms
mkdir -p /var/spool/playsms
mkdir -p /var/log/playsms
chown -R www-data /var/www/playsms
chown -R www-data /var/spool/playsms
chown -R www-data /var/log/playsms
wget http://sourceforge.net/projects/play...ar.gz/download

Unzip, code:

tar -zxvf playsms-0.9.4.tar.gz -C /usr/local/src
cd /usr/local/src/playsms-0.9.4/web
cp -rR * /var/www/playsms
chown -R www-data /var/www/playsms
mysqladmin -u root -p create playsms

When box ask password, type: 111111
Code:

mysql -u root -p playsms < /usr/local/src/playsms-0.9.4/db/playsms.sql

When box ask password, type: 111111
Code:

cd /var/www/playsms
cp config-dist.php config.php
nano config.php

Please find rootpassword (on line 8) and replace with 111111. Save and exit.
Code:

cd /usr/local/src/playsms-0.9.4/bin
cp playsmsd playsmsd.php playsmsd_start /usr/local/bin/
cp playsms /etc/default/
nano /etc/init.d/rc.local

Add:
/usr/local/bin/playsmsd_start
on the bottom of the file (before exit if theres exit command). This way playsmsd_start will start automatically on boot. Save and exit.

Get static for NIC, code:

nano /etc/network/interfaces

Delete all and replace with:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.66
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Edit /etc/resolv.conf, code:

nano /etc/resolv.conf

Delete all and replace with:

nameserver 192.168.1.1

Reboot, code:

reboot

Login with root, download file, code:

wget http://smstools3.kekekasvi.com/packa...3-3.1.3.tar.gz

Unzip, code:

tar -zxvf smstools3-3.1.3.tar.gz -C /usr/local/src
cd /usr/local/src/smstools3
make

Code:

make install

Code:

cd /usr/local/src/playsms-0.9.4
cp contrib/smstools/smsd.conf /etc/
nano /etc/smsd.conf

Please find ttyUSB0 (on line 27) and replace with ttyACM0. Save and exit.

Code:

mkdir -p /var/spool/sms/checked
mkdir -p /var/spool/sms/failed
mkdir -p /var/spool/sms/incoming
mkdir -p /var/spool/sms/outgoing
mkdir -p /var/spool/sms/sent
mkdir -p /var/log/sms
chown -R www-data /var/spool/sms
update-rc.d sms3 defaults
reboot

Browse http://localhost/playsms/ and login using default administrator user
username: admin
password: admin

click Gateway, click Manage smstools, click (click here to active)

Reboot box, code:

reboot

Enjoy

Thanks:

http://www.howtoforge.com
http://www.ubuntu.com
http://playsms.sourceforge.net
http://smstools3.kekekasvi.com

More picture at: http://picasaweb.google.com/116366725840175897341

corysquires 29th August 2010 19:40

What model phone are you using? is there a hardware compatibility list somewhere with phones / modems that are compatible... Excellent article!

sjau 30th August 2010 17:22

two things

(1) rather use this to submit the howto: http://www.howtoforge.com/add_howto and format it nicely

(2) use Ubuntu 10.04 - it's the latest LTS release

letsharehowto 31st August 2010 05:35

Thank you :)

To corysquires:

This is my phone:

http://www.amazon.com/Motorola-SLVR-.../dp/B000ELOPZ6

And V3 works good too:

http://www.amazon.com/Motorola-V3-Un.../dp/B0009FCAJA

I try Nokia but don't work. I not yet try another brand.

To Onn:

Sorry, I take long time. I'm too busy.

And this is may computer:

http://www.howtoforge.com/forums/showthread.php?t=41911

If do not run, you try.

Code:

lsusb
My quote:

Quote:

root@katy:~# lsusb
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 046d:c00c Logitech, Inc. Optical Wheel Mouse
Bus 002 Device 002: ID 22b8:4902 Motorola PCS Triplet GSM Phone (AT)
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
You will see your phone on list (Motorola PCS Triplet GSM Phone (AT)).

Code:

ls /dev/tty*
My quote:

Quote:

root@katy:~# ls /dev/tty*
/dev/tty /dev/tty19 /dev/tty3 /dev/tty40 /dev/tty51 /dev/tty62
/dev/tty0 /dev/tty2 /dev/tty30 /dev/tty41 /dev/tty52 /dev/tty63
/dev/tty1 /dev/tty20 /dev/tty31 /dev/tty42 /dev/tty53 /dev/tty7
/dev/tty10 /dev/tty21 /dev/tty32 /dev/tty43 /dev/tty54 /dev/tty8
/dev/tty11 /dev/tty22 /dev/tty33 /dev/tty44 /dev/tty55 /dev/tty9
/dev/tty12 /dev/tty23 /dev/tty34 /dev/tty45 /dev/tty56 /dev/ttyACM0
/dev/tty13 /dev/tty24 /dev/tty35 /dev/tty46 /dev/tty57 /dev/ttyS0
/dev/tty14 /dev/tty25 /dev/tty36 /dev/tty47 /dev/tty58 /dev/ttyS1
/dev/tty15 /dev/tty26 /dev/tty37 /dev/tty48 /dev/tty59 /dev/ttyS2
/dev/tty16 /dev/tty27 /dev/tty38 /dev/tty49 /dev/tty6 /dev/ttyS3
/dev/tty17 /dev/tty28 /dev/tty39 /dev/tty5 /dev/tty60
/dev/tty18 /dev/tty29 /dev/tty4 /dev/tty50 /dev/tty61

You will see /dev/ttyAMC0 on list.

Make sure your wire is good.

RUN SMS SERVER ON REAL COMPUTER. DO NOT RUN ON VMWARE.

When you send SMS, box send immediately. When recived SMS, box wait about 3 to 20 seconds.

This box help me alot to take care my bussiness. Example: when I have disscount, I can send SMS to my custommer; when I fix finish their something, I can tell them; when they want to know my price, they send SMS to box: : "PR xxxx" (with xxxx is my service) , box will automatic send back to them my prices which I set...

Can you try again. Good luck.

To sjau:

I will try :). Thanks.

PS: When I have time, I will tell you how to setup box which remind you via email when he recived SMS.

corysquires 1st September 2010 02:45

Moto Drivers
 
Hi I plug in the phone to USB and Ubuntu does not recognize, are there additional drivers to load?

letsharehowto 1st September 2010 05:29

1 Attachment(s)
You don't need more drive. Make sure everything clean and stick together.
When you plug phone into box, phone be charging too.
This is my wires: (picture below)

When I used the cheap one, Ubuntu does not recognize:
http://www.thegioididong.com/DTDD/Ph...780&BranchId=0
I don't know how about the expensive one and another phone.
Your phone same my phone?
Good luck!

corysquires 1st September 2010 05:37

Quote:

Originally Posted by corysquires (Post 238141)
Hi I plug in the phone to USB and Ubuntu does not recognize, are there additional drivers to load?

I believe my Mototorola L6i is not compatable... :mad:

corysquires 15th September 2010 09:22

tried SLVR L7 and it does not work either :confused:

pras 1st November 2010 19:57

Hi I tried with the Motorola RAZR.... without success...
I run the lsusb and I got

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 22b8:4902 Motorola PCS Triplet GSM Phone (AT)
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 058f:6362 Alcor Micro Corp. Hi-Speed 21-in-1 Flash Card Reader/Writer (Internal/External)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I try to send sms without success....

any suggestion please.....?

Thanks

letsharehowto 3rd November 2010 13:35

SMS Gateway with Ubuntu server 10.10, playsms and smstools3.
 
1 Attachment(s)
Today I will tell you howto setup box which run SMS Gateway with Ubuntu server 10.10, playsms and smstools3.

My box:

-Intel(R) Pentium(R) Dual CPU E2200 @ 2.20GHz, 2 cores
-Memory: 2G

My cell phone:

- http://www.amazon.com/Motorola-SLVR-.../dp/B000ELOPZ6
- And this phone works good too: http://www.amazon.com/Motorola-V3-Un.../dp/B0009FCAJA

We have 4 steps:

-Setup Ubuntu server 10.10 box.
-Install Playsms.
-Install Smstools3.
-Config Playsms.

1/- Setup Ubuntu server 10.10 box:

-Create new box with Ubuntu server 10.10. If you don't know, this link will help you: http://www.howtoforge.com/perfect-se...at-ispconfig-3

-When box get dhcp IP address, press Cancel (remember do quickly), then input IP manual. In my case, my IP is: 192.168.1.66. Netmask: 255.255.255.0. Gateway: 192.168.1.1. Name server address: 192.168.1.1.

-When box ask Host name, I choose: cat.mouse. (We use Sendmail to send email to remind us when box recieves sms. And if you don't want Ubuntu startup slows down at Starting Mail Transport Agent (MTA) sendmail you have to choose long hostname, example: "cat.mouse". If you choose short name: "catmouse", box boot up, box shutdown and box remind you when sms come is very slow.)

-When box ask software to install, only choose OpenSSH.

Finish install, reboot box.

Logon and active root account:

Code:

sudo passwd root
Logout then login with root and later do everything with root too.

Upgrade box:

Code:

apt-get update && apt-get upgrade -y
Reboot box:

Code:

reboot
2/- Install Playsms:

Logon with root and install some softwares:

Code:

apt-get install -y apache2 mysql-server php5 php5-cli php5-cgi php-pear php-db phpmyadmin libapache2-mod-php5 gcc sendmail
When box ask password, I choose 111111 for all.

( http://picasaweb.google.com/letshare...tu1010Playsms# )
Add playsms user:

Code:

adduser playsms
Create playSMS web root, spool and log and set ownership to user www-data:

Code:

mkdir -p /var/www/playsms
mkdir -p /var/spool/playsms
mkdir -p /var/log/playsms
chown -R www-data /var/www/playsms
chown -R www-data /var/spool/playsms
chown -R www-data /var/log/playsms

Download Playsms:

Code:

wget http://biznetnetworks.dl.sourceforge.net/project/playsms/playsms/Version%200.9.5.1/playsms-0.9.5.1.tar.gz
Unzip:

Code:

tar -zxvf playsms-0.9.5.1.tar.gz -C /usr/local/src
Copy files and directories inside 'web' directory to playSMS web root and set ownership again to user www-data:

Code:

cd /usr/local/src/playsms-0.9.5.1/web
cp -rR * /var/www/playsms
chown -R www-data /var/www/playsms

Setup database:

Code:

mysqladmin -u root -p create playsms
When box ask password, type: 111111 then press Enter.

Code:

mysql -u root -p playsms < /usr/local/src/playsms-0.9.5.1/db/playsms.sql
When box ask password, type: 111111 then press Enter.

Copy config-dist.php to config.php and edit config.php:

Code:

cd /var/www/playsms
cp config-dist.php config.php

Fill required field with coutious in config.php file:

Code:

nano config.php
Please find rootpassword (on line 8) and replace with 111111 then save and exit.

Enter bin directory, copy playsms, playsmsd, playsmsd.php, playsmsd_start to directory default:

Code:

cd /usr/local/src/playsms-0.9.5.1/bin
cp playsmsd playsmsd.php playsmsd_start /usr/local/bin/
cp playsms /etc/default/

Make playsmsd_start will start automatically on boot:

Code:

nano /etc/init.d/rc.local
Add bellow quote into the bottom of the file (before exit if theres exit command) then save and exit:

Quote:

/usr/local/bin/playsmsd_start
3/- Install Smstools3:

Download Smstools3:

Code:

wget http://smstools3.kekekasvi.com/packages/smstools3-3.1.14.tar.gz
Unzip:

Code:

tar -zxvf smstools3-3.1.14.tar.gz -C /usr/local/src
Installing smstools3:

Code:

cd /usr/local/src/smstools3
make
make install

Back to playSMS source directory, copy smsd.conf from contrib/smstools/ to /etc:

Code:

cd /usr/local/src/playsms-0.9.5.1
cp contrib/smstools/smsd.conf /etc/

Plug cellphone into box. Make sure everything clean and stick together. When you plug phone into box, phone be charging too. Make sure Ubuntu recognize cellphone:

Code:

lsusb
In my case, quote like this:

Quote:

Bus 008 Device 002: ID 22b8:4902 Motorola PCS Triplet GSM Phone (AT)
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Findown where usb port cellphone use:

Code:

ls /dev/tty*
In my case, quote like this:

Quote:

/dev/tty /dev/tty19 /dev/tty3 /dev/tty40 /dev/tty51 /dev/tty62
/dev/tty0 /dev/tty2 /dev/tty30 /dev/tty41 /dev/tty52 /dev/tty63
/dev/tty1 /dev/tty20 /dev/tty31 /dev/tty42 /dev/tty53 /dev/tty7
/dev/tty10 /dev/tty21 /dev/tty32 /dev/tty43 /dev/tty54 /dev/tty8
/dev/tty11 /dev/tty22 /dev/tty33 /dev/tty44 /dev/tty55 /dev/tty9
/dev/tty12 /dev/tty23 /dev/tty34 /dev/tty45 /dev/tty56 /dev/ttyACM0
/dev/tty13 /dev/tty24 /dev/tty35 /dev/tty46 /dev/tty57 /dev/ttyS0
/dev/tty14 /dev/tty25 /dev/tty36 /dev/tty47 /dev/tty58 /dev/ttyS1
/dev/tty15 /dev/tty26 /dev/tty37 /dev/tty48 /dev/tty59 /dev/ttyS2
/dev/tty16 /dev/tty27 /dev/tty38 /dev/tty49 /dev/tty6 /dev/ttyS3
/dev/tty17 /dev/tty28 /dev/tty39 /dev/tty5 /dev/tty60
/dev/tty18 /dev/tty29 /dev/tty4 /dev/tty50 /dev/tty61
Config smsd.conf:

Code:

nano /etc/smsd.conf
Please find ttyUSB0 (on line 27) and replace with ttyACM0 then save and exit.

Create some important directories for smstools3:

Code:

mkdir -p /var/spool/sms/checked
mkdir -p /var/spool/sms/failed
mkdir -p /var/spool/sms/incoming
mkdir -p /var/spool/sms/outgoing
mkdir -p /var/spool/sms/sent
mkdir -p /var/log/sms

Change permissions on some directories so that web server user can write files on it:

Code:

chown -R www-data /var/spool/sms
To get smstools3 running automatically on every boot, type this command:

Code:

update-rc.d sms3 defaults
Reboot box:

Code:

reboot
4/- Config Playsms:

On client open web browser, at address type:

Login using default administrator user:

( http://picasaweb.google.com/letshare...97544327981986 )

username: admin
password: admin

( http://picasaweb.google.com/letshare...97526305094706 )

Then click Gateway, click Manage smstools, click (click here to active)

( http://picasaweb.google.com/letshare...97476944974002 )

Everything keep default.

Logon server and reboot box:

reboot

Now you can send and recived sms with Playsms. Good luck!

Thanks:

http://www.howtoforge.com
http://www.ubuntu.com
http://playsms.org
http://smstools3.kekekasvi.com

PS:
- I do everything with real computer not "cloud" computer.
- When I send sms, box wait from 3 to 10 second then sms will be send.
- When I recived sms, box wait from 3 to 10 second then sms will be recived.
- For more information you can visit this link: http://tech.groups.yahoo.com/group/playsms-devel/

More picture at: http://picasaweb.google.com/116366725840175897341


All times are GMT +2. The time now is 17:45.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.