Sending USSD Codes from the Huawei E5331

Sometimes Linux is not at Home

The Problem

For some time now I do own one of those nifty cheap Huawei E5331 G3 WiFi routers, Unfortunately the web interface is missing the ability to send USSD codes. This is pretty annoying since it forces me to move my prepaid SIM card to a mobile phone to transfer fresh money.

Solved with a little Help from my Friends

Starting with kernel 3.8 the device is however supported via usb. As a result you get

backspace:~$ lsusb
Bus 002 Device 004: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard

as soon as usb_modeswith has done its work.

On my laptop running debian wheezy with a 3.13-0.bpo.1-amd64 the usable modem shows up as /dev/ttyUSB1. Unfortunately it is not usable from gammu. It is not responding to AT. It is however usable with gsm-ussd.

backspace:~$ gsm-ussd --no-cleartext -m /dev/ttyUSB1 '*100#'
Ihr Guthaben für die Nr.<phone number> beträgt 5.76 Euro. 
Die Guthabenabfrage ist auch über die ALDI Talk App möglich.