Skip to content

Commit

Permalink
Merge branch 'hotfix/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daisuke Baba committed Jul 27, 2016
2 parents 610b6e7 + d6456a3 commit 29e4368
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 15 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

ltepi2-service
===

[![GitHub release](https://img.shields.io/github/release/CANDY-LINE/ltepi2-service.svg)](https://github.com/CANDY-LINE/ltepi2-service/releases/latest)
[![License BSD3](https://img.shields.io/github/license/CANDY-LINE/ltepi2-service.svg)](http://opensource.org/licenses/BSD-3-Clause)
Expand All @@ -20,7 +21,20 @@ ltepi2-serviceは、Raspberry Pi上で動作する[LTEPi for D](http://www.candy
- [candy-board-amt](https://github.com/CANDY-LINE/candy-board-amt) ... CANDY-LINE基板AM Telecomモデム向け共通モジュール

以下のモジュールは、インストールの可否を選択可能です。 **通常はインストールされます。**
- [CANDY RED](https://github.com/dbaba/candy-red) ... CANDY EGGクラウドサービスに接続可能なNode-REDベースのフローエディターです。Node.js v0.12またはv4.3が入っていない場合は、Node.js v0.12もインストールされます。すべてのインストールを終えるまでは、有線LAN環境で1~2時間以上かかる場合があります。
- [CANDY RED](https://github.com/dbaba/candy-red) ... CANDY EGGクラウドサービスに接続可能なNode-REDベースのフローエディターです。Node.js v0.12またはv4.4が入っていない場合は、Node.js v0.12もインストールされます。すべてのインストールを終えるまでは、有線LAN環境で1~2時間以上かかる場合があります。

# 目次

1. [LTEPi for Dって何?](#ltepi-for-dって何)
1. [対応ハードウェア](#対応ハードウェア)
1. [対応OS](#対応OS)
1. [準備するもの](#準備するもの)
1. [バージョンアップ方法](#バージョンアップ方法)
1. [インストール方法](#インストール方法)
1. [アンインストール方法](#アンインストール方法)
1. [設定](#設定)
1. [LTEPi for D基板のGPIOピンマッピング](#ltepi-for-d基板のgpioピンマッピング)


# [LTEPi for D](http://www.candy-line.io/test/proandsv.html#ltepiford)って何?
Raspberry Pi B+やRaspberry Pi 2 Model Bに取り付けが可能なLTE通信モジュールを搭載した基板です。NTT DOCOMO及びNTT DOCOMOの回線を利用するMVNOのSIMを利用することができます。
Expand Down Expand Up @@ -410,6 +424,8 @@ $ time sudo SRC_DIR=$(pwd) DEBUG=1 CANDY_RED=0 ./install.sh
```

# 履歴
* 1.0.2
- AMP520の初期設定にかかる所要時間を短縮
* 1.0.1
- AMP520において、自動接続モードがデフォルトで有効になるように修正
* 1.0.0
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ VENDOR_HOME=/opt/candy-line

SERVICE_NAME=ltepi2
GITHUB_ID=CANDY-LINE/ltepi2-service
VERSION=1.0.1
VERSION=1.0.2

NODEJS_VERSIONS="v0.12 v4.3"
NODEJS_VERSIONS="v0.12 v4.4"

SERVICE_HOME=${VENDOR_HOME}/${SERVICE_NAME}
SRC_DIR="${SRC_DIR:-/tmp/ltepi2-service-${VERSION}}"
Expand Down
43 changes: 32 additions & 11 deletions systemd/start_systemd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ function wait_for_modem_usb_active {
done
}

function wait_for_modem_usb_acm_inactive {
MAX=40
COUNTER=0
while [ ${COUNTER} -lt ${MAX} ];
do
RET=`lsusb | grep 1ecb:0202`
if [ "$?" != "0" ]; then
break
fi
sleep 0.5
let COUNTER=COUNTER+1
done
}

function wait_for_modem_usb_inactive {
MAX=40
COUNTER=0
Expand Down Expand Up @@ -71,7 +85,10 @@ function enable_auto_connect {
logger -t ltepi2 "Enabling auto-connect mode"
/usr/bin/env python /opt/candy-line/ltepi2/server_main.py ${MODEM_SERIAL_PORT} /var/run/candy-board-service.sock init2
RET=$?
if [ "${RET}" != "0" ]; then
if [ "${RET}" == "1" ]; then
logger -t ltepi2 "** Waiting for USB being inactivated ***"
wait_for_modem_usb_inactive
elif [ "${RET}" != "0" ]; then
exit ${RET}
fi
}
Expand All @@ -90,6 +107,17 @@ function wait_for_default_route {
done
}

function register_usbserial {
# Registering a new id
modprobe usbserial vendor=0x1ecb product=0x0208
RET=$?
if [ "${RET}" != "0" ]; then
if [ -e "/sys/bus/usb-serial/drivers/pl2303" ]; then
echo "1ecb 0208" > /sys/bus/usb-serial/drivers/pl2303/new_id
fi
fi
}

function diagnose_self {
wait_for_modem_usb_active
if [ -z "${MODEM_USB_MODE}" ]; then
Expand All @@ -101,15 +129,15 @@ function diagnose_self {

look_for_serial_port
change_usb_data_conn
wait_for_modem_usb_inactive
wait_for_modem_usb_acm_inactive
wait_for_modem_usb_active
if [ -z "${MODEM_USB_MODE}" ]; then
return
fi

register_usbserial
look_for_serial_port
enable_auto_connect
wait_for_modem_usb_inactive
wait_for_modem_usb_active
if [ -z "${MODEM_USB_MODE}" ]; then
return
Expand All @@ -133,14 +161,7 @@ function activate_lte {
if [ -n "${IF_NAME}" ]; then
ifconfig ${IF_NAME} up
logger -t ltepi2 "The interface [${IF_NAME}] is up!"
# Registering a new id
modprobe usbserial vendor=0x1ecb product=0x0208
RET=$?
if [ "${RET}" != "0" ]; then
if [ -e "/sys/bus/usb-serial/drivers/pl2303" ]; then
echo "1ecb 0208" > /sys/bus/usb-serial/drivers/pl2303/new_id
fi
fi
register_usbserial
look_for_serial_port
wait_for_default_route

Expand Down

0 comments on commit 29e4368

Please sign in to comment.