MIT D-Lab ICT4D Lab Sessions
Note: Please keep this site PRIVATE, just for the class, for
now.
Lab 1: SMS Applications
- Lecture
Slides
- Installation (Part 1):
- Install Java (5+) and Eclipse 3.2+
- Download zip file for ICT4DLabSMS
- Run Eclipse, create new workspace, (e.g., ICT4D)
- Import the zipped project file
- Import ... General .. Existing Projects into Workspace ...
- Select archive file ... (select the ICT4DLabSMS zip file you
downloaded)
- Open Project, make sure everything builds and there are no
errors
- Note: this uses a jar for smslib.jar built to use the comm
library for Windows. To use Linux, you may have to build a new
smslib.jar according to the instructions in smslib.org and use that
.jar file together with other libraries that the Linux version may
require
- Test your installation by running SimpleTest class with
org.ict4dlab.examples.hello.SimpleHello as command-line argument
- Create run configuration
- Click on SimpleTest class in Package Explorer
- Right-click and open Run Dialog
- Right-click on Java Application and select "New"
- make sure org ... SimpleTest class is selected as Main Class
- Change Name of run configuration to "SimpleTest SimpleHello"
- Click on Arguments tab and enter
"org.ict4dlab.examples.hello.SimpleHello" in Program arguments
- Go to Console Window (bottom of Eclipse window), and try it
out
- Using a GSM Modem with SMSLib
(Windows)
- Install Sun Comm
files for Windows
- (Note: the full instructions for installing SMSLib and its
source files are here, but you
do not need to do that for
our simple demos. All you need if you are running under Windows
is to install the javacomm stuff.)
- To install it, unzip the javacomm20-win32.zip file in a
temporary place and do the following copies:
- File comm.jar should go under JDKDIR/jre/lib/ext/
- where JDKDIR is the folder of the JDK you are using
- (in Eclipse, you can right-click on the project, look
at properties, then Java Build Path, and under Libraries, look under
the JRE System Library and see which directory you are getting your
libraries from)
- File javax.comm.properties should go under JDKDIR/jre/lib/
- File win32com.dll should go under JDKDIR/jre/bin/
- If you have a separate JRE directory, do the same copies
for the JREDIR directory!
- Install necessary drivers for your modem (for the Falcom Samba
75, these are in the CD that comes with the modem).
- Plug-in modem (or phone)
- Identify COM port for your modem
- right-click My Computer, choose Manage ..., then Device
Manager, and find COM
port corresponding to your GSM modem
- For Falcom Samba 75 modem we are using in class, the modem
does not show up under COM
& LPT
ports. Look under Modems, then look under Siemens AG WM USB
Modem. Click on the tab that says "Modem", and look at the Port
number on the upper left part of the window. Alternatively, you
can look under Advanced and Advanced Port Settings to see the COM port,
and/or change it, if you need to for some reason.
- Go to SimpleSMSLibAdapter class, and edit the following line in
doIt() accordingly:
- gateway = new
SerialModemGateway("modem.com13","COM13",57600,"Siemens","M75");
- (If you are using other modems/phones, see SMSLib.org or
SMSLib source code for more info on supported options)
- Create a run configuration similar to SimpleTest SimpleHello
above but using SimpleSMSLibAdapter instead of SimpleTest
- Click on SimpleSMSLibAdapter class in Package Explorer
- Right-click and open Run Dialog
- Right-click on Java Application and select "New"
- make sure org ... SimpleSMSLibAdapter class is selected as
Main Class
- Change Name of run configuration to "SimpleSMSLibAdapter
SimpleHello"
- Click on Arguments tab and enter
"org.ict4dlab.examples.hello.SimpleHello" in Program arguments
- Click Apply, then Run
- Run it
- First, it should show modem properties
- Then, a list of unread messages
- Then, it should wait ("sleep")
- Test it by sending text to the modem's phone number using
another phone
- Setting up Kannel
- You need a Linux box (or virtual machine) for this
- Here are some tips for installing ... http://chipmunkninja.com/article/kannelsetup
- Here are my .conf
files
- Modify your modem settings, if necessary to reflect port (this
might not be necessary if you're using the Falcom Samba 75)
- Testing Kannel and Demoing PHP
at the same time
- Test your Kannel installation by running it and texting (from a
separate phone) "hellophp world"
- This should make Kannel invoke the php script on my CSAIL web
page
- Here is the source
of
my php script (rename it to hello.php)
- You can add your own entries here for your own php scripts on
your own urls
- Using SimpleGETAdapter
- Get the IP address of the machine that will run
SimpleGETAdapter and ...
- Edit smskannel.conf
- look for the "group = sms-service" parts
- Edit get-url to accordingly
- Get the IP address of the machine running Kannel
- Edit the hardcoded info in SimpleGETAdapter accordingly
- Create a run configuration for SimpleGETAdapter as before
- Run it (Kannel should also be running at the same time)
- Test it with a separate phone
- Other Tests
- The SendTest example demonstrates using the SMSSender to send
messages instead of simply returning a response to an incoming
request. In this example, we return no response (null, or nothing
in the case of the servlet-based adapter), but before we do that, we
make a call to the smsSender.
- This has been tested with all the adapters tested above, and it
works, assuming network conditions (including firewalls, etc.) allow
it. (In particular, in the case of SimpleGETAdapter machine, the
adapter must be able to issue a GET request to the Kannel machine.)
- Links to Software
- Other Useful/Interesting Links
- TODO (Contact me if you are interested
in helping out)
- develop open source library for MMS handling using GSM modem /
phones
- develop modem adapter for SMSLib and/or Kannel for Nokia 2610
- this should be based on FBUS, but for some reason reading new
messages doesn't work on the 2610
- Look into CDMA systems(?)
created and maintained by:
Luis F. G. Sarmenta
Last update: Feb. 2008