GSM Modem + Kannel + Linux

As usual nothing is ever entirely straightforward with Linux, so here are a couple of tips if you're struggling.

  • You need the following compiled into your kernel or as a module (if you use a stock kernel it probably already is)


    Device Drivers -->
     [*] USB support -->
       USB Modem (CDC ACM) support

    This builds a module called cdc_acm. If hotplug is set up correctly this should get loaded automatically when you plug the modem in. You can check by typing dmesg to see if the modem was recognized; if everything is working you should get something like:


    usb 1-6: new full speed USB device using ohci_hcd and address 5
    usb 1-6: configuration #1 chosen from 1 choice
    usb 1-2: new full speed USB device using ohci_hcd and address 6
    usb 1-2: configuration #1 chosen from 1 choice
    cdc_acm 1-2:1.0: ttyACM0: USB ACM device
    usbcore: registered new interface driver cdc_acm
    drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters

    If you get something different, try unplugging the modem, running modprobe cdc_acm and plugging it in again.

    Note the line
    cdc_acm 1-2:1.0: ttyACM0: USB ACM device
    This tells you the name of the device that the modem is bound to, in this case /dev/ttyACM0. This is the default, but it may turn up somewhere else, for example if you have another USB modem or you unplug the modem and plug it back in quickly before it has been properly deregistered.

  • I had some trouble getting Kannel to autodetect the modem, so I set it up manually with the following in my kannel.conf file:


    ...
    group = smsc
    smsc = at
    modemtype = falcom
    device = /dev/ttyACM0
    my-number = 16178995203
    connect-allow-ip = 127.0.0.1
    log-level = 0

    group = modems
    id = falcom
    name = "Falcom"
    detect-string = "Falcom"
    init-string = "AT+CNMI=1,2,0,0,1"
    speed = 115200
    ...

    Here's my full config file if you're interested.