Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save yoggy/3e2abb2a902c6d9ebe18 to your computer and use it in GitHub Desktop.

Select an option

Save yoggy/3e2abb2a902c6d9ebe18 to your computer and use it in GitHub Desktop.

SORACOM Air + Raspberry Pi + L-05Aを使ったインターネット接続の設定.md

wvdial設定

$ sudo apt-get remove --purge usb-modeswitch
$ sudo apt-get install -y eject wvdial dnsutils
$ sudo vi /etc/wvdial.conf

    [Dialer Defaults]
    Modem = /dev/ttyACM0
    Init1 = ATZ
    Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
    Init3 = AT+CGDCONT=1,"IP","soracom.io"
    Carrier Check = no
    Auto DNS = 1
    Check Def Route = 1
    Stupid Mode = yes
    Dial Commnd = ATD
    Phone = *99***1#
    Username = sora
    Password = sora
    New PPPD = yes

systemdへの登録と実行

$ sudo vi /etc/systemd/system/wvdial.service

    [Unit]
    Description=wvdial service
    Wants=network.target
    
    [Service]
    Type=simple
    ExecStartPre=sleep 10;test -e /dev/sr0 && /usr/bin/eject
    ExecStart=/usr/bin/wvdial
    ExecStop=/bin/kill -HUP $MAINPID
    
    [Install]
    WantedBy=multi-user.target

$ sudo systemctl enable wvdial.service
$ sudo systemctl start wvdial.service
$ sudo systemctl status wvdial.service

停止と無効

$ sudo systemctl stop wvdial.service
$ sudo systemctl disable wvdial.service

その他設定

$ sudo apt-get remove ntp
$ sudo apt-get install ntpdate
$ crontab -e 

    58 * * * * sudo /usr/sbin/ntpdate ntp.nict.jp >/dev/null 2>&1

$ sudo vi /etc/avahi/avahi-daemon.conf

    allow-interfaces=eth0,wlan0

参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment