Skip to content

Instantly share code, notes, and snippets.

@damonsk
Created October 25, 2012 20:08
Show Gist options
  • Select an option

  • Save damonsk/3955099 to your computer and use it in GitHub Desktop.

Select an option

Save damonsk/3955099 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Oct 25, 2012.
    58 changes: 58 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,58 @@

    # Send SMS messages using Raspberry Pi.
    # Using gammu and Huawei E220

    # Prepare SD card with wheezy.

    # Login / complete rasp-config / reboot / login

    # Set vimrc to prevent annoying ADBC arrow keys
    cp /etc/vim/vimrc ~/.vimrc

    # Set network (can be skipped)
    vi /etc/network/interfaces

    auto eth0
    iface eth0 inet static
    address 192.168.1.198
    netmask 255.255.255.0
    gateway 192.168.1.254

    # Set nameservers (can be skipped)
    vi /etc/resolv.conf

    domain lan
    search lan
    nameserver 8.8.8.8
    nameserver 8.8.4.4

    # Restart network
    /etc/init.d/networking restart

    # Install Gammu (python-gammu and gammu-smsd can be skipped - depending on requirements)
    apt-get install gammu
    apt-get install python-gammu
    apt-get install gammu-smsd

    # Find port USB device connected to
    dmesg | grep tty

    [ 7.578478] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB0
    [ 7.697942] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB1

    # Config gammu
    gammu-config

    # Check connected
    gammu --identify

    Device : /dev/ttyUSB0
    Manufacturer : Huawei
    Model : E220 (E220)
    Firmware : 11.117.03.01.156
    IMEI : 3XX19301XXXXXX3
    SIM IMSI : 2XXXX923271XXX1


    # Test with a text message
    echo "some message" | gammu --sendsms TEXT 07921XXXXXX