OpenWrt Forum Archive

Topic: 3G WAN starts as deactivated on VIA C3 - have to be activated manually

The content of this topic has been archived on 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have set up a 3G system for my car with an old VIA C3, a Huawei e220 and of course OpenWRT with Josefsson's writeup here: http://josefsson.org/openwrt/dongle.html

Everything works except for one thing: When I start the box, it will start with WAN (the Huawei) deactivated. I can activate it in two ways: Either change something (anything, really) on the WAN configuration page and click "save and apply" or by activating it on the Interfaces page and click "save and apply". It will be online within seconds. But this is of course a pain in the you know what, especially since this box will have to be turned off when not in use, both to avoid a lot of unnecessary data traffic and not to drain the car's battery when it's parked. Does anybody have a good idea here?

Thanks in advance!

Have you added and enabled the init script mentioned in that howto?

I'm talking about this one:

root@caramel:/etc/rc.d# cat>/etc/init.d/wan
#!/bin/sh /etc/rc.common
# Written by Simon Josefsson 2009-03-05.  Released into the public domain.

START=90
start() {
        ifup wan
}
^D
root@caramel:/etc/rc.d# chmod +x /etc/init.d/wan
root@caramel:/etc/rc.d# /etc/init.d/wan enable
root@caramel:/etc/rc.d#

(Note the chmod and enable lines at the end there)
If you've already added those, try typing logread just after the system starts up and look through the output for something relating to wan or the dongle.

Woops... That one I did not see. I only saw the script that was meant to activate the serial ports, and they were activated. I thought that script only was for when you wanted to keep the regular broadband connection as the "real" connection. But now it works flawlessly. Thank you very much! big_smile

Woops! This doesn't work reliably. sad If I do a correct reboot, it works. But if I pull the plug on the computer and start again (which is going to be the normal way of doing this) the WAN doesn't start as it should.

In the log I see "CHAP authentication succededed", but then "No response to 5 echo-requests", "Serial Link appears to be disconnected", "Connection terminated." "Modem hangup". Any idea what that can be?

I've only followed that howto as well, so we're getting beyond my experience unfortunately. I'm guessing the dongle is still in the process of trying to sign into the network when the script tells it to go online, and after it fails to connect it just gives up. This is a shot in the dark, but try editing /etc/config/network and adding the line

option ppp_redial persist

to the wan configuration bit. I assume that'll make it keep trying to establish the connection if it's down or fails to connect for whatever reason. (I haven't tested this)

staylo wrote:

option ppp_redial persist

root@OpenWrt:~# uci set network.wan.ppp_redial=persist
root@OpenWrt:~# uci commit network
root@OpenWrt:~# reboot

To delete the config option do:

root@OpenWrt:~# uci del network.wan.ppp_redial
root@OpenWrt:~# uci commit network
root@OpenWrt:~# reboot

(Last edited by Dogge on 10 Oct 2009, 12:58)

Thanks, but that did not help. sad I prefer to work in GUI, so I opened the network configuration file in Ubuntu and added the line. Then I did what Dogge said (are we talking a fellow molosser owner here?) in Telnet. It still works after a nice reboot or a nice shutdown, but not when I pull the plug and put it in again.

That may be a different problem. Now my log reads: "Timeout checking for PIN.wan (3g): Failed to set the PIN code." And I don't have a PIN code on that SIM.

Edit: I only saw that PIN code thing once. But I still get the same problem with the 5 echos at first. But now the link comes in a couple of minutes after the first attempt. So that's a step forward! smile Is there a way to reduce the time between attempts?

Edit 2: It comes in every time, but it can take up to 4 minutes. My very impatient kids will make me crazy... Please help me!

(Last edited by Mastiff on 10 Oct 2009, 13:36)

More and more confusing... Now it suddenly won't work until I rename the "Interface" for Wan from wan to ppp0 or vice versa, depending on what it was called when it fired! sad

Try adding

option ppp_redialperiod 60

(where 60 is the number of seconds between detection of a downed connection and the first redial attempt)

to the appropriate section of /etc/conf/network to tackle the redial time issue.

Regarding renaming interfaces, one problem will be that the init script added at the start of this thread won't be modified by the GUI, so you'll have to manually edit it to match the name of the interface.

Thanks! I had to put the thing aside for now (I was too close to smashing it after several failed attempts). I'm going to try again next week... wink

I had the 'Timeout: failed to set the PIN code' error when experimenting with my modem this weekend too. It turns out the PIN code bit is irrelevant, the error is because commands being sent to the modem are timing out without a reply. In my case this was because a previous connection was still active, but mileage (and causes) may vary...

Interesting! Maybe the modem occasionally tries to connect before the connection is ready. Anyway I'm a lot closer now, it connects correctly most of the time. I did a full setup from the ground again, and it seemed to help. I probably had messed around with too many different scripts and packages...

The discussion might have continued from here.