Mobiles, Shakespeare, Standards, Usability, Security.

Raspberry Pi and Frontline SMS

(I think I'm the first person to try this - so I decided to document the process.)

A few weeks ago, I won a Raspberry Pi at the #OTA12 hackday. It arrived on Friday, so I thought I would turn it into an SMS server using the incredible FrontlineSMS.

0. Setting up the Pi

This is the easy part. Follow the excellent guide on the eLinux wiki. Essentially, download the Debian image, extract, and dd it onto an SD card.

The hardest part was finding a full sized SD! In the end, I found an old adapter and stuck in a 2GB micro SD card.

1. First Boot

My first boot was a failure. Nothing appeared on the screen. So, I switched off the power, unplugged every lead, plugged them back in, and powered it on. Success!
raspberry pi first boot

The first thing I did was ensure the operating system was up to date.

Check for updates:

Then, apply those updates

This took a few minutes.

Finally, set up SSH or VNC if you plan on using the machine remotely.

2. Dongle Hardware

FrontlineSMS maintains a list of USB dongles which work with its service. I used a Vodafone branded Huawei E220. Sold as Vodafone K3565
3G Dongle Raspberry Pi
The Raspberry Pi only has 2 USB slots - the dongle was slim enough not to interfere with the other USB cable, but it did mean I could only run either a keyboard or a mouse without using a hub. It's recommended that you use a powered USB hub - although my keyboard and mouse didn't seem to draw too much power.

3. Frontline SMS

Downloading Frontline SMS via the commandline (using v1.6 because v2 isn't ready for Linux yet)



Gave an error - FrontlineSMS requires Java.

4. Installing Java

The Java install takes about 140MB of disk space. After downloading and extracting FrontlineSMS, I only had about 220MB of free space. I deleted the FrontlineSMS zip file and had 234MB free. Just about enough room!

Wait several minutes and you'll be good to go.

5. Running for the First Time

Frontline SMS requires a GUI.

Running a GUI is as easy as typing

The resolution was set at the slightly odd dimensions of 1264*672 - which meant there was a large black border around the screen.
Raspberry Pi Resolution

Open a terminal (Start, Accessories, LXTerminal, then type

After several minutes of waiting, FrontlineSMS started!
Frontline SMS Raspberry Pi

However, no matter what I tried, I couldn't get FrontlineSMS to detect the dongle. The OS could see it fine (using "lsusb" and "dmesg"), but it just didn't appear to be detected by FrontlineSMS.
FrontlineSMS unable to connect

A delve into the commandline, showed this error:
FrontlineSMS ARM

6. Installing the Correct Libraries

We need to load the correct (ARM) version of rxtx.

Find where the install process has dumped it

It should show you two location - the first being where the correct version is, the second where the FrontlineSMS version is.

All we need to do is overwrite the incorrect version.

Then, run

And, after some warnings and waitings, you should see
Raspberry Pi Frontline SMS Success

Hey Presto! FrontlineSMS up and running on a Raspberry Pi!

(Oh! I finally worked out how to do screenshots! install scrot and run "scrot -d 10" to take a screenshot after 10 seconds.)

7. Manually Sending an SMS

Running FrontlineSMS via Java on a 700MHz ARM device is very slow. It is possible to talk directly to the dongle and manually tell it to send SMS.

First, I installed picocom.

To find out where the dongle has been installed, type:

Which will give an long output, which should contain some text like this like this:

The dongle installs itself in two places - ttyUSB0 & 1. It's the first one we want.

Connect by issuing this command

Which will give you the output

From now on in, we're typing commands directly into the dongle. You cannot press the delete key! Copy & paste, or be careful when typing!

First, to make sure everything is working, we type

We should see this response

Next, set the dongle to text mode

Again, the response should be

Let's send our first SMS!

This will not say "OK", rather, it will prompt us to type a message

Type your message, so the screen looks like

DO NOT HIT ENTER. Instead, hit CTRL and Z at the same time.

You should see a response like

The number is the "sent items" reference. Within a few moments, the SMS should have been received.

You can send an SMS to the dongle. To check for messages, type the command

You should see all the messages in the inbox

To quit picocom, hold down CTRL, then hold down A, then hold down X.

Useful Links

A collection of links I found useful when writing this blog post
For unlocking Huawei modems


A picture of Mitra Ardron Mitra Ardron

Did you try it with SMStools ? I'm looking for a way to do a cheap SMS to Web gateway to place in various locations around the world to accept SMS messages for access to a server.

A picture of garagedeveloper garagedeveloper

Which vodafone sim are you using pay as you? contract or what. Ive had this dongle it can receive messages find i just cant send any. Vodafone say its barred.

A picture of svbito svbito

This post came exacly in the right moment! I was researching ways to implement my own SMS-gateway via scripts and it popped up. Great writeup, I will try your instructions as soon as possible.

A picture of Brice Brice

Hello, did you try to put Android on your Pi and install SMS Gateway app ? SMS Gateway allows you to send SMS by http request, just by getting http://x.x;x.x:9090/sendsms...phonenumber...text...password
I'm really interested by a network SMS gateway, and the easiest way is getting SMS Gateway on a Android device, but don't want to buy an smartphone, and I search a small device like Pi running Android with GSM possibilities.
I'm interested by your opinion on this idea.

A picture of Terence Eden Terence Eden

I think you're probably better off buying a cheap Android phone. A Huawei Blaze is about £40 - including £10 PAYG credit. That's about the same price as Raspberry Pi and - while not as customisable - is perfect if you want a cheap and fast Android device.

A picture of Nick Nick

Hi! I just tried this and thought it was going ok, replaced the librxtsSerial etc but then I get a mismatch java error on startup,

Native lib Version = RXTX-2.2pre2
Java lib Version = RXTX-2.1-7
WARNING: RXTX Version mismatch
Jar version = RXTX-2.1-7
native lib Version = RXTX-2.2pre2

Did you get this when you did it!!??

A picture of Lars Lars

I can't fix the problem you described "A delve into the commandline, showed this error:"

Followed all the steps but still getting the same error. It freaks me out to fail that short of the finish.

Help appreciated.

A picture of Adel Adel

any ideas on the vodafone newer K3770 models? when i dmesg i dont see any modems listed, but i see the usb module listed? i was trying the 2nd approach (since i dont have java installed on my pi - im using the Raspbian “wheezy”).


What do you reckon?

%d bloggers like this: