SMS Gateway using Sierra Wireless USB Modem on Debian Wheezy

I have been planning to set up a SMS Gateway for sending and receiving SMS messages via a headless utility unit (Raspberry Pi) for a while. Since I had a leftover Sierra Wireless AirCard 880U from Telstra in Australia I wanted to re-purpose this unit with a spare SIM card. Unfortunately it was very hard to find any good setup manual for this particular combination and took some time to fiddle & debug. This is the working setup for future reference and hopefully it helps somebody.

Install dependencies

Note: install usb-modeswitch BEFORE connecting USB Modem
sudo apt-get install usb-modeswitch gsm-utils smstools gammu

Connect the USB Modem

Check if modem is recognised

lsub

Bus 003 Device 002: ID 1199:6855 Sierra Wireless, Inc.

Edit smstools config file

vim /etc/smsd.conf

Change the GSM1 entry
[GSM1]
init = ATE0;+CPMS="SM","SM"
device = /dev/ttyUSB2
incoming = yes
mode = new
baudrate = 115200
smsc = 61418706700
pin = ignore
#rtscts = yes
#cs_convert = yes
report = yes
sending_disabled = no
memory_start = 1
pre_init = yes
primary_memory = SM
secondary_memory = SM
secondary_memory_max = 40

Troubleshooting the modem

I installed gammu purely to have an easier way to test if the modem actually worked. You can use gammu-config to do a GUI config or create a config file manually

vim /etc/gammurc

[gammu]
port = /dev/ttyUSB2
connection = at115200

Testing

gammu-detect

; Configuration file generated by gammu-detect.
; Please check The Gammu Manual for more information.

[gammu]
device = /dev/ttyUSB0
name = Phone on USB serial port Sierra_Wireless__Incorporated AirCard
connection = at

[gammu1]
device = /dev/ttyUSB1
name = Phone on USB serial port Sierra_Wireless__Incorporated AirCard
connection = at

[gammu2]
device = /dev/ttyUSB2
name = Phone on USB serial port Sierra_Wireless__Incorporated AirCard
connection = at

#send sms
sudo echo "sms test" | /usr/bin/gammu --sendsms TEXT +61XXXXXXXX
#check received sms
gammu getallsms

Add your own user account to dialout group if you want to send from your own account for testing (gammu)

sudo adduser $UNPRIVILEGEDUSER$ dialout

Next I will have some fun setting up PlaySMS to allow me to send SMS commands and create some inbound SMS workflows for family.

References
PlaySMS: http://playsms.org/
Gammu: http://wammu.eu/phones/sierra/2551/
smstools: http://smstools3.kekekasvi.com/index.php?p=configure

Connection Android 4.x MTP mass storage to Ubuntu 12.x

The ability to connect Android 4.+ devices to Ubuntu using the USB Mass Storage interface has always been a pain. With Ubuntu 13.04 a new MTP back-end (gvfs-mtp) is going to be introduced, but I have had some issues with the 13.04 Beta so I found this backport PPA to Ubuntu 12.04 and 12.10

sudo add-apt-repository ppa:langdalepl/gvfs-mtp
sudo apt-get update
sudo apt-get install gvfs
sudo apt-get upgrade

Kudos to Phillip Langdale for the work and maintaining the PPA !

Running Android 4.0 (ICS) on Virtualbox

Debugging things on the Android Emulator (incluced in the SDK) can be a very slow and cumbersome process. Thanks to the Android-x86 Project it’s quite easy to run Android in VirtualBox. This is highly useful when you need to test mobile apps and websites from the Android Browser (as well as Chrome Mobile).

  1. Download an Ethernet enabled ISO from Tablets x86

    wget http://dl.dropbox.com/u/75945873/android-x86-4.0-eth0-generic_x86-20120426.iso.torrent
    transmission android-x86-4.0-eth0-generic_x86-20120426.iso.torrent

  2. Create new ViratualBox VM
    VM Settings 1
    VM Settings 2
    VM Settings 3
    Important Settings (see screenshots)

    • OS: Linux, Version: Linux 2.6
    • Enable VTx/AMD-V
    • Use Bridged Network Adapter (if you want to allow direct Internet Access)
  3. Mount the ISO file downloaded previosly and start the VM
    Install dialog
  4. Create the Root Filesystem (ext3) on the VBox .vdi created with the new VM, mark as bootable
  5. Write the Filesystem changes to disk (VDI) and format the disk
  6. Install GRUB Boatloader
  7. Copy files from ISO to VDI
  8. Unmount the ISO image and reboot
  9. Note: You need to disable the mouse pointer integration (if you have installed VirtualBox Client Add-ons) in the menu of Virtualbox (‘Machine’ –> ‘Disable Mouse Integration’) when you start the VM (see screenshot). I have not found a way to disable this by default on Virtualbox on Ubuntu (If anybody has managed this I would love to know how !)

    Disable Mouse Integration

  10. Start the Android Setup Wizard to set locale and you should be up and running (network should already function to test external sites from Android browser) !

Intel Ultrabook tweaks on Ubuntu 12.04

After upgrading my Toshiba Z830 Ultrabook to 12.04 (Precise Pangolin) I noticed that the ability to control the screen back-light was not working using the Toshiba Fn F6/F7 keys.

Thanks to http://www.linlap.com/wiki/acer+aspire+s3 the solution was found quite quickly.

sudo vim /etc/default/grub

This will open the grub configuration file. (Grub is the initial boot selection software)
To be able to dim the screen brightness, You’ve got to modify the line:

GRUB_CMDLINE_LINUX=""

to these two lines:

pcie_aspm=force
GRUB_CMDLINE_LINUX="quiet splash pcie_aspm=force i915.i915_enable_rc6=1 i915.lvds_downclock=1 acpi_osi=Linux acpi_backlight=vendor elevator=noop"

Another neat tip: intel-gpu-tools can be used to control brightness from the commandline.

# will set brightness at 50%
intel_backlight 50


EDIT [2012-08-24]: to avoid issues on resume you need to add a script to the

sudo vim /etc/pm/sleep.d/20_wakeup

Add the following:

#!/bin/bash
case "$1" in
suspend|hibernate)
#do nothing
;;
resume|thaw)
echo 7 > /sys/class/backlight/toshiba/brightness
;;
*)
exit 1
;;
esac
exit 0

Mark the file as executable
sudo chmod +x /etc/pm/sleep.d/20_wakeup

Android 4.0 screenshot functionality on Galaxy Nexus

One of the features I missed since the good old Android 1.5 days was the ability to take screen-shots on the device. Prior to Android 4 (ICS) the only workable way to create screen-shots was to connect via USB cable and use the Android SDK to make remote screen-shots.

On Android 4.0 all you have to do is press Volume Down Key + Power Key down at the same time and hold.  You should hear the camera click (if audio is on) and Android will show a notification that the screenshot was saved on your device and you can now upload or transfer to your favourite service.

Getting a handle on Ubuntu mobile power management

To get an idea on the current power usage and some suggestions on how to improve power-management ‘powertop‘ is a must-have.

sudo apt-get install powertop

Powertop Screenshot

For some more detailed suggestions this is a good start: https://help.ubuntu.com/community/PowerManagement/ReducedPower

Mobile Browser Testing on the Desktop

If you need to check websites for mobile compliance on a regular basis you know that having a device to constantly check is painful and slows down your work during debugging and phases of constant change.

Surrounding myself with screens by adactio, on Flickr
Creative Commons Attribution 2.0 Generic License  by  adactio 

There are a few tools that will make this work a lot easier:

Google Chrome

Chrome does have some nice dedicated plug-ins to help with this task

Firefox

I am not aware of any plug-ins like Chrome, but as a hack I have found it useful to employ a user-agent switching plugin to trick the browser

User Agent Switcher (http://chrispederick.com/work/user-agent-switcher/) works well for this.

  1. Download the User Agent Switcher Add-on for Firefox
  2. Restart Firefox for the add-on change to take place.
  3. To start a new browsing session using an emulated browser, go to Tools > User Agent Switcher and select the appropriate mobile web browser you want to emulate
  4. To switch back to normal browsing, just select the default option from the above menu.

If you need more specific UA Strings check here: http://www.zytrax.com/tech/web/mobile_ids.html

For more serious work there are obviously dedicated emulators from the major Mobile OS vendors (but they need to be installed and configured for each platform):

 

PS: Nothing substitutes final QA testing on actual devices …

 

Open Governance Index – measuring openness

This is an interesting report and info-graphic by the folks at VisionMobile on a new way of measuring the openness of some mobile open source projects.

The Open Governance Index measures the true openness of eight open source projects – Android, Qt, Symbian, MeeGo, Mozilla, WebKit, Linux and Eclipse – and analyses how governance, and not licenses, tell the full story of a project’s openness, across transparency, influence and control.

The Open Governance Index – A new way of measuring openness

The full report can be downloaded free (email required) here.

Install Handbrake on Ubuntu

Note: this has been verified to work on 11.04 (Natty), 11.10 (Oneiric) & 12.04 (Precise)

To convert a DVD and make it viewable on your mobile device Handbrake seems to be the most useful tool I have discovered so far. Since it is not part of the default Ubuntu Repositories here is the installation process. The first step is to insure libdvdcss2 is installed

sudo apt-get install libdvdcss2
sudo add-apt-repository ppa:stebbins/handbrake-releases
sudo apt-get update
sudo apt-get install handbrake-gtk

My mobile personal learning environment

Taking part in MobiMOOC has given me the opportunity to take stock of my own MobilePLE – the top 5 tools I find most useful as part of my ongoing learning.

 

  • Catch Notes (previously 3Bananas) – mobile note taking the most critical component. Whenever I get a new device – this is what has to be installed as one of the first actions. For those not familiar with this software – it’s like Evernote without the bloat.
  • TwiDroyd – mobile Twitter / Status.Net client. This could be replaced by similar Twitter clients
  • GoogleReader – RSS reader client
  • Flickr – image upload and sharing
  • FourSquare – location based sharing

 

These are the main applications I use pretty much constantly, however here are some other useful services I use regularily:

 

  • Delicious – Online Bookmarking (this is an old one, but a good one). Unfortunately there are not a great deal of mobile interfaces for Delicious as Yahoo has publicly stated that it is trying to offload the project
  • Pixelpipe – universal uploader (upload to multiple services such as Flickr, Picasa, Youtube from mobile)
  • BeyondPod – podcast client
  • GoogleGoggles – image recognition software to allow searches based on camera input
  • Zxing Barcode Scan – open source barcode scanner (QR codes as well as EAN type)
  • WordPress Client – mobile client to edit wordpress blogs
  • Sketchbook – mobile drawing application from Autodesk (you need a reaonable screen for this – tab preferred)
  • UStream Broadcaster – streaming video producer from mobile handset

 

One thing worth noting is that this is very much the “CURRENT Mobi-PLE”. The one sure thing with mobile tech in general is that it tends to change quickly over time and with need.

Looking forward to hearing about things I am missing – comments welcome !