v3ga

Bits and Blobs

Retrieving SMS messages from Processing on Mac

May 31st, 2008 · 9 Comments

>>> Download processing sketch <<<


Here is a sketch written in Processing that allows you to retrieve in real-time SMS messages from a phone. It uses a MySQL-driven database to store the messages, you’ll need to have one at your disposal (remote or local).

A convenient way to install such a database on your computer is to download and install MAMP, then it’ll be just a matter of drag’n'dropping a folder in your Applications folder, the easy and usual way on Mac.
The package comes also with phpMyAdmin, a popular web-based tool to manage MySQL databases from within your browser.

Softwares/hardwares needed to run this program (assuming you have Processing installed):

  • Mac computer with bluetooth enabled.
  • A mobile phone with bluetooth capabilities (and enabled).
  • Access to a MySQL server. Download and install MAMP if you want to run one on your computer.
  • Cocoa UltraSMS. This software uses bluetooth communication to connect to your phone, and SQL database to save the retrieved messages.
  • MySQL library for Processing by Florian Jenett. The page comes with description to install a MySQL server too.

Here are the few steps to make the program run :

1. Install MySQL and create a database called processingsms.
If you installed MAMP, use phpMyAdmin to perform this operation. This step can be skipped if you have already access to a server.

UltraSMS with MAMP

2. Download and install Cocoa UltraSMS.
Run it and click on the Setup button to modify some parameters. Also, choose your bluetooth-enabled mobile phone in the list.

UltraSMS setup

Note that the screenshot parameters are important and may differ from your MySQL configuration. This paramaters will be used in the Processing sketch to connect to the database :

  • hostname + port. On a default MAMP installation, these are set to 127.0.0.1 and 8889.
  • database. The name of the database that was created in the previous step.
  • username + password. On a default MAMP installation these are both set to root.

3. Click on the Test button to check if UltraSMS can connect to the database. It will also ask you to create two tables (smsins and smsparts), click Ok. The Empty button will remove all the messages already saved.

4. Open Processing IDE, load the ProcessingSMS.pde sketch. In the config tab, change the values of the variables accordingly to your UltraSMS setup.

UltraSMS with Processing Config

5. Click on the Start button of the UltraSMS application. If everything goes well, the status should switch to Connected.
6. Run the program, it should display in the console your sms messages that were inside your phone.
7. Tell a friend to send a message on the connected phone, it should be grabbed and saved in the database !

I recently used this configuration in two installations, one of them being the particles cloud that was shown during the Web Flash Festival.
One of the main drawback I had to face is that the UltraSMS application deconnected when messages were sent massively to the receiving phone. You have then to reconnect manually , which may not be a good thing if this system is to be used in standalone installation. UltraSMS source code is available and there may be a hack to force an automatic reconnection in such situations.
The mobile phone I used for the tests was a Sony Ericsson K600i.

The .zip file containing the Processing sketch also contains a php script to simulate the sending of a SMS into database, which is quite handy when you’re in debugging mode. MAMP is then the tool of choice as it also installs Apache which runs a localhost webserver and lets you execute php scripts.

Any feedback would be very much appreciated. If you have tips, mobile phones that worked / not worked with this configuration, projects using this stuff (or other type of configuration), that would be lovely to share. Thanks!

>>> Download processing sketch <<<

Tags: Processing

9 responses so far ↓

  • 1 julaps // Jun 1, 2008 at 5:12 am

    this is great… look forward to trying this out.

  • 2 v3ga // Jun 1, 2008 at 11:14 am

    Let me know if it works !

  • 3 liquid // Jun 2, 2008 at 8:50 am

    can this working under xp? i’m going to try it,thxs

  • 4 v3ga // Jun 2, 2008 at 10:05 am

    At the moment no as it relies on Cocoa UltraSMS, which a Mac software. The solution would be to find a similar program, ie that retrieves SMS from phone and inject them in a MySQL database.

  • 5 liquid // Jun 3, 2008 at 8:47 am

    ok,thxs! i’m not 2 sure is this working www.Gammu.org

  • 6 JGL // Jun 11, 2008 at 6:53 pm

    Hey All,

    I am currently trying to get UltraSMS working on my intel macbook pro, with my nokia n95.

    I keep getting the error:

    Bluetooth Error:
    Errpr getting rfcomm channel ID from services.

    http://www.tims-weblog.com/projects/cocoa/applications/ultrasms/

    Still works, but the rest of the site is down, doesn’t anyone have Tims email address?

  • 7 v3ga // Jun 12, 2008 at 12:19 am

    Hey Joel,
    this is the error I get after UltraSMS has been running for a while.
    I am not sure, but it seems also to trigger when there are queued messages in the phone waiting to be downloaded. I usually reconnect, and it works ok. But this config is not really viable for autonomous software installation of course.
    Anyway, an alternative can be found as it gets rid of UltraSMS :
    http://jmarinez.typepad.com/blog/2008/05/new-version-of.html
    I didn’t have time to test it, but I guess it is worth trying.

  • 8 eko // Jun 14, 2008 at 5:37 pm

    Bien le nouveau Template :-)

  • 9 Rogo // Jun 24, 2008 at 7:57 pm

    Last Telephone working with ultraSMS.

    I’ve been using a Sony Ericsson Z530i, and it works fine.

Leave a Comment