Skip to content

Instantly share code, notes, and snippets.

@msztorc
Forked from kmpm/README.md
Last active November 20, 2016 12:05
Show Gist options
  • Save msztorc/138060038085550bd0fcaf93e3af5fa2 to your computer and use it in GitHub Desktop.
Save msztorc/138060038085550bd0fcaf93e3af5fa2 to your computer and use it in GitHub Desktop.
smstools with usb dongle on rpi
How to install smstools on Raspberry PI with a nn dongle
========================================================
Get deviceid for the dongle
---------------------------
sudo lsusb
I get the result...
Bus 001 Device 005: ID 12d1:1446 Huawei Technologies Co., Ltd. E1552/E1800/E173 (HSPA modem)
Make sure the dongle is detected
--------------------------------
The dongle in question have 2 different "modes".
One, default, which emulates a cdrom
sudo apt-get install usb-modeswitch usb-modeswitch-data
cd /usr/share/usb_modeswitch
sudo tar -zxvf configPack.tar.gz
sudo cp 12d1\:1446 /etc/usb_modeswitch.d/
sudo /etc/init.d/udev restart
Ofcourse you should replace the source file with your device id.
Now unplug and plug your dongle and check some dmsg messages.
dmsg
Towards the end of the output something similar to this should turn up if it works.
````
[ 5303.809700] usbcore: registered new interface driver usbserial
[ 5303.809783] usbcore: registered new interface driver usbserial_generic
[ 5303.809857] usbserial: USB Serial support registered for generic
[ 5303.825111] usbcore: registered new interface driver option
[ 5303.825193] usbserial: USB Serial support registered for GSM modem (1-port)
[ 5303.825552] option 1-1.3.4:1.0: GSM modem (1-port) converter detected
[ 5303.907093] usb 1-1.3.4: GSM modem (1-port) converter now attached to ttyUSB0
[ 5303.914188] option 1-1.3.4:1.1: GSM modem (1-port) converter detected
[ 5303.917651] usb 1-1.3.4: GSM modem (1-port) converter now attached to ttyUSB1
[ 5303.927234] option 1-1.3.4:1.2: GSM modem (1-port) converter detected
[ 5303.928139] usb 1-1.3.4: GSM modem (1-port) converter now attached to ttyUSB2
````
You should get some ttyUSBx devices for the modem in the dongle... yay!
Install and configure smstools
------------------------------
sudo aptitude install smstools
And you have to do some small configuration by editing /etc/smsd.conf
```
#just edit the GSM1 section
[GSM1]
#init =
#here enter the ttyUSBx from dmesg
device = /dev/ttyUSB1
incoming = yes
#enter you pin here
pin = xxxx
baudrate = 115200
```
Now restart the service
sudo /etc/init.d/smstools restart
And check the log that it started as it should
sudo tail /var/log/smstools/smsd.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment