AK-020 を Raspbian で使う(とりあえず版)
2269 ワード
SORACOM Air SIM + Abit社製 の AK-020 を Raspberry Pi で使うのに必要な情報です。
Raspberry Pi 2 Model B + raspbian_lite-2016-03-18で確認しています。
(5-13版が出てるのに今気付くなど)
基本的に、付属マニュアルにある通り、eject して modprobe すれば、tty が見えます。
ただし、AT+CFUN=1 を実行しないと、モデムとして動作を開始しないことがポイントのようです。
パッケージインストール
pi@raspberrypi:~ $ sudo apt-get install -y eject wvdial
設定ファイル
/etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
Init2 = AT+CFUN=1
Init3 = AT+CGDCONT=1,"IP","soracom.io"
Dial Attempts = 3
Modem Type = Analog Modem
Dial Command = ATD
Stupid Mode = yes
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
APN = soracom.io
Phone = *99***1#
Username = sora
Password = sora
Carrier Check = no
Auto DNS = 1
Check Def Route = 1
/etc/ppp/peers/wvdial
noauth
name wvdial
usepeerdns
replacedefaultroute
/etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
eject sr0
modprobe usbserial vendor=0x15eb product=0x7d0e
echo waiting for modem device
for i in {1..30}
do
[ -e /dev/ttyUSB0 ] && break
echo -n .
sleep 1
done
[ $i = 30 ] && ( echo modem not found ; exit 1 )
wvdial &
exit 0
pi@raspberrypi:~ $ sudo apt-get install -y eject wvdial
/etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
Init2 = AT+CFUN=1
Init3 = AT+CGDCONT=1,"IP","soracom.io"
Dial Attempts = 3
Modem Type = Analog Modem
Dial Command = ATD
Stupid Mode = yes
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
APN = soracom.io
Phone = *99***1#
Username = sora
Password = sora
Carrier Check = no
Auto DNS = 1
Check Def Route = 1
/etc/ppp/peers/wvdial
noauth
name wvdial
usepeerdns
replacedefaultroute
/etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
eject sr0
modprobe usbserial vendor=0x15eb product=0x7d0e
echo waiting for modem device
for i in {1..30}
do
[ -e /dev/ttyUSB0 ] && break
echo -n .
sleep 1
done
[ $i = 30 ] && ( echo modem not found ; exit 1 )
wvdial &
exit 0
あとは再起動すれば自動的に接続しに行きます。
Author And Source
この問題について(AK-020 を Raspbian で使う(とりあえず版)), 我々は、より多くの情報をここで見つけました https://qiita.com/j3tm0t0/items/08c199fb8863b69e1139著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .