v3ga Bits and Blobs

Retrieving SMS messages from Processing on Mac

>>> 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):

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 :

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 <<<


26 Comments

this is great… look forward to trying this out.

Posted by julaps on 1 June 2008 @ 5am

Let me know if it works !

Posted by v3ga on 1 June 2008 @ 11am

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

Posted by liquid on 2 June 2008 @ 8am

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.

Posted by v3ga on 2 June 2008 @ 10am

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

Posted by liquid on 3 June 2008 @ 8am

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?

Posted by JGL on 11 June 2008 @ 6pm

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.

Posted by v3ga on 12 June 2008 @ 12am

Bien le nouveau Template :-)

Posted by eko on 14 June 2008 @ 5pm

Last Telephone working with ultraSMS.

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

Posted by Rogo on 24 June 2008 @ 7pm

UltraSMS as far as connectivity is working fine BUT when the timestmp (as it appears in the database table) entry comes into the MySQL database it’s in a long string: 1220378575 now this was received on 02-09-2008 around 2pm. Any ideas on what the issue could be? The field in MySQL is varchar with a length of 40, I have tried changing it to datetime and timestamp but neither makes a difference. I then thought it could be the time format on my phone so I changed it to display as 2008-09-02. No luck. I then tried a friends Sony phone, he has the K810i (I think) and that did the same. mine a C902, I thought it could have been to new but maybe not.

Any ideas would be appreciated.

Cheers

Ken

Posted by Ken Rainforth on 2 September 2008 @ 3pm

Hello Ken,
sorry for the delay in answering this. Timestamp is in fact a number representing the elapsed seconds since the 1st of January 1970. Check out this article : http://en.wikipedia.org/wiki/Unix_time
Also, a tiny tool (in French) for converting back and forth :
http://www.timestamp.fr/
Hope this helps ! Also, do not hesitate to post your project using ultraSMS here.

Posted by v3ga on 14 September 2008 @ 10pm

I did one using SMSLib, pure Java and serial port implementation. You can have a look at http://www.bryanchung.net/?p=293

Thanks.

Bryan

Posted by Bryan Chung on 4 October 2008 @ 4pm

Hi,

Thanks for the response. I bought a Sony phone and it’s working great. I also found a script to convert the unix time stamp in to yyyy-mm-dd 00:00:00 so it’s all working now.

Just one thing though, I’m not sure if this is to do with an issue with the software or time zones I’m working with. I’m in Saudi Arabia and we are +3 ahead of the UK. My server is set up to be +3 hours ahead also. Around half of the messages that come in to the database table are around 7 hours ahead. Let’s say a normal message would come through at 10:23:01 today and I get another message comes through at 10:24:43 (just for instance), the first one converts the unix time stamp to 10:23:01 but the second one (remember this is just random), this will come through as 15:24:43, not sure why it’s doing this.

The message centre used for all the texts we receive is the same on here in Saudi, the server is setup for Saudi time wise and the phone has the correct time for Saudi.

Just not sure why it may add some hours or bring in the time stamp differently on certain messages.

Im going to do a test from a single phone in our office so I can see the result immediately, I’ll update you n how I go.

Again, thanks for the response and if you have any suggestions about the issue I face then I’d be pleased to hear your suggestions.

Cheers

Ken

Posted by Ken Rainforth on 5 October 2008 @ 10am

hello I ask myself if it works with the present version of processing 1.0.1, and if not that changes I must do so that it works. furthermore probe with version 0148 and appears ” the package”de” does not exist, you might be a missing library “

Posted by oktopus on 18 December 2008 @ 11pm

Thanks a million for posting this. I’m doing a project and this has helped me do it easier than I previously thought. Do you know were I can get the processing file as the link has expired.

Posted by Gingerbhoy on 27 October 2009 @ 12pm

Oups sorry, quick cleaning of my server. The link is active again. Let me know what you came up with !

Posted by v3ga on 28 October 2009 @ 2pm

Got it, thanks again. You dont know how much research you have saved me

Posted by Gingerbhoy on 29 October 2009 @ 4pm

Hello there!
I have a question: is your script the same as it shown on this website: http://www.bryanchung.net/?p=293 ?
Unfortunately i can not download your scipt, because the link isn’t working anymore…

Posted by Loveduster on 14 January 2010 @ 4pm

No it’s not the same. The link is fixed now. Thanks for noticing !

Posted by v3ga on 14 January 2010 @ 4pm

Hello,
Ultra sms and mamp are working fine but in processing I get this failiornotice:
” the package”de” does not exist, you might be a missing library “
Can you tell me what I’m doing wrong?

Posted by Loveduster on 24 January 2010 @ 2pm

[...] Retrieving SMS messages from Processing on Mac | v3ga [...]

Posted by Processing links | BLOG.KAZAH on 7 February 2010 @ 9am

Yes,
FIRST
It seems this link
http://www.bezier.de/mysql/ is wrong but instead you must go here
http://bezier.de/processing/libs/sql/

SECOND
Unfortunately when you launch processingSMS.pde the package de.bezier does not exist. Should it needs to be replaced by SQLibrary or something?

Posted by drik on 3 December 2010 @ 9am

Yep’ the code source was not updated to work with this “new” version of mySQL processing lib. So you should replace the “import” with the one that is in the menu once you installed the package.

Posted by v3ga on 3 December 2010 @ 10am

Ok nice, now the processing script seems missing the MySQL constructor …
Is there anybody with a valid processing script please, it could help.

Posted by drik on 3 December 2010 @ 3pm

Hi,

Any idea how I can solve this message:
“Error getting RFCOMM channel ID from service.”

I’ve googled but didn’t found any solution.
Maybe you have as suggestion or a resource where I can find more information.

Kasper

Posted by kasper on 11 December 2010 @ 2pm

Hello, I would like to put the sms on a full screen as a video animation. How do i do to insert the sms as text on full screen?

Posted by Jonathan on 12 January 2011 @ 7pm

Leave a Comment

2Roqs inauguration party BW Particles