buglabs-ppp-scripts: Some scripts to enable BUG for different broadband providers
authorStefan Schmidt <stefan@buglabs.net>
Thu, 9 Dec 2010 15:09:08 +0000 (16:09 +0100)
committerStefan Schmidt <stefan@buglabs.net>
Tue, 25 Jan 2011 11:26:44 +0000 (12:26 +0100)
recipes/buglabs/buglabs-ppp-scripts/att [new file with mode: 0755]
recipes/buglabs/buglabs-ppp-scripts/att_chat [new file with mode: 0755]
recipes/buglabs/buglabs-ppp-scripts/cdma [new file with mode: 0755]
recipes/buglabs/buglabs-ppp-scripts/cdma_chat [new file with mode: 0755]
recipes/buglabs/buglabs-ppp-scripts/ip-down.local [new file with mode: 0755]
recipes/buglabs/buglabs-ppp-scripts/ip-up.local [new file with mode: 0755]
recipes/buglabs/buglabs-ppp-scripts/tmobile [new file with mode: 0644]
recipes/buglabs/buglabs-ppp-scripts/tmobile_chat [new file with mode: 0644]
recipes/buglabs/buglabs-ppp-scripts/tmobile_disconnect [new file with mode: 0644]
recipes/buglabs/buglabs-ppp-scripts_0.2.bb [new file with mode: 0644]

diff --git a/recipes/buglabs/buglabs-ppp-scripts/att b/recipes/buglabs/buglabs-ppp-scripts/att
new file mode 100755 (executable)
index 0000000..f940a28
--- /dev/null
@@ -0,0 +1,33 @@
+-detach\r
+lcp-echo-failure 0\r
+/dev/ttyUSB3\r
+115200\r
+debug\r
+defaultroute\r
+usepeerdns\r
+\r
+#ipcp-no-address\r
+#ipcp-no-addresses\r
+ipcp-max-failure 4\r
+ipcp-accept-local\r
+ipcp-accept-remote\r
+#added by John\r
+lcp-echo-interval 20\r
+lcp-echo-failure 4\r
+#persist\r
+#holdoff 15\r
+logfile /var/volatile/log/pppd.log\r
+defaultroute\r
+replacedefaultroute\r
+# AUTHENTICATION\r
+# If noauth works, use that, otherwise you have to pass\r
+# the user name and password. This is an example of a\r
+# standard Cingular user/pw combo\r
+\r
+noauth\r
+#user ISPDA@CINGULARGPRS.COM\r
+#password CINGULAR1\r
+\r
+crtscts\r
+lock\r
+connect '/usr/sbin/chat -v -t6 -f /etc/ppp/peers/att_chat'\r
diff --git a/recipes/buglabs/buglabs-ppp-scripts/att_chat b/recipes/buglabs/buglabs-ppp-scripts/att_chat
new file mode 100755 (executable)
index 0000000..2c671ae
--- /dev/null
@@ -0,0 +1,40 @@
+# Connection script for Sierra Wireless GSM/UMTS modems
+# Note: This demo script is setup to work on the Cingular EDGE network
+#
+SAY 'Starting Sierra Wireless GSM connect script...\n'
+SAY '\n'
+
+#######################################
+SAY 'Setting the abort string\n'
+SAY '\n'
+# Abort String ------------------------------
+ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT DELAYED
+
+#######################################
+SAY 'Initializing modem\n'
+# Modem Initialization 
+'' AT
+OK ATZ
+
+#######################################
+SAY '\n'
+SAY     'Setting APN\n'
+# Access Point Name (APN) 
+# Incorrect APN or CGDCONT can often cause errors in connection.
+# Below are a bunch of different popular APNs
+
+#REG:\s1 AT+cgdcont=1,"IP","proxy"
+#OK     'AT+CGDCONT=0,"IP","proxy"'
+#OK     'AT+CGDCONT=1,"IP","proxy"'
+#OK     'AT+CGDCONT=2,"IP","proxy"'
+#OK     'AT+CGDCONT=0,"IP","ISP.CINGULAR"'
+OK     'AT+CGDCONT=1,"IP","WAP.CINGULAR"'
+#OK     'AT+CGDCONT=2,"IP","ISP.CINGULAR"'
+
+#######################################
+SAY '\n'
+SAY     'Dialing...\n'
+# Dial the ISP, this is the common Cingular dial string
+
+OK ATD*99#
+CONNECT ''
diff --git a/recipes/buglabs/buglabs-ppp-scripts/cdma b/recipes/buglabs/buglabs-ppp-scripts/cdma
new file mode 100755 (executable)
index 0000000..ec31f2b
--- /dev/null
@@ -0,0 +1,13 @@
+-detach\r
+lcp-echo-failure 0\r
+noauth\r
+/dev/ttyUSB0\r
+115200\r
+debug\r
+defaultroute\r
+ipcp-accept-local\r
+ipcp-accept-remote\r
+usepeerdns\r
+crtscts\r
+lock\r
+connect '/usr/sbin/chat -v -t6 -f /etc/ppp/peers/cdma_chat'\r
diff --git a/recipes/buglabs/buglabs-ppp-scripts/cdma_chat b/recipes/buglabs/buglabs-ppp-scripts/cdma_chat
new file mode 100755 (executable)
index 0000000..5445454
--- /dev/null
@@ -0,0 +1,25 @@
+# Connection script for Sierra Wireless CDMA/EVDO modems
+# Note: This demo script is setup to work on Verizon and Sprint
+#       Networks.
+#
+SAY 'Starting Sierra Wireless CDMA connect script...\n'
+SAY '\n'
+
+#######################################
+SAY 'Setting the abort string\n'
+SAY '\n'
+# Abort String ------------------------------
+ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT DELAYED
+
+#######################################
+SAY 'Initializing modem\n'
+# Modem Initialization 
+'' AT
+OK ATZ
+
+#######################################
+SAY '\n'
+SAY     'Dialing...\n'
+OK ATDT#777
+CONNECT ''
+
diff --git a/recipes/buglabs/buglabs-ppp-scripts/ip-down.local b/recipes/buglabs/buglabs-ppp-scripts/ip-down.local
new file mode 100755 (executable)
index 0000000..568c1b6
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+# latest-kernel-support: 2.6.18
+# Author: Kevin Lloyd <linux@sierrawireless.com>
+# Date: 10/20/2006
+
+if [ $# -eq 0 ]; then
+  exit 1
+fi
+
+if [ $1 = ppp0 ]; then
+  mv -f /etc/resolv.conf /etc/resolv.conf.ppp0
+  if [ -e /etc/resolv.conf.orig ]; then
+    cp /etc/resolv.conf.orig /etc/resolv.conf
+  else
+    grep -v ppp0 /etc/resolv.conf.ppp0 > /etc/resolv.conf
+  fi
+  chmod a+r /etc/resolv.conf
+fi
diff --git a/recipes/buglabs/buglabs-ppp-scripts/ip-up.local b/recipes/buglabs/buglabs-ppp-scripts/ip-up.local
new file mode 100755 (executable)
index 0000000..7cf2345
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+# latest-kernel-support: 2.6.18
+# Author: Kevin Lloyd <linux@sierrawireless.com>
+# Date: 10/20/2006
+
+if [ $# -eq 0 ]; then
+  exit 1
+fi
+
+if [ $1 = ppp0 ]; then
+  if [ -e /var/run/ppp/resolv.conf ]; then
+    grep -v ppp0 /etc/resolv.conf > /etc/resolv.conf.orig
+
+    echo \#These entries are from the ppp0 connection > /etc/resolv.conf
+    sed -e 's/$/ #ppp0 entry/g' /var/run/ppp/resolv.conf >> /etc/resolv.conf
+    cat /etc/resolv.conf.orig >> /etc/resolv.conf
+    chmod a+r /etc/resolv.conf
+  elif [ -e /etc/ppp/resolv.conf ]; then
+    grep -v ppp0 /etc/resolv.conf > /etc/resolv.conf.orig
+
+    echo \#These entries are from the ppp0 connection > /etc/resolv.conf
+    sed -e 's/$/ #ppp0 entry/g' /etc/ppp/resolv.conf >> /etc/resolv.conf
+    cat /etc/resolv.conf.orig >> /etc/resolv.conf
+    chmod a+r /etc/resolv.conf
+  fi
+fi
diff --git a/recipes/buglabs/buglabs-ppp-scripts/tmobile b/recipes/buglabs/buglabs-ppp-scripts/tmobile
new file mode 100644 (file)
index 0000000..e547f79
--- /dev/null
@@ -0,0 +1,22 @@
+# File: /etc/ppp/peers/tmobile
+#
+/dev/ttyUSB3
+115200
+crtscts
+lock
+hide-password
+defaultroute # set the default route
+usepeerdns
+holdoff 3
+ipcp-accept-local
+lcp-echo-failure 12
+lcp-echo-interval 3
+noauth
+noipdefault
+novj
+novjccomp
+replacedefaultroute
+debug
+
+connect "/usr/sbin/chat -v -f /etc/ppp/peers/tmobile_chat"
+disconnect "/usr/sbin/chat -v -f /etc/ppp/peers/tmobile_disconnect
\ No newline at end of file
diff --git a/recipes/buglabs/buglabs-ppp-scripts/tmobile_chat b/recipes/buglabs/buglabs-ppp-scripts/tmobile_chat
new file mode 100644 (file)
index 0000000..d9e2ec8
--- /dev/null
@@ -0,0 +1,14 @@
+TIMEOUT 10
+ABORT 'BUSY'
+ABORT 'NO ANSWER'
+ABORT 'ERROR'
+SAY 'Starting GPRS connect script\n'
+
+""'ATZ'
+SAY 'Setting APN\n'
+OK 'AT+CGDCONT=1,"IP","internet2.voicestream.com"'
+
+ABORT 'NO CARRIER'
+SAY 'Dialing...\n'
+OK 'ATD*99***1#'
+CONNECT 
diff --git a/recipes/buglabs/buglabs-ppp-scripts/tmobile_disconnect b/recipes/buglabs/buglabs-ppp-scripts/tmobile_disconnect
new file mode 100644 (file)
index 0000000..f1302e2
--- /dev/null
@@ -0,0 +1,3 @@
+"" "\K"
+"" "+++ATH0"
+SAY "GPRS disconnected."
\ No newline at end of file
diff --git a/recipes/buglabs/buglabs-ppp-scripts_0.2.bb b/recipes/buglabs/buglabs-ppp-scripts_0.2.bb
new file mode 100644 (file)
index 0000000..5dad570
--- /dev/null
@@ -0,0 +1,29 @@
+DESCRIPTION = "PPP Scripts for BUG"
+LICENSE = "GPL"
+RDEPENDS_${PN} = "udev"
+PR = "r0"
+
+SRC_URI = "file://att \
+       file://att_chat \
+       file://ip-down.local \
+       file://ip-up.local \
+       file://cdma \
+       file://cdma_chat \
+       file://tmobile \
+       file://tmobile_chat \
+       file://tmobile_disconnect \
+       "
+
+S = ${WORKDIR}
+
+PACKAGE_ARCH = "all"
+
+do_install() {
+    install -d ${D}/etc
+    install -d ${D}/etc/ppp
+    install -d ${D}/etc/ppp/peers
+    install -m 0644 att* ${D}/etc/ppp/peers
+    install -m 0644 ip* ${D}/etc/ppp
+    install -m 0644 tmobile* ${D}/etc/ppp/peers
+    install -m 0644 cdma* ${D}/etc/ppp/peers/
+}