Home Page › Forums › Network Management › ZeroShell › 3G CDMA Modem
This topic contains 9 replies, has 0 voices, and was last updated by kasus 8 years, 7 months ago.
-
AuthorPosts
-
January 14, 2009 at 9:55 pm #41403
Hello,
I have 3G USB Modem, but not UMTS. It’s CDMA – CMOtech CCU-550 (PeopleNET Operator in Ukraine).
It don’t use APN, tel number is #777, and
the main is it requires authorization with login-password.
But zeroshell webUI don’t have fields Username and
Password and it have APN , which is wrong for my modem.Help me please, how to install my modem to work
on zeroshell. If you want – I can give you SSH access to
test it or webUI. It works good on windows and on linux
with kppp or gnome-ppp.This is part of my dmesg:
hub 1-0:1.0: unable to enumerate USB device on port 1
hub 1-0:1.0: unable to enumerate USB device on port 1
usb 2-1: new full speed USB device using ohci_hcd and address 4
usb 2-1: configuration #1 chosen from 1 choice
cdc_acm 2-1:1.0: ttyACM0: USB ACM device
usb 2-1: New USB device found, idVendor=16d8, idProduct=5533
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1: Product: CMOTECH CDMA Technologies
usb 2-1: Manufacturer: CMOTECH CO., LTD.
usb 2-1: SerialNumber: Serial Number
PPP generic driver version 2.4.2
January 15, 2009 at 6:53 pm #47409Yeah, I have done this!
It’s need additional AT command ATZ and to add user and password field to /root/kerbynet.cgi/scripts/3Gconnect!
Fulvio, I tried to create additional fields in the /root/kerbynet.cgi/template/3Gconfig, but I don’t understand how to write data to /var/register/net/interfaces/pppX .
I add USERNAME=$10 and PASSWORD=$11 to /root/kerbynet.cgi/scripts/make3G and to config3G scripts but it write to
/var/register/net/interfaces/ppp0/USERNAME and PASSWORD files some “ppp01” value.January 15, 2009 at 7:22 pm #47410USERNAME=${10} and PASSWORD=${11}
January 15, 2009 at 8:41 pm #47411I tried to do like you say, but USERNAME and PASSWORD files in /var/register/net/interfaces/ppp0 are empty now 🙁
I have this /root/kerbynet.cgi/template/3Gconfig file:
#!/bin/sh
. /etc/kerbynet.conf
. $SCRIPTS/net.inc
NAME="$1"
DESCRIPTION="$2"
TTY="$3"
APN="$4"
DIAL="$5"
OPTIONAL="$6"
DEFAULTROUTE="$7"
AUTO="$8"
NAT="$9"
USERNAME=${10}
PASSWORD=${11}
[ -z "$NAME" ] && exit 1
CONFIG="$REGISTER/system/net/interfaces/"
PPPDIR="$CONFIG/$NAME"
echo "$DESCRIPTION" > $PPPDIR/Description
echo "$TTY" > $PPPDIR/TTY
echo "$APN" > $PPPDIR/APN
echo "$DIAL" > $PPPDIR/Dial
echo "$OPTIONAL" > $PPPDIR/Optional
echo "$DEFAULTROUTE" > $PPPDIR/DEFAULTROUTE
echo "$AUTO" > $PPPDIR/Auto
echo "$USERNAME" > $PPPDIR/USERNAME
echo "$PASSWORD" > $PPPDIR/PASSWORD
if [ "$NAT" == yes ] ; then
mkdir -p $PPPDIR/NAT/Masquerade
iptables -t nat -D POSTROUTING -o $NAME -j MASQUERADE 2> /dev/null
iptables -t nat -A POSTROUTING -o $NAME -j MASQUERADE
else
rm -rf $PPPDIR/NAT/Masquerade
iptables -t nat -D POSTROUTING -o $NAME -j MASQUERADE 2>/dev/null
fi
if ps -ef |grep 3Gconnect |grep -q $NAME || [ "$AUTO" == yes ] ; then
$SCRIPTS/3Gconnect_stop $NAME
$SCRIPTS/3Gconnect $NAME &
fiAnd this is my make3G file is made like-this.
This is my 3Gconnect file:
#!/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 <<EOF
/udev/$TTY
921600
lock
crtscts
modem
noauth
$USERNAME
$PASSWORD
$DEFAULTROUTE
connect "$SCRIPTS/chat.sh"
unit $UNIT
EOF
cat > /tmp/$PPP.chat <<EOF
ABORT BUSY
ABORT 'NO CARRIER'
ABORT ERROR
REPORT CONNECT
TIMEOUT 15
"" AT
$OPTIONAL
$APN
"OK" "ATD$DIAL"
CONNECT c
EOF
while true; do
PID=`ps -ef |grep -w pppd |grep $PPP| awk '{print $2}'`
if [ -z "$PID" ] ; then
if [ -r /udev/$TTY ] ; then
pppd file /tmp/$PPP.3G 2>/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
doneAnd this is my /root/kerbynet.cgi/template/3Gconfig:
2G/3G Mobile Connection
function loaded() {
X=document.data;
X.TTY.value="";
X.Auto.value="";
X.Defaultroute.value="";
X.NAT.value="";
X.USERNAME.value="";
X.PASSWORD.value="";
}
function SubmitData() {
X=document.data;
if (X.TTY.value=="") {
alert('"Modem connected to" field cannot be empty.');
return;
}
X.submit();
}
So, where is error? 🙂
January 20, 2009 at 7:00 am #47412Sorry, I forgot to out here my 3g_tty_list script. I’ll post in at the evening, ok?
January 20, 2009 at 2:09 pm #47413Fulvio, this is very important!
When I pluged in my USB modem it was detected as /udev/ttyACM0. But webUI says me that there ano no detected modems. So, I modify /root/kerbynet.cgi/scripts/3g_tty_list:#!/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"
doneWhen I modify this script, modem in the Web Intreface was sucessfuly detected. You can add this upgrade to solve problems with ACM devices.
This is very bad solve of this problem, but it works for me…January 20, 2009 at 7:17 pm #47414Ok, I will add that in the next release.
Regards
FulvioMarch 9, 2009 at 4:28 pm #47415Since the script is not in persistance storage, you don’t need to modify directly to the script.
So, I just store the patch in persistance storage /DB and copy the patch from
preboot script in startup/cron menu.# patch 3Gconnect script for ppp connection with username and password
cp /DB/3Gconnect_patch_user_paswd /root/kerbynet.cgi/scripts/3GconnectThe 3Gconnect_patch_user_paswd file like in the modified 3Gconnect previous post by kasus.
I think zeroshell want to keep username and password secret, so this information is not in web UI.
I also add directly the register variable USERNAME and PASSWORD.
/DB/_DB.001/var/register/system/net/interfaces/ppp0Hopefully this sharing, can help you.
May 18, 2010 at 8:47 am #47416@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
done2) 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 alltelNOTE: 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/scriptsREBOOT 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.July 6, 2010 at 12:23 am #47417Hi,
I have a cdma modem (huawei e220)
The dial string is: 777
APN and Optional AT string are empty.The log is:
23:04:00 pppd 2.4.3 started by root, uid 0
23:04:02 Serial connection established.
23:04:02 Using interface ppp0
23:04:02 Connect: ppp0 /udev/ttyUSB0
23:04:07 local IP address 10.200.35.111
23:04:07 remote IP address 192.168.1.136
23:04:07 LCP terminated by peer
23:04:07 Connect time 0.0 minutes.
23:04:07 Sent 0 bytes, received 0 bytes.
23:04:10 Connection terminated.
23:04:11 Connect script failed
23:04:11 Modem hangup
23:04:11 Exit.So apparently his getting connected and after the connexion terminated !
Strange, no?What could be the solution?
Tks
July 10, 2010 at 10:47 am #47418Hello Guys!
My CDMA ISP: Intertelecom (Ukraine) used authentification by login/pass
Add this line in Pre Boot script from Web GUI:
echo "IT * IT" >> /tmp/ppp-secrets
sed -i 's/noauth/user ITnusepeerdns/' /root/kerbynet.cgi/scripts/3Gconnect
enjoy!
All worked 🙂 -
AuthorPosts
You must be logged in to reply to this topic.