Re: Re: cdma access with username password resolved

Home Page Forums Network Management ZeroShell 3G CDMA Modem Re: Re: cdma access with username password resolved

#47416

scegg
Participant

@mcumbee wrote:

YAAAAAAA!!!! it works!! your last set of instructions did the trick…thank-you

Here is the process for anyone else that needs username password for 3G this
will work with US carriers Alltel as is, with Verizon I understand that you have
to use the APN field. I believe that Sprint will also work this way it would be nice if
a Sprint user would try it. I’m sure that it should work with CDMA carriers outside
the U.S.

1) place the following two files in the /DB directory:
filename: 3g_tty_list
code:
#!/bin/sh
. /etc/kerbynet.conf
. $SCRIPTS/net.inc
CONFIG=”/udev”
cd $CONFIG
INTERFACES=`ls -d ttyUSB* 2>/dev/null`
if [ -z “$INTERFACES” ] ; then
INTERFACES=`ls -d ttyACM* 2>/dev/null`
fi
if [ -z “$INTERFACES” ] ; then
echo “Not detected”
exit
fi
for I in $INTERFACES ; do
echo “$I”
done



filename:3Gconnect
code:
#!/bin/bash
. /etc/kerbynet.conf
export PPP=”$1″
[ -z “$PPP” ] && exit 1
UNIT=${PPP:3:1}
I=0
PID=`ps -ef |grep -w pppd |grep $PPP| awk ‘{print $2}’`
while [ -n “$PID” -a $I -lt 15 ] ; do
kill $PID
sleep 1
I=$((I+1))
PID=`ps -ef |grep -w pppd |grep $PPP| awk ‘{print $2}’`
done
if [ -n “$PID” ] ; then
kill -9 $PID
sleep 1
rm -f /var/run/$PPP.pid
fi
TTY=”`cat $REGISTER/system/net/interfaces/$PPP/TTY 2>/dev/null`”
if [ “$TTY” = NotDetected ] ; then
exit 1
fi
APN=”`cat $REGISTER/system/net/interfaces/$PPP/APN 2>/dev/null`”
DIAL=”`cat $REGISTER/system/net/interfaces/$PPP/Dial 2>/dev/null`”
OPTIONAL=”`cat $REGISTER/system/net/interfaces/$PPP/Optional 2>/dev/null`”
DEFAULTROUTE=”`cat $REGISTER/system/net/interfaces/$PPP/DEFAULTROUTE 2>/dev/null`”
USERNAME=”`cat $REGISTER/system/net/interfaces/$PPP/USERNAME 2>/dev/null`”
PASSWORD=”`cat $REGISTER/system/net/interfaces/$PPP/PASSWORD 2>/dev/null`”
if [ -n “$OPTIONAL” ] ; then
OPTIONAL=””OK” “$OPTIONAL””
fi
if [ -n “$APN” ] ; then
APN=””OK” ‘AT+CGDCONT=1,”IP”,”$APN”,””,0,0′”
fi
if [ -n “$USERNAME” ] ; then
USERNAME=”user $USERNAME”
else
USERNAME=””
fi
if [ -n “$PASSWORD” ] ; then
PASSWORD=”password $PASSWORD”
else
PASSWORD=””
fi
if [ “$DEFAULTROUTE” == yes ] ; then
DEFAULTROUTE=defaultroute
else
DEFAULTROUTE=””
fi
cat > /tmp/$PPP.3G < /tmp/$PPP.chat </dev/null
else
$SCRIPTS/usb_modem_try.sh 2>/dev/null >/dev/null
sleep 5
if ! [ -r /udev/$TTY ] ; then
logger -t pppd “ppp$UNIT: ERROR: Modem /udev/$TTY unavailable.”
sleep 20
fi
fi
fi
sleep 10
done

2) create your connection using the web GUI so that it makes the ppp0 directory
3)using vim create the following two files under /var/register/system/net/interfaces/ppp0
filename:USERNAME
(the contents being the username usually modem phone number@carrier.net—xxxxxxxxxx@carriername.net)

filename:PASSWORD
in the case of alltel it is simply alltel

NOTE: this placed these files in persistent storage for me so no need for a cron job to
do this unless you are using the CD instead of a card or HD.

4) using the web GUI create the following preboot script(cron)
CODE:
cp /DB/3Gconnect /root/kerbynet.cgi/scripts
cp /DB/3g_tty_list /root/kerbynet.cgi/scripts

REBOOT THE SERVER AND DONE.

I hope that this is easily understandable, the scripts were by kasus and are in his
original posts.

I’ve done this job but still no luck.

When I tried to enable 3G link, I got this in log:
16:34:58 pppd 2.4.3 started by root, uid 0
16:35:01 Connect script failed
16:35:01 Exit.