Loading...

Raspberry PI and Multiple GSM Modems

A little update on my PI adventures…

Since I’ve decided to use my router running Tomato firmware as a DLNA/Samba Server (extending the memory as a swap file partition to make it not hang), my PI has been unused for quite a while.

Since I have some use of IP communications (related to business calls), as well as calls from my family abroad (dad and some relatives who calls me on the phone as well) I decided to make this as an experiment of sorts.

I practically made my Raspberry PI into a small asterisk server.

IMG_20130608_153811

As you can see (forgive the dust, I placed this in a place where it is not usually seen by guests and dust settles there quite often), the setup is made up of two 3G USB dongles, with sim lock disabled myself (the sim card on one of the modems when I bought it expired quite a while ago; i didn’t realize it until i opened the box and took the sim card out).

For the distribution I used Raspbx, which made things a whole lot easier. For the dongles, I ran the script:
install-dongle

and it set up the first dongle well(E173 Huawei Modem). As for the second dongle (which was a Huawei E303 4G modem), I had to find the ttyusb ports assigned to it by typing:

ls -l /dev/ttyUSB*

crw-rw-rwT 1 root dialout 188, 0 Jan 1 1970 /dev/ttyUSB0
crw-rw-rwT 1 root dialout 188, 1 Jun 9 17:49 /dev/ttyUSB1
crw-rw-rwT 1 root dialout 188, 2 Jun 9 21:29 /dev/ttyUSB2
crw-rw-rwT 1 root dialout 188, 3 Jun 9 16:48 /dev/ttyUSB3
crw-rw-rwT 1 root dialout 188, 4 Jun 9 16:48 /dev/ttyUSB4
crw-rw-rwT 1 root dialout 188, 5 Jun 9 21:29 /dev/ttyUSB5

Usually with Huawei modems, the second and third ports are the ones used for data and audio respectively. So I set up those here in /etc/asterisk/dongle.conf:

[dongle0]
audio=/dev/ttyUSB1
data=/dev/ttyUSB2

[dongle1]
audio=/dev/ttyUSB4
data=/dev/ttyUSB5

With this, I run the commands:
amportal restart
rasterisk

and I run the following command:
dongle show devices

And dongle0 and dongle1 shows itself as E173 and E303 respectively.

As a SIP phone I used my old nokia E51 phone which I haven’t used for a number of years. As for the setup, I made it in such a way that if I don’t answer on the SIP phone, the call is forwarded to my cellphone (this is the purpose of the 2 usb modems).

One of the modems is used as a landline, the other one is used to call me if I’m not around or using the SIP phone. I have also set up a DID number abroad for my relatives to call me as well (if I’m not around, the call is forwarded on my cellphone too).

Here’s a camera shot of the Nokia E51 receiving a call from skype calling the DID number abroad below:

IMG_20130609_222412

And here’s a video shot of the call:

I’ve also set up dial plans to forward SMS received on one mobile number to my cellphone. I’m planning to set up an SMS answering system running php or bash code.

All in all, this comes in handy especially when traveling. Running processes when idle are only at 2% and rise up to no more than 4%. The PI is more than capable for my personal use.

 
 

4 comments
  1. Paul

    Hi, I was wondering if you have had any issues with stability on your pi with multiple dongles. I have a similar setup but as soon as I plugin a 2nd dongle I find within a few hours my pi crashes. with only one dongle it will run for weeks without a problem. I assume its a power problem but I am not sure. I am running using one of the recommended powered USB hubs as well (the one built especially for the pi).

  2. ducth

    Help me

    list usb 3g on system
    ls -l /dev/ttyUSB*
    crw-rw-rw- 1 root dialout 188, 0 Apr 23 11:00 /dev/ttyUSB0
    crw-rw-rw- 1 root dialout 188, 1 Apr 23 11:00 /dev/ttyUSB1
    crw-rw-rw- 1 root dialout 188, 10 Apr 23 11:00 /dev/ttyUSB10
    crw-rw-rw- 1 root dialout 188, 11 Apr 23 11:00 /dev/ttyUSB11
    crw-rw-rw- 1 root dialout 188, 12 Apr 23 11:00 /dev/ttyUSB12
    crw-rw-rw- 1 root dialout 188, 13 Apr 23 11:00 /dev/ttyUSB13
    crw-rw-rw- 1 root dialout 188, 14 Apr 23 11:00 /dev/ttyUSB14
    crw-rw-rw- 1 root dialout 188, 2 Apr 23 11:24 /dev/ttyUSB2
    crw-rw-rw- 1 root dialout 188, 3 Apr 23 11:00 /dev/ttyUSB3
    crw-rw-rw- 1 root dialout 188, 4 Apr 23 11:00 /dev/ttyUSB4
    crw-rw-rw- 1 root dialout 188, 5 Apr 23 11:24 /dev/ttyUSB5
    crw-rw-rw- 1 root dialout 188, 6 Apr 23 11:00 /dev/ttyUSB6
    crw-rw-rw- 1 root dialout 188, 7 Apr 23 11:00 /dev/ttyUSB7
    crw-rw-rw- 1 root dialout 188, 8 Apr 23 11:24 /dev/ttyUSB8
    crw-rw-rw- 1 root dialout 188, 9 Apr 23 11:00 /dev/ttyUSB9

    Config Dongle.conf

    [dongle0]
    audio=/dev/ttyUSB1 ; tty port for audio connection; no default value
    data=/dev/ttyUSB2 ; tty port for AT commands; no default value

    [dongle1]
    audio=/dev/ttyUSB4 ; tty port for audio connection; no default value
    data=/dev/ttyUSB5 ; tty port for AT commands; no default value

    [dongle2]
    audio=/dev/ttyUSB7 ; tty port for audio connection; no default value
    data=/dev/ttyUSB8 ; tty port for AT commands; no default value

    [dongle3]
    audio=/dev/ttyUSB10 ; tty port for audio connection; no default value
    data=/dev/ttyUS11 ; tty port for AT commands; no default value

    [dongle4]
    audio=/dev/ttyUSB13 ; tty port for audio connection; no default value
    data=/dev/ttyUS14 ; tty port for AT commands; no default value

    on Asterisk reload config dongle
    CLI>dongle reload now
    Show dong le
    CLI>dongle show devices
    ID Group State RSSI Mode Submode Provider Name Model Firmware IMEI IMSI Number
    dongle0 0 Free 26 0 0 Viettel E173Eu-1 11.126.16.00.439 712222000020023 452040050281698 Unknown
    dongle1 0 Free 28 0 0 Viettel E173Eu-1 11.126.16.00.439 864109013800036 452040050282490 Unknown
    dongle2 0 Free 26 0 0 Viettel E303u-1 11.126.29.00.516 861195003674708 452040050282503 Unknown
    dongle3 0 Not connec 0 0 0 NONE Unknown
    dongle4 0 Not connec 0 0 0 NONE Unknown

    WHY SHOW dongle fail 2 usb 3g ,total 5usb 3g
    Dongle max config 3 USB 3g???????????

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.