Posts tagged with "gnokii"
Demo of Two Way SMS Gateway on a USB Stick with Drupal Integration
New Open Source Tools Will Make Decentralized Data Collection More Effective

The release of the SMS Framework 1.0, along with the road map for a 1.1 version, is making Drupal a more attractive platform for organizations that need powerful, decentralized data collection tools. This recent work shows that using Drupal can give you a serious foundation to integrate sms applications and tools with a website. I want to expand on Will’s recent post about building a two way SMS Gateway on a USB drive and show how Drupal can act as a data hub for collecting data and messaging via sms.

We are interested in this because tools that can integrate with sms like this will be especially helpful for international development agencies with on the ground operations. For example, this functionality could allow an election monitoring organization to use sms to track reports from observers at polling stations or help a public heath organization to monitor when patients take medicine via sms messages sent from personal or public cell phones. It could even assist a disaster response organization to track the status of its team on the ground team through their handsets.

Proof of concept:
Let’s look at the election monitoring example to put this in more concrete terms. Will pulled together a screencast to accompany this post that shows how it all works, riffing specifically on how an integrated solution could help field workers like election monitors.

Setting Up a Two-Way SMS Gateway with Gnokii and Drupal
Gnokii Sends and Receives SMS Text Messages Using USB or Bluetooth

In addition to all of the work being done on the SMS Framework, we have also started researching how to quickly create our own two-way SMS gateway for sending and receiving SMS messages. It is a proof of concept based on needs we are hearing from development agencies. Our solution is based around gnokii, an open source project that can be used to control the various functions of any mobile phone it supports. gnokii sends and receives SMS text messages over a USB or Bluetooth connection with the phone. 

In our setup we’re using a Nokia 6102i mobile phone, gnokii 0.6.8 (installed using Macports) and a MacBook Pro with Bluetooth.

A daemon, written in Python, manages the process of sending and receiving messages and a Drupal module acts as the end point on the Drupal side. The daemon periodically checks the phone for incoming messages and the server for outgoing messages. If a message is found it is processed and passed to the other side.

An outgoing message that originated from a Drupal module will be stored in a queue temporarily. The daemon checks the queue using an HTTP request. When it finds the queued message it connects the phone, sends the message, and clears the item from the queue. Incoming messages are handled in a similar fashion. When a message is first received it is queued on the mobile phone temporarily. When daemon finds the message waiting on the phone, it passes it to the server using an HTTP request and deletes the entry from the phone.

We are making the daemon open source so check out the code in the Drupal CVS repository and let me know if you want to talk about this.