MarcusW Posted April 18, 2012 Posted April 18, 2012 Hi, I've just been trying to come up with the magic 3g.sh recipe that will get my Novatel 2352 (aka MiFi) registered with my Pineapple, attached via the USB port. I feel I'm close, but I'm missing something. Pineapple Firmware: 1.1.1 lsusb output: Bus 001 Device 008: ID 1410:7001 Novatel Wireless Now it doesn't seem to need modeswitching as insmod usbserial *appears* to work. I'm getting responses to my AT commands. 3g.sh section: *1410:7001*) echo "Novatel 2352 (MiFi) detected" uci delete network.wan2 uci set network.wan2=interface uci set network.wan2.ifname=ppp0 uci set network.wan2.proto=3g uci set network.wan2.service=umts uci set network.wan2.device=/dev/ttyUSB0 uci set network.wan2.apn=general.t-mobile.uk uci set network.wan2.username= uci set network.wan2.password= uci set network.wan2.defaultroute=1 uci set network.wan2.ppp_redial=persist uci set network.wan2.peerdns=0 uci set network.wan2.dns=8.8.8.8 uci set network.wan2.keepalive=1 uci set network.wan2.pppd_options=debug uci set network.wan2.pppd_options=noauth uci commit network #No modeswitch appears necessary sleep 3; rmmod usbserial sleep 3; insmod usbserial vendor=0x1410 product=0x7001 iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT ;; When 3g.sh is run, the following appears in the log: Jan 1 01:35:26 Pineapple user.notice 3g-hotplug: Starting interface wan2 for device ttyUSB0 Jan 1 01:35:30 Pineapple daemon.notice pppd[6473]: pppd 2.4.5 started by root, uid 0 Jan 1 01:35:31 Pineapple local2.info chat[6478]: abort on (BUSY) Jan 1 01:35:31 Pineapple local2.info chat[6478]: abort on (NO CARRIER) Jan 1 01:35:31 Pineapple local2.info chat[6478]: abort on (ERROR) Jan 1 01:35:31 Pineapple local2.info chat[6478]: report (CONNECT) Jan 1 01:35:31 Pineapple local2.info chat[6478]: timeout set to 10 seconds Jan 1 01:35:31 Pineapple local2.info chat[6478]: send (AT+CSQ^M) Jan 1 01:35:31 Pineapple local2.info chat[6478]: expect (OK) Jan 1 01:35:31 Pineapple local2.info chat[6478]: AT+CSQ^M^M Jan 1 01:35:31 Pineapple local2.info chat[6478]: +CSQ: 16,99^M Jan 1 01:35:31 Pineapple local2.info chat[6478]: ^M Jan 1 01:35:31 Pineapple local2.info chat[6478]: OK Jan 1 01:35:31 Pineapple local2.info chat[6478]: -- got it Jan 1 01:35:31 Pineapple local2.info chat[6478]: send (ATE1^M) Jan 1 01:35:31 Pineapple local2.info chat[6478]: expect (OK) Jan 1 01:35:31 Pineapple local2.info chat[6478]: ^M Jan 1 01:35:31 Pineapple local2.info chat[6478]: ATE1^M^M Jan 1 01:35:31 Pineapple local2.info chat[6478]: OK Jan 1 01:35:31 Pineapple local2.info chat[6478]: -- got it Jan 1 01:35:31 Pineapple local2.info chat[6478]: send (AT+CGDCONT=1,"IP","general.t-mobile.uk"^M) Jan 1 01:35:32 Pineapple local2.info chat[6478]: timeout set to 30 seconds Jan 1 01:35:32 Pineapple local2.info chat[6478]: expect (OK) Jan 1 01:35:32 Pineapple local2.info chat[6478]: ^M Jan 1 01:35:32 Pineapple local2.info chat[6478]: AT+CGDCONT=1,"IP","general.t-mobile.uk"^M^M Jan 1 01:35:32 Pineapple local2.info chat[6478]: OK Jan 1 01:35:32 Pineapple local2.info chat[6478]: -- got it Jan 1 01:35:32 Pineapple local2.info chat[6478]: send (ATD*99***1#^M) Jan 1 01:35:32 Pineapple local2.info chat[6478]: expect (CONNECT) Jan 1 01:35:32 Pineapple local2.info chat[6478]: ^M Jan 1 01:35:32 Pineapple local2.info chat[6478]: ATD*99***1#^M Jan 1 01:35:32 Pineapple local2.info chat[6478]: CONNECT Jan 1 01:35:32 Pineapple local2.info chat[6478]: -- got it Jan 1 01:35:32 Pineapple local2.info chat[6478]: send ( ^M) Jan 1 01:35:32 Pineapple daemon.info pppd[6473]: Serial connection established. Jan 1 01:35:32 Pineapple daemon.info pppd[6473]: Using interface 3g-wan2 Jan 1 01:35:32 Pineapple daemon.notice pppd[6473]: Connect: 3g-wan2 <--> /dev/ttyUSB0 Jan 1 01:35:37 Pineapple daemon.warn pppd[6473]: Could not determine remote IP address: defaulting to 10.64.64.64 Jan 1 01:35:37 Pineapple daemon.notice pppd[6473]: replacing old default route to br-lan [172.16.42.42] Jan 1 01:35:37 Pineapple daemon.notice pppd[6473]: local IP address 31.104.103.253 Jan 1 01:35:37 Pineapple daemon.notice pppd[6473]: remote IP address 10.64.64.64 Jan 1 01:35:37 Pineapple daemon.notice pppd[6473]: primary DNS address 149.254.230.7 Jan 1 01:35:37 Pineapple daemon.notice pppd[6473]: secondary DNS address 149.254.192.126 Jan 1 01:35:37 Pineapple user.notice ifup: Enabling Router Solicitations on wan2 (3g-wan2) Jan 1 01:35:37 Pineapple user.info autossh[6554]: starting ssh (count 1) Jan 1 01:35:37 Pineapple user.info autossh[6554]: ssh child pid is 6555 Jan 1 01:35:37 Pineapple user.err autossh[6554]: ssh exited prematurely with status 1; autossh exiting Jan 1 01:35:48 Pineapple daemon.info pppd[6473]: No response to 1 echo-requests Jan 1 01:35:48 Pineapple daemon.notice pppd[6473]: Serial link appears to be disconnected. Jan 1 01:35:48 Pineapple daemon.info pppd[6473]: Connect time 0.2 minutes. Jan 1 01:35:48 Pineapple daemon.info pppd[6473]: Sent 2827 bytes, received 0 bytes. Jan 1 01:35:48 Pineapple daemon.notice pppd[6473]: restoring old default route to br-lan [172.16.42.42] Jan 1 01:35:54 Pineapple daemon.notice pppd[6473]: Connection terminated. Jan 1 01:35:55 Pineapple daemon.notice pppd[6473]: Modem hangup From 01:35:37 onwards is where things seem to go pear shaped. At times I've had bytes sent and received,but the connection doesn't appear for long. Any ideas, anyone? Quote
MarcusW Posted April 23, 2012 Author Posted April 23, 2012 Hrm. Connection issue resolved. It was the 'ppp_redial=persist' which caused the echo-checking. Removed that, and things started working. *1410:7001*) echo "Novatel 2352 (MiFi) detected. Attempting mode switch" uci delete network.wan2 uci set network.wan2=interface uci set network.wan2.ifname=ppp0 uci set network.wan2.proto=3g uci set network.wan2.service=umts uci set network.wan2.device=/dev/ttyUSB0 uci set network.wan2.apn=general.t-mobile.uk uci set network.wan2.defaultroute=1 uci set network.wan2.peerdns=1 uci set network.wan2.dns=8.8.8.8 uci set network.wan2.keepalive=1 uci set network.wan2.pppd_options=persist uci set network.wan2.pppd_options=debug uci set network.wan2.pppd_options=noauth uci commit network rmmod usbserial sleep 3; insmod usbserial vendor=0x1410 product=0x7001 iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT ;; ...and here's the log: Jan 1 01:46:39 Pineapple kern.info kernel: [ 6399.410000] usbserial: USB Serial Driver core Jan 1 01:46:39 Pineapple user.notice 3g-hotplug: Starting interface wan2 for device ttyUSB0 Jan 1 01:46:44 Pineapple daemon.notice pppd[2668]: pppd 2.4.5 started by root, uid 0 Jan 1 01:46:45 Pineapple local2.info chat[2673]: abort on (BUSY) Jan 1 01:46:45 Pineapple local2.info chat[2673]: abort on (NO CARRIER) Jan 1 01:46:45 Pineapple local2.info chat[2673]: abort on (ERROR) Jan 1 01:46:45 Pineapple local2.info chat[2673]: report (CONNECT) Jan 1 01:46:45 Pineapple local2.info chat[2673]: timeout set to 10 seconds Jan 1 01:46:45 Pineapple local2.info chat[2673]: send (AT&F^M) Jan 1 01:46:45 Pineapple local2.info chat[2673]: expect (OK) Jan 1 01:46:45 Pineapple local2.info chat[2673]: AT&F^M^M Jan 1 01:46:45 Pineapple local2.info chat[2673]: OK Jan 1 01:46:45 Pineapple local2.info chat[2673]: -- got it Jan 1 01:46:45 Pineapple local2.info chat[2673]: send (ATE1^M) Jan 1 01:46:45 Pineapple local2.info chat[2673]: expect (OK) Jan 1 01:46:45 Pineapple local2.info chat[2673]: ^M Jan 1 01:46:45 Pineapple local2.info chat[2673]: ATE1^M^M Jan 1 01:46:45 Pineapple local2.info chat[2673]: OK Jan 1 01:46:45 Pineapple local2.info chat[2673]: -- got it Jan 1 01:46:45 Pineapple local2.info chat[2673]: send (AT+CGDCONT=1,"IP","general.t-mobile.uk"^M) Jan 1 01:46:46 Pineapple local2.info chat[2673]: timeout set to 30 seconds Jan 1 01:46:46 Pineapple local2.info chat[2673]: expect (OK) Jan 1 01:46:46 Pineapple local2.info chat[2673]: ^M Jan 1 01:46:46 Pineapple local2.info chat[2673]: AT+CGDCONT=1,"IP","general.t-mobile.uk"^M^M Jan 1 01:46:46 Pineapple local2.info chat[2673]: OK Jan 1 01:46:46 Pineapple local2.info chat[2673]: -- got it Jan 1 01:46:46 Pineapple local2.info chat[2673]: send (ATD*99***1#^M) Jan 1 01:46:46 Pineapple local2.info chat[2673]: expect (CONNECT) Jan 1 01:46:46 Pineapple local2.info chat[2673]: ^M Jan 1 01:46:46 Pineapple local2.info chat[2673]: ATD*99***1#^M^M Jan 1 01:46:46 Pineapple local2.info chat[2673]: CONNECT Jan 1 01:46:46 Pineapple local2.info chat[2673]: -- got it Jan 1 01:46:46 Pineapple local2.info chat[2673]: send ( ^M) Jan 1 01:46:46 Pineapple daemon.info pppd[2668]: Serial connection established. Jan 1 01:46:46 Pineapple daemon.info pppd[2668]: Using interface 3g-wan2 Jan 1 01:46:46 Pineapple daemon.notice pppd[2668]: Connect: 3g-wan2 <--> /dev/ttyUSB0 Jan 1 01:46:51 Pineapple daemon.warn pppd[2668]: Could not determine remote IP address: defaulting to 10.64.64.64 Jan 1 01:46:51 Pineapple daemon.notice pppd[2668]: replacing old default route to br-lan [172.16.42.42] Jan 1 01:46:51 Pineapple daemon.notice pppd[2668]: local IP address 178.104.136.52 Jan 1 01:46:51 Pineapple daemon.notice pppd[2668]: remote IP address 10.64.64.64 Jan 1 01:46:51 Pineapple daemon.notice pppd[2668]: primary DNS address 149.254.230.7 Jan 1 01:46:51 Pineapple daemon.notice pppd[2668]: secondary DNS address 149.254.192.126 Jan 1 01:46:52 Pineapple user.notice ifup: Enabling Router Solicitations on wan2 (3g-wan2) Jan 1 01:46:52 Pineapple user.info autossh[2752]: starting ssh (count 1) Jan 1 01:46:52 Pineapple user.info autossh[2752]: ssh child pid is 2753 Jan 1 01:46:52 Pineapple user.err autossh[2752]: ssh exited prematurely with status 1; autossh exiting Jan 1 01:46:55 Pineapple daemon.info dnsmasq[1678]: reading /tmp/resolv.conf.auto Jan 1 01:46:55 Pineapple daemon.info dnsmasq[1678]: using nameserver 149.254.192.126#53 Jan 1 01:46:55 Pineapple daemon.info dnsmasq[1678]: using nameserver 149.254.230.7#53 Jan 1 01:46:55 Pineapple daemon.info dnsmasq[1678]: using nameserver 8.8.8.8#53 Jan 1 01:46:55 Pineapple daemon.info dnsmasq[1678]: using local addresses only for domain lan The MIFI has a tendency to connect as USB ID 1410:5041 or 1410:7001. If it's the former, I need to change usb_modeswitch it, which I still need to figure out. I'll do the USB sniffing to check what the command to change modes is. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.