OpenWrt Forum Archive

Topic: Autologin script

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.

Hi all,

This script works ok with OpenWRT Backfire (10.03.1) but not with OpenWRT Barrier Breaker (14.07) -> hotplug2 not available.

Localization of the script:
etc/hotplug.d/iface/99-login-zon   

Code
#!/bin/sh

if [ "$INTERFACE" = "wwan" ] && ([ "$ACTION" = "ifup" ] || [ "$ACTION" = "update" ]); then
   wget -qO- --output-document=portal.html --no-check-certificate --save-cookies=cookie --keep-session-cookies http://search.yacy.net
   POST_URL=$(cat portal.html | grep 'action="https://zon' | cut -d \" -f 4)
   if [ -n "$POST_URL" ]; then
      wget -qO- --output-document=/dev/null --no-check-certificate --load-cookies=cookie --keep-session-cookies --post-data="USERNAME=<your_email>&PASSWORD=<your_pswd>&remember=on" $POST_URL
   fi
   rm cookie portal.html
fi

As the hotplug was phased out with r36003, I think this script needs to be converted to be compatible with OpenWRT Barrier Breaker (14.07)

Any ideas how to solve this problem and make it compatible?

Note: The purpose of this script is to automatically do the login into a Portuguese hotspot using valid credentials user (email account) and password.

Thanks in advance and best regards,
Pedro A.

(Last edited by gandamaluko on 9 May 2015, 10:53)

UP!!! Anyone?...

Why would it not be compatible? The module performing hotplug actions was changed, but hotplug scripts work just like earlier.

do you get errors from it?
have you installed GNU wget package? (possibly the busybox wget does not include all needed functionality)

EDIT:
One deeper possibility: Maybe you need to explicitly place the document into /tmp/portal.html , in case the wget can't write into the current directory. That might lead into an obscure error. Something like that might have changed since the Backfire 10.03

(Last edited by hnyman on 2 May 2015, 19:55)

Hello everyone

As grandamaluko I'm also trying for this script to run.

I have a TPLINK 1043nd V2.1 and after 5 min of the purchase was already with the barrier breaker. smile

I have some questions:

I read in the forum dd-wrt some members used open-wrt 10.03.1 and got it working, they used the packages: wget (NOTwget-nossl), zlib and libopenssl, they used wget_1.13.4-1 but to baririer breaker wget is 1.16-1, can this make any difference?

Another issue is that the script the username and password at the beginning and end term the signs <>, these signals have to be written or not?

= "USERNAME = <meu@email.com> & PASSWORD = <12345678> = on & remember

our

= "USERNAME=meu@email.com&PASSWORD=123456789&remember=on

I saw these informations this topic.

http://www.dd-wrt.com/phpBB2/viewtopic. … 0c885bb620

Thank you all

The newer wget should be better, should not make difference.

At least for me the address  http://search.yacy.net times out, so make sure that you change the address to something that is reachable.
The < and > are just illustrative placeholders to highlight <username> to the user, not to be included in the script.

Possible errors:
interface you need to check is not wwan, but normal wan ? Is it really wwan for you? or something else?

ISP has changed the portal address. Does it still start with https://zon ?

Does the portal address get parsed correctly?

You might add a logging statements to check that the script gets launched and that the portal address gets parsed correctly:

   logger "ISP portal hotplug action"
   wget -qO- --output-document=portal.html --no-check-certificate --save-cookies=cookie --keep-session-cookies http://search.yacy.net
   POST_URL=$(cat portal.html | grep 'action="https://zon' | cut -d \" -f 4)
   logger "ISP portal URL: $POST_URL"
   if [ -n "$POST_URL" ]; then

(Last edited by hnyman on 3 May 2015, 08:10)

hello
thanks for the answer

I can replace ? :

http://search.yacy.net
by:
http://google.com

is the WWAN interface

http://i60.tinypic.com/2r2rz94.jpg

The ISP is:

https: //nos.portal.fon.com/JUNZON01/sec/de1dbb8076eae0d9406657c11e3 ....

They changed the name from ZON to  NOS last year.

TY.

(Last edited by dannycosta on 3 May 2015, 21:39)

Hi hnyman,

Sorry for my late reply... At this moment I'm also using the WWAN to test the script... but without success...

As daniel, I confirm the https://nos.portal.fon.com... So I made some changes in the script:

#!/bin/sh

if [ "$INTERFACE" = "wwan" ] && ([ "$ACTION" = "ifup" ] || [ "$ACTION" = "update" ]); then
    wget -qO- --output-document=portal.html --no-check-certificate --save-cookies=cookie --keep-session-cookies https://www.google.pt
    POST_URL=$(cat portal.html | grep 'action="https://nos' | cut -d \" -f 4)
    if [ -n "$POST_URL" ]; then
       wget -qO- --output-document=/dev/null --no-check-certificate --load-cookies=cookie --keep-session-cookies --post-data="USERNAME=mail@gmail.com&PASSWORD=123456&remember=on" $POST_URL
    fi
    rm cookie portal.html
fi

See also these logs: (MAC ADDRESS OF "NOS FON" IS: aa:bb:cc:dd:ee:ff)... I think the script does not start ...

LOGREAD LOG:

root@OpenWrt:~# logread
Mon May  4 22:36:20 2015 kern.info kernel: [    0.060000] Mount-cache hash table entries: 512
Mon May  4 22:36:20 2015 kern.info kernel: [    0.070000] NET: Registered protocol family 16
Mon May  4 22:36:20 2015 kern.info kernel: [    0.070000] MIPS: machine is TP-LINK Archer C7
Mon May  4 22:36:20 2015 kern.warn kernel: [    0.080000] ar724x-pci ar724x-pci.0: PCIe link is down
Mon May  4 22:36:20 2015 kern.warn kernel: [    0.080000] registering PCI controller with io_map_base unset
Mon May  4 22:36:20 2015 kern.warn kernel: [    0.090000] registering PCI controller with io_map_base unset
Mon May  4 22:36:20 2015 kern.info kernel: [    0.500000] bio: create slab <bio-0> at 0
Mon May  4 22:36:20 2015 kern.info kernel: [    0.500000] PCI host bridge to bus 0000:00
Mon May  4 22:36:20 2015 kern.info kernel: [    0.510000] pci_bus 0000:00: root bus resource [mem 0x10000000-0x11ffffff]
Mon May  4 22:36:20 2015 kern.info kernel: [    0.510000] pci_bus 0000:00: root bus resource [io  0x0000]
Mon May  4 22:36:20 2015 kern.info kernel: [    0.520000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
Mon May  4 22:36:20 2015 kern.debug kernel: [    0.520000] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
Mon May  4 22:36:20 2015 kern.info kernel: [    0.520000] PCI host bridge to bus 0000:01
Mon May  4 22:36:20 2015 kern.info kernel: [    0.530000] pci_bus 0000:01: root bus resource [mem 0x12000000-0x13ffffff]
Mon May  4 22:36:20 2015 kern.info kernel: [    0.530000] pci_bus 0000:01: root bus resource [io  0x0001]
Mon May  4 22:36:20 2015 kern.info kernel: [    0.540000] pci_bus 0000:01: No busn resource found for root bus, will use [bus 01-ff]
Mon May  4 22:36:20 2015 kern.debug kernel: [    0.540000] pci 0000:01:00.0: [168c:003c] type 00 class 0x028000
Mon May  4 22:36:20 2015 kern.debug kernel: [    0.540000] pci 0000:01:00.0: reg 10: [mem 0x00000000-0x001fffff 64bit]
Mon May  4 22:36:20 2015 kern.debug kernel: [    0.540000] pci 0000:01:00.0: reg 30: [mem 0x00000000-0x0000ffff pref]
Mon May  4 22:36:20 2015 kern.debug kernel: [    0.540000] pci 0000:01:00.0: supports D1 D2
Mon May  4 22:36:20 2015 kern.debug kernel: [    0.540000] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
Mon May  4 22:36:20 2015 kern.info kernel: [    0.540000] pci 0000:01:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
Mon May  4 22:36:20 2015 kern.info kernel: [    0.550000] pci 0000:01:00.0: BAR 6: assigned [mem 0x12200000-0x1220ffff pref]
Mon May  4 22:36:20 2015 kern.info kernel: [    0.550000] pci 0000:01:00.0: using irq 41 for pin 1
Mon May  4 22:36:20 2015 kern.info kernel: [    0.560000] Switching to clocksource MIPS
Mon May  4 22:36:20 2015 kern.info kernel: [    0.560000] NET: Registered protocol family 2
Mon May  4 22:36:20 2015 kern.info kernel: [    0.570000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
Mon May  4 22:36:20 2015 kern.info kernel: [    0.570000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
Mon May  4 22:36:20 2015 kern.info kernel: [    0.570000] TCP: Hash tables configured (established 1024 bind 1024)
Mon May  4 22:36:20 2015 kern.info kernel: [    0.580000] TCP: reno registered
Mon May  4 22:36:20 2015 kern.info kernel: [    0.580000] UDP hash table entries: 256 (order: 0, 4096 bytes)
Mon May  4 22:36:20 2015 kern.info kernel: [    0.590000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
Mon May  4 22:36:20 2015 kern.info kernel: [    0.600000] NET: Registered protocol family 1
Mon May  4 22:36:20 2015 kern.debug kernel: [    0.600000] PCI: CLS 0 bytes, default 32
Mon May  4 22:36:20 2015 kern.info kernel: [    0.610000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
Mon May  4 22:36:20 2015 kern.info kernel: [    0.620000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
Mon May  4 22:36:20 2015 kern.info kernel: [    0.630000] msgmni has been set to 246
Mon May  4 22:36:20 2015 kern.info kernel: [    0.630000] io scheduler noop registered
Mon May  4 22:36:20 2015 kern.info kernel: [    0.640000] io scheduler deadline registered (default)
Mon May  4 22:36:20 2015 kern.info kernel: [    0.640000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
Mon May  4 22:36:20 2015 kern.info kernel: [    0.670000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
Mon May  4 22:36:20 2015 kern.info kernel: [    0.680000] console [ttyS0] enabled, bootconsole disabled
Mon May  4 22:36:20 2015 kern.info kernel: [    0.690000] ath79-spi ath79-spi: master is unqueued, this is deprecated
Mon May  4 22:36:20 2015 kern.warn kernel: [    0.700000] m25p80 spi0.0: found s25fl129p1, expected m25p80
Mon May  4 22:36:20 2015 kern.info kernel: [    0.700000] m25p80 spi0.0: s25fl129p1 (16384 Kbytes)
Mon May  4 22:36:20 2015 kern.notice kernel: [    0.710000] 5 tp-link partitions found on MTD device spi0.0
Mon May  4 22:36:20 2015 kern.notice kernel: [    0.720000] Creating 5 MTD partitions on "spi0.0":
Mon May  4 22:36:20 2015 kern.notice kernel: [    0.720000] 0x000000000000-0x000000020000 : "u-boot"
Mon May  4 22:36:20 2015 kern.notice kernel: [    0.730000] 0x000000020000-0x00000012e660 : "kernel"
Mon May  4 22:36:20 2015 kern.warn kernel: [    0.730000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
Mon May  4 22:36:20 2015 kern.notice kernel: [    0.750000] 0x00000012e660-0x000000ff0000 : "rootfs"
Mon May  4 22:36:20 2015 kern.warn kernel: [    0.750000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
Mon May  4 22:36:20 2015 kern.notice kernel: [    0.760000] mtd: device 2 (rootfs) set to be root filesystem
Mon May  4 22:36:20 2015 kern.notice kernel: [    0.770000] 1 squashfs-split partitions found on MTD device rootfs
Mon May  4 22:36:20 2015 kern.notice kernel: [    0.780000] 0x000000390000-0x000000ff0000 : "rootfs_data"
Mon May  4 22:36:20 2015 kern.notice kernel: [    0.780000] 0x000000ff0000-0x000001000000 : "art"
Mon May  4 22:36:20 2015 kern.notice kernel: [    0.790000] 0x000000020000-0x000000ff0000 : "firmware"
Mon May  4 22:36:20 2015 kern.info kernel: [    0.830000] switch0: Atheros AR8327 rev. 4 switch registered on ag71xx-mdio.0
Mon May  4 22:36:20 2015 kern.info kernel: [    2.070000] libphy: ag71xx_mdio: probed
Mon May  4 22:36:20 2015 kern.info kernel: [    2.620000] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd034, driver=Atheros AR8216/AR8236/AR8316]
Mon May  4 22:36:20 2015 kern.info kernel: [    2.640000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
Mon May  4 22:36:20 2015 kern.info kernel: [    3.190000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:SGMII
Mon May  4 22:36:20 2015 kern.info kernel: [    3.200000] TCP: cubic registered
Mon May  4 22:36:20 2015 kern.info kernel: [    3.200000] NET: Registered protocol family 17
Mon May  4 22:36:20 2015 kern.notice kernel: [    3.210000] Bridge firewalling registered
Mon May  4 22:36:20 2015 kern.info kernel: [    3.210000] 8021q: 802.1Q VLAN Support v1.8
Mon May  4 22:36:20 2015 kern.info kernel: [    3.230000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
Mon May  4 22:36:20 2015 kern.info kernel: [    3.230000] Freeing unused kernel memory: 272K (8034c000 - 80390000)
Mon May  4 22:36:20 2015 kern.info kernel: [    5.770000] usbcore: registered new interface driver usbfs
Mon May  4 22:36:20 2015 kern.info kernel: [    5.780000] usbcore: registered new interface driver hub
Mon May  4 22:36:20 2015 kern.info kernel: [    5.780000] usbcore: registered new device driver usb
Mon May  4 22:36:20 2015 kern.info kernel: [    5.790000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
Mon May  4 22:36:20 2015 kern.info kernel: [    5.800000] ehci-platform: EHCI generic platform driver
Mon May  4 22:36:20 2015 kern.info kernel: [    5.800000] ehci-platform ehci-platform.0: EHCI Host Controller
Mon May  4 22:36:20 2015 kern.info kernel: [    5.810000] ehci-platform ehci-platform.0: new USB bus registered, assigned bus number 1
Mon May  4 22:36:20 2015 kern.info kernel: [    5.820000] ehci-platform ehci-platform.0: TX-TX IDP fix enabled
Mon May  4 22:36:20 2015 kern.info kernel: [    5.830000] ehci-platform ehci-platform.0: irq 48, io mem 0x1b000000
Mon May  4 22:36:20 2015 kern.info kernel: [    5.850000] ehci-platform ehci-platform.0: USB 2.0 started, EHCI 1.00
Mon May  4 22:36:20 2015 kern.info kernel: [    5.850000] hub 1-0:1.0: USB hub found
Mon May  4 22:36:20 2015 kern.info kernel: [    5.860000] hub 1-0:1.0: 1 port detected
Mon May  4 22:36:20 2015 kern.info kernel: [    5.860000] ehci-platform ehci-platform.1: EHCI Host Controller
Mon May  4 22:36:20 2015 kern.info kernel: [    5.870000] ehci-platform ehci-platform.1: new USB bus registered, assigned bus number 2
Mon May  4 22:36:20 2015 kern.info kernel: [    5.880000] ehci-platform ehci-platform.1: TX-TX IDP fix enabled
Mon May  4 22:36:20 2015 kern.info kernel: [    5.880000] ehci-platform ehci-platform.1: irq 49, io mem 0x1b400000
Mon May  4 22:36:20 2015 kern.info kernel: [    5.910000] ehci-platform ehci-platform.1: USB 2.0 started, EHCI 1.00
Mon May  4 22:36:20 2015 kern.info kernel: [    5.910000] hub 2-0:1.0: USB hub found
Mon May  4 22:36:20 2015 kern.info kernel: [    5.920000] hub 2-0:1.0: 1 port detected
Mon May  4 22:36:20 2015 kern.info kernel: [    6.330000] usb 2-1: new high-speed USB device number 2 using ehci-platform
Mon May  4 22:36:20 2015 kern.info kernel: [    6.370000] eth1: link up (1000Mbps/Full duplex)
Mon May  4 22:36:20 2015 kern.notice kernel: [    9.710000] jffs2: notice: (363) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (1 unchecked, 0 orphan) and 15 of xref (0 dead, 1 orphan) found.
Mon May  4 22:36:20 2015 kern.info kernel: [    9.800000] eth1: link down
Mon May  4 22:36:20 2015 kern.info kernel: [   11.250000] NET: Registered protocol family 10
Mon May  4 22:36:20 2015 kern.info kernel: [   11.260000] nf_conntrack version 0.5.0 (1973 buckets, 7892 max)
Mon May  4 22:36:20 2015 kern.info kernel: [   11.270000] ip6_tables: (C) 2000-2006 Netfilter Core Team
Mon May  4 22:36:20 2015 kern.info kernel: [   11.290000] Loading modules backported from Linux version master-2014-05-22-0-gf2032ea
Mon May  4 22:36:20 2015 kern.info kernel: [   11.290000] Backport generated by backports.git backports-20140320-37-g5c33da0
Mon May  4 22:36:20 2015 kern.info kernel: [   11.320000] cfg80211: Calling CRDA to update world regulatory domain
Mon May  4 22:36:20 2015 kern.info kernel: [   11.320000] cfg80211: World regulatory domain updated:
Mon May  4 22:36:20 2015 kern.info kernel: [   11.330000] cfg80211:  DFS Master region: unset
Mon May  4 22:36:20 2015 kern.info kernel: [   11.330000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Mon May  4 22:36:20 2015 kern.info kernel: [   11.340000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Mon May  4 22:36:20 2015 kern.info kernel: [   11.350000] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Mon May  4 22:36:20 2015 kern.info kernel: [   11.360000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Mon May  4 22:36:20 2015 kern.info kernel: [   11.370000] cfg80211:   (5170000 KHz - 5250000 KHz @ 160000 KHz), (N/A, 2000 mBm), (N/A)
Mon May  4 22:36:20 2015 kern.info kernel: [   11.370000] cfg80211:   (5250000 KHz - 5330000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Mon May  4 22:36:20 2015 kern.info kernel: [   11.380000] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Mon May  4 22:36:20 2015 kern.info kernel: [   11.390000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Mon May  4 22:36:20 2015 kern.info kernel: [   11.400000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Mon May  4 22:36:20 2015 kern.info kernel: [   11.460000] ath10k_pci 0000:01:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
Mon May  4 22:36:20 2015 kern.warn kernel: [   11.460000] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
Mon May  4 22:36:20 2015 kern.info kernel: [   11.770000] ath10k: pci irq legacy irq_mode 0 reset_mode 0
Mon May  4 22:36:20 2015 kern.warn kernel: [   11.870000] ath10k: otp stream is empty, using board.bin contents
Mon May  4 22:36:20 2015 kern.info kernel: [   13.010000] ath10k: qca988x hw2.0 (0x4100016c, 0x043202ff) fw 10.1.467.2-1 api 2 htt 2.1
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.550000] ath: EEPROM regdomain: 0x0
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.550000] ath: EEPROM indicates default country code should be used
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.550000] ath: doing EEPROM country->regdmn map search
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.550000] ath: country maps to regdmn code: 0x3a
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.550000] ath: Country alpha2 being used: US
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.550000] ath: Regpair used: 0x3a
Mon May  4 22:36:20 2015 kern.info kernel: [   13.560000] cfg80211: Calling CRDA for country: US
Mon May  4 22:36:20 2015 kern.info kernel: [   13.570000] cfg80211: Regulatory domain changed to country: US
Mon May  4 22:36:20 2015 kern.info kernel: [   13.570000] cfg80211:  DFS Master region: FCC
Mon May  4 22:36:20 2015 kern.info kernel: [   13.580000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Mon May  4 22:36:20 2015 kern.info kernel: [   13.590000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A)
Mon May  4 22:36:20 2015 kern.info kernel: [   13.590000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 1700 mBm), (N/A)
Mon May  4 22:36:20 2015 kern.info kernel: [   13.600000] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2300 mBm), (0 s)
Mon May  4 22:36:20 2015 kern.info kernel: [   13.610000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A)
Mon May  4 22:36:20 2015 kern.info kernel: [   13.620000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
Mon May  4 22:36:20 2015 kern.info kernel: [   13.650000] ip_tables: (C) 2000-2006 Netfilter Core Team
Mon May  4 22:36:20 2015 kern.info kernel: [   13.690000] xt_time: kernel timezone is -0000
Mon May  4 22:36:20 2015 kern.info kernel: [   13.710000] PPP generic driver version 2.4.2
Mon May  4 22:36:20 2015 kern.info kernel: [   13.720000] NET: Registered protocol family 24
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.730000] ath: EEPROM regdomain: 0x0
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.730000] ath: EEPROM indicates default country code should be used
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.730000] ath: doing EEPROM country->regdmn map search
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.730000] ath: country maps to regdmn code: 0x3a
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.730000] ath: Country alpha2 being used: US
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.730000] ath: Regpair used: 0x3a
Mon May  4 22:36:20 2015 kern.debug kernel: [   13.740000] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
Mon May  4 22:36:20 2015 kern.info kernel: [   13.750000] ieee80211 phy1: Atheros AR9550 Rev:0 mem=0xb8100000, irq=47
Mon May  4 22:36:22 2015 authpriv.info dropbear[845]: Not backgrounding
Mon May  4 22:36:24 2015 kern.info kernel: [   20.670000] eth1: link up (1000Mbps/Full duplex)
Mon May  4 22:36:24 2015 kern.info kernel: [   20.670000] device eth1 entered promiscuous mode
Mon May  4 22:36:24 2015 kern.info kernel: [   20.680000] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
Mon May  4 22:36:24 2015 kern.info kernel: [   20.700000] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Mon May  4 22:36:25 2015 kern.info kernel: [   21.670000] br-lan: port 1(eth1) entered forwarding state
Mon May  4 22:36:25 2015 kern.info kernel: [   21.670000] br-lan: port 1(eth1) entered forwarding state
Mon May  4 22:36:25 2015 kern.info kernel: [   21.710000] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
Mon May  4 22:36:25 2015 kern.info kernel: [   21.850000] eth0: link up (1000Mbps/Full duplex)
Mon May  4 22:36:25 2015 kern.info kernel: [   21.850000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Mon May  4 22:36:27 2015 kern.warn kernel: [   23.090000] ath10k: otp stream is empty, using board.bin contents
Mon May  4 22:36:27 2015 kern.info kernel: [   23.670000] br-lan: port 1(eth1) entered forwarding state
Mon May  4 22:36:27 2015 kern.info kernel: [   23.940000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Mon May  4 22:36:27 2015 kern.info kernel: [   23.960000] IPv6: ADDRCONF(NETDEV_UP): wlan1-1: link is not ready
Mon May  4 22:36:27 2015 kern.info kernel: [   23.970000] device wlan0 entered promiscuous mode
Mon May  4 22:36:27 2015 kern.info kernel: [   23.980000] device wlan1-1 entered promiscuous mode
Mon May  4 22:36:30 2015 kern.info kernel: [   26.170000] br-lan: port 2(wlan0) entered forwarding state
Mon May  4 22:36:30 2015 kern.info kernel: [   26.170000] br-lan: port 2(wlan0) entered forwarding state
Mon May  4 22:36:30 2015 kern.info kernel: [   26.180000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Mon May  4 22:36:31 2015 kern.info kernel: [   27.050000] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
Mon May  4 22:36:31 2015 kern.info kernel: [   27.920000] wlan1: authenticate with aa:bb:cc:dd:ee:ff
Mon May  4 22:36:31 2015 kern.info kernel: [   27.930000] wlan1: send auth to aa:bb:cc:dd:ee:ff (try 1/3)
Mon May  4 22:36:31 2015 kern.info kernel: [   27.940000] wlan1: authenticated
Mon May  4 22:36:31 2015 kern.info kernel: [   27.960000] wlan1: associate with aa:bb:cc:dd:ee:ff (try 1/3)
Mon May  4 22:36:31 2015 kern.info kernel: [   27.970000] wlan1: RX AssocResp from aa:bb:cc:dd:ee:ff (capab=0x421 status=0 aid=2)
Mon May  4 22:36:31 2015 kern.info kernel: [   27.980000] wlan1: associated
Mon May  4 22:36:31 2015 kern.info kernel: [   27.990000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
Mon May  4 22:36:32 2015 kern.info kernel: [   28.170000] br-lan: port 2(wlan0) entered forwarding state
Mon May  4 22:36:32 2015 kern.info kernel: [   28.370000] br-lan: port 3(wlan1-1) entered forwarding state
Mon May  4 22:36:32 2015 kern.info kernel: [   28.370000] br-lan: port 3(wlan1-1) entered forwarding state
Mon May  4 22:36:32 2015 kern.info kernel: [   28.380000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1-1: link becomes ready
Mon May  4 22:36:34 2015 kern.info kernel: [   30.370000] br-lan: port 3(wlan1-1) entered forwarding state
Mon May  4 22:38:04 2015 authpriv.info dropbear[1363]: Child connection from 192.168.1.218:50709
Mon May  4 22:38:14 2015 authpriv.notice dropbear[1363]: Password auth succeeded for 'root' from 192.168.1.218:50709
root@OpenWrt:~#

DMESG LOG:

login as: root
root@192.168.1.1's password:


BusyBox v1.22.1 (2014-09-20 22:01:35 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 BARRIER BREAKER (14.07, r42625)
 -----------------------------------------------------
  * 1/2 oz Galliano         Pour all ingredients into
  * 4 oz cold Coffee        an irish coffee mug filled
  * 1 1/2 oz Dark Rum       with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
 -----------------------------------------------------
root@OpenWrt:~# dmesg
[    0.000000] Linux version 3.10.49 (bb@builder1) (gcc version 4.8.3 (OpenWrt/L                                                                                        inaro GCC 4.8-2014.04 r42625) ) #3 Wed Oct 1 14:00:51 CEST 2014
[    0.000000] MyLoader: sysp=a52f5067, boardp=4c141c95, parts=9e22f041
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019750 (MIPS 74Kc)
[    0.000000] SoC: Qualcomm Atheros QCA9558 rev 0
[    0.000000] Clocks: CPU:720.000MHz, DDR:600.000MHz, AHB:200.000MHz, Ref:40.00                                                                                        0MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x07ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x07ffffff]
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat 80334b60, node_mem_map 8100000                                                                                        0
[    0.000000]   Normal zone: 256 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32                                                                                         bytes
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pag                                                                                        es: 32512
[    0.000000] Kernel command line:  board=ARCHER-C7 console=ttyS0,115200 rootfs                                                                                        type=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 126052k/131072k available (2369k kernel code, 5020k reser                                                                                        ved, 621k data, 272k init, 0k highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.060000] Calibrating delay loop... 358.80 BogoMIPS (lpj=1794048)
[    0.060000] pid_max: default: 32768 minimum: 301
[    0.060000] Mount-cache hash table entries: 512
[    0.070000] NET: Registered protocol family 16
[    0.070000] MIPS: machine is TP-LINK Archer C7
[    0.080000] ar724x-pci ar724x-pci.0: PCIe link is down
[    0.080000] registering PCI controller with io_map_base unset
[    0.090000] registering PCI controller with io_map_base unset
[    0.500000] bio: create slab <bio-0> at 0
[    0.500000] PCI host bridge to bus 0000:00
[    0.510000] pci_bus 0000:00: root bus resource [mem 0x10000000-0x11ffffff]
[    0.510000] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.520000] pci_bus 0000:00: No busn resource found for root bus, will use [b                                                                                        us 00-ff]
[    0.520000] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[    0.520000] PCI host bridge to bus 0000:01
[    0.530000] pci_bus 0000:01: root bus resource [mem 0x12000000-0x13ffffff]
[    0.530000] pci_bus 0000:01: root bus resource [io  0x0001]
[    0.540000] pci_bus 0000:01: No busn resource found for root bus, will use [b                                                                                        us 01-ff]
[    0.540000] pci 0000:01:00.0: [168c:003c] type 00 class 0x028000
[    0.540000] pci 0000:01:00.0: reg 10: [mem 0x00000000-0x001fffff 64bit]
[    0.540000] pci 0000:01:00.0: reg 30: [mem 0x00000000-0x0000ffff pref]
[    0.540000] pci 0000:01:00.0: supports D1 D2
[    0.540000] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.540000] pci 0000:01:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bi                                                                                        t]
[    0.550000] pci 0000:01:00.0: BAR 6: assigned [mem 0x12200000-0x1220ffff pref                                                                                        ]
[    0.550000] pci 0000:01:00.0: using irq 41 for pin 1
[    0.560000] Switching to clocksource MIPS
[    0.560000] NET: Registered protocol family 2
[    0.570000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.570000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.570000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.580000] TCP: reno registered
[    0.580000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.590000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.600000] NET: Registered protocol family 1
[    0.600000] PCI: CLS 0 bytes, default 32
[    0.610000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.620000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORIT                                                                                        Y) (c) 2001-2006 Red Hat, Inc.
[    0.630000] msgmni has been set to 246
[    0.630000] io scheduler noop registered
[    0.640000] io scheduler deadline registered (default)
[    0.640000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.670000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
[    0.680000] console [ttyS0] enabled, bootconsole disabled
[    0.690000] ath79-spi ath79-spi: master is unqueued, this is deprecated
[    0.700000] m25p80 spi0.0: found s25fl129p1, expected m25p80
[    0.700000] m25p80 spi0.0: s25fl129p1 (16384 Kbytes)
[    0.710000] 5 tp-link partitions found on MTD device spi0.0
[    0.720000] Creating 5 MTD partitions on "spi0.0":
[    0.720000] 0x000000000000-0x000000020000 : "u-boot"
[    0.730000] 0x000000020000-0x00000012e660 : "kernel"
[    0.730000] mtd: partition "kernel" must either start or end on erase block b                                                                                        oundary or be smaller than an erase block -- forcing read-only
[    0.750000] 0x00000012e660-0x000000ff0000 : "rootfs"
[    0.750000] mtd: partition "rootfs" must either start or end on erase block b                                                                                        oundary or be smaller than an erase block -- forcing read-only
[    0.760000] mtd: device 2 (rootfs) set to be root filesystem
[    0.770000] 1 squashfs-split partitions found on MTD device rootfs
[    0.780000] 0x000000390000-0x000000ff0000 : "rootfs_data"
[    0.780000] 0x000000ff0000-0x000001000000 : "art"
[    0.790000] 0x000000020000-0x000000ff0000 : "firmware"
[    0.830000] switch0: Atheros AR8327 rev. 4 switch registered on ag71xx-mdio.0
[    2.070000] libphy: ag71xx_mdio: probed
[    2.620000] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd0                                                                                        34, driver=Atheros AR8216/AR8236/AR8316]
[    2.640000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[    3.190000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:SGMII
[    3.200000] TCP: cubic registered
[    3.200000] NET: Registered protocol family 17
[    3.210000] Bridge firewalling registered
[    3.210000] 8021q: 802.1Q VLAN Support v1.8
[    3.230000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    3.230000] Freeing unused kernel memory: 272K (8034c000 - 80390000)
[    5.770000] usbcore: registered new interface driver usbfs
[    5.780000] usbcore: registered new interface driver hub
[    5.780000] usbcore: registered new device driver usb
[    5.790000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    5.800000] ehci-platform: EHCI generic platform driver
[    5.800000] ehci-platform ehci-platform.0: EHCI Host Controller
[    5.810000] ehci-platform ehci-platform.0: new USB bus registered, assigned b                                                                                        us number 1
[    5.820000] ehci-platform ehci-platform.0: TX-TX IDP fix enabled
[    5.830000] ehci-platform ehci-platform.0: irq 48, io mem 0x1b000000
[    5.850000] ehci-platform ehci-platform.0: USB 2.0 started, EHCI 1.00
[    5.850000] hub 1-0:1.0: USB hub found
[    5.860000] hub 1-0:1.0: 1 port detected
[    5.860000] ehci-platform ehci-platform.1: EHCI Host Controller
[    5.870000] ehci-platform ehci-platform.1: new USB bus registered, assigned b                                                                                        us number 2
[    5.880000] ehci-platform ehci-platform.1: TX-TX IDP fix enabled
[    5.880000] ehci-platform ehci-platform.1: irq 49, io mem 0x1b400000
[    5.910000] ehci-platform ehci-platform.1: USB 2.0 started, EHCI 1.00
[    5.910000] hub 2-0:1.0: USB hub found
[    5.920000] hub 2-0:1.0: 1 port detected
[    6.330000] usb 2-1: new high-speed USB device number 2 using ehci-platform
[    6.370000] eth1: link up (1000Mbps/Full duplex)
[    9.710000] jffs2: notice: (363) jffs2_build_xattr_subsystem: complete buildi                                                                                        ng xattr subsystem, 1 of xdatum (1 unchecked, 0 orphan) and 15 of xref (0 dead,                                                                                         1 orphan) found.
[    9.800000] eth1: link down
[   11.250000] NET: Registered protocol family 10
[   11.260000] nf_conntrack version 0.5.0 (1973 buckets, 7892 max)
[   11.270000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   11.290000] Loading modules backported from Linux version master-2014-05-22-0                                                                                        -gf2032ea
[   11.290000] Backport generated by backports.git backports-20140320-37-g5c33da                                                                                        0
[   11.320000] cfg80211: Calling CRDA to update world regulatory domain
[   11.320000] cfg80211: World regulatory domain updated:
[   11.330000] cfg80211:  DFS Master region: unset
[   11.330000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gai                                                                                        n, max_eirp), (dfs_cac_time)
[   11.340000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 m                                                                                        Bm), (N/A)
[   11.350000] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 m                                                                                        Bm), (N/A)
[   11.360000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 m                                                                                        Bm), (N/A)
[   11.370000] cfg80211:   (5170000 KHz - 5250000 KHz @ 160000 KHz), (N/A, 2000                                                                                         mBm), (N/A)
[   11.370000] cfg80211:   (5250000 KHz - 5330000 KHz @ 160000 KHz), (N/A, 2000                                                                                         mBm), (0 s)
[   11.380000] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000                                                                                         mBm), (0 s)
[   11.390000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 m                                                                                        Bm), (N/A)
[   11.400000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0                                                                                         mBm), (N/A)
[   11.460000] ath10k_pci 0000:01:00.0: BAR 0: assigned [mem 0x12000000-0x121fff                                                                                        ff 64bit]
[   11.460000] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
[   11.770000] ath10k: pci irq legacy irq_mode 0 reset_mode 0
[   11.870000] ath10k: otp stream is empty, using board.bin contents
[   13.010000] ath10k: qca988x hw2.0 (0x4100016c, 0x043202ff) fw 10.1.467.2-1 ap                                                                                        i 2 htt 2.1
[   13.550000] ath: EEPROM regdomain: 0x0
[   13.550000] ath: EEPROM indicates default country code should be used
[   13.550000] ath: doing EEPROM country->regdmn map search
[   13.550000] ath: country maps to regdmn code: 0x3a
[   13.550000] ath: Country alpha2 being used: US
[   13.550000] ath: Regpair used: 0x3a
[   13.560000] cfg80211: Calling CRDA for country: US
[   13.570000] cfg80211: Regulatory domain changed to country: US
[   13.570000] cfg80211:  DFS Master region: FCC
[   13.580000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gai                                                                                        n, max_eirp), (dfs_cac_time)
[   13.590000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 m                                                                                        Bm), (N/A)
[   13.590000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 1700 m                                                                                        Bm), (N/A)
[   13.600000] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2300 m                                                                                        Bm), (0 s)
[   13.610000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 m                                                                                        Bm), (N/A)
[   13.620000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 40                                                                                        00 mBm), (N/A)
[   13.650000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   13.690000] xt_time: kernel timezone is -0000
[   13.710000] PPP generic driver version 2.4.2
[   13.720000] NET: Registered protocol family 24
[   13.730000] ath: EEPROM regdomain: 0x0
[   13.730000] ath: EEPROM indicates default country code should be used
[   13.730000] ath: doing EEPROM country->regdmn map search
[   13.730000] ath: country maps to regdmn code: 0x3a
[   13.730000] ath: Country alpha2 being used: US
[   13.730000] ath: Regpair used: 0x3a
[   13.740000] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[   13.750000] ieee80211 phy1: Atheros AR9550 Rev:0 mem=0xb8100000, irq=47
[   20.670000] eth1: link up (1000Mbps/Full duplex)
[   20.670000] device eth1 entered promiscuous mode
[   20.680000] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   20.700000] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   21.670000] br-lan: port 1(eth1) entered forwarding state
[   21.670000] br-lan: port 1(eth1) entered forwarding state
[   21.710000] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   21.850000] eth0: link up (1000Mbps/Full duplex)
[   21.850000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   23.090000] ath10k: otp stream is empty, using board.bin contents
[   23.670000] br-lan: port 1(eth1) entered forwarding state
[   23.940000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   23.960000] IPv6: ADDRCONF(NETDEV_UP): wlan1-1: link is not ready
[   23.970000] device wlan0 entered promiscuous mode
[   23.980000] device wlan1-1 entered promiscuous mode
[   26.170000] br-lan: port 2(wlan0) entered forwarding state
[   26.170000] br-lan: port 2(wlan0) entered forwarding state
[   26.180000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   27.050000] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[   27.920000] wlan1: authenticate with aa:bb:cc:dd:ee:ff
[   27.930000] wlan1: send auth to aa:bb:cc:dd:ee:ff (try 1/3)
[   27.940000] wlan1: authenticated
[   27.960000] wlan1: associate with aa:bb:cc:dd:ee:ff (try 1/3)
[   27.970000] wlan1: RX AssocResp from aa:bb:cc:dd:ee:ff (capab=0x421 status=0                                                                                         aid=2)
[   27.980000] wlan1: associated
[   27.990000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
[   28.170000] br-lan: port 2(wlan0) entered forwarding state
[   28.370000] br-lan: port 3(wlan1-1) entered forwarding state
[   28.370000] br-lan: port 3(wlan1-1) entered forwarding state
[   28.380000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1-1: link becomes ready
[   30.370000] br-lan: port 3(wlan1-1) entered forwarding state
root@OpenWrt:~#

My future configuration will be:
- Ubiquiti Nanostation M2 receiving the Zon Fon Signal
(IP: 192.168.1.20 + DHCP activated)
- TP-Link Archer C7 v2 distributing the signal in my own Wireless Lan
(IP: 192.168.1.1 + DHCP deactivated + GW: 192.168.1.20)
So I will need to change WWAN to LAN?

(Last edited by gandamaluko on 5 May 2015, 20:06)

hnyman, please give us some help smile

Thanks

Separate the debugging into two logical steps:
is the interface wwan starting?
does the script work?

Regarding the script working:
- Add the logger statements that I suggested so that you can see from the logs if the script starts and what are the parsed values.
- You could also run the commands separately from the console and see if the values are as expected:

wget -qO- --output-document=portal.html --no-check-certificate --save-cookies=cookie --keep-session-cookies https://www.google.pt
cat portal.html | grep 'action="https://nos'
cat portal.html | grep 'action="https://nos' | cut -d \" -f 4
wget -qO- --output-document=/dev/null --no-check-certificate --load-cookies=cookie --keep-session-cookies --post-data="USERNAME=mail@gmail.com&PASSWORD=123456&remember=on" VALUE FROM PREVIOUS COMMAND 

There may also be errors/changes in ' and " handling. You might make the grep statement less error-prone. E.g. replace " with wildcard . grep 'action=.https://nos'

Regarding the interface starting:
- I don't quite understand your network setup. Are you trying this script in which of the routers? In the one receiving the ISP signal, or in the other router?
- what kind of interface is that wwan? Based on your previous description I have no idea, how it has been configured. you have not provided /etc/config/network

EDIT:
based on the logs, I think that you are trying to run this in the "inner" router, apparently Archer C7, which has no real knowledge, when the ISP line goes up.
Easiest might be to run the script in the "outer" router, which sees when the ISP interface goes up. wan interface in Nanostation? If the script would be in that router and connectecd to "wan", then it should launch when the ISP line is up.

If you want to run in the inner Archer router, then you probably need to tie the script into "lan", and then just assume that the other router is already up and that there is basic connectivity through it.

(Last edited by hnyman on 7 May 2015, 08:58)

Hi hnyman,

First of all, thank you for the time you have spent trying to help us wink

Regarding your post:
- My first step is to put this script working only using the TP-Link Archer C7 v2. (And I did it)
(because at this moment the Ubiquiti NSM2 with original firmware is receiving the signal and I have a TP-

Link WR841ND distributing the signal but with manual login on "Nos Fon" - without any script.)
- Yes, the "WWAN" as the information "Client "FON_ZON_FREE_INTERNET"" like the previous image posted by

dannycosta. And it's working because if I connect the LAN cable of the router (LAN port) to my computer LAN

port, the authentication page of "Fon Zon" is opended in my browser.
- In the console:
  -> with wget, if I use the URL "https://www.google.pt", I see the command freezes and I need to stop it

with CTRL+C and it creates the portal.html file empty... So I tried to put only "www.google.pt" and the

portal.html it's created with information inside of it (code source of the zon fon authentication page)
Now it's working big_smile

So the working code is:

#!/bin/sh

if [ "$INTERFACE" = "wwan" ] && ([ "$ACTION" = "ifup" ] || [ "$ACTION" = "update" ]); then
wget -qO- --output-document=portal.html --no-check-certificate --save-cookies=cookie --keep-session-cookies www.google.pt
POST_URL=$(cat portal.html | grep 'action="https://nos' | cut -d \" -f 4)
if [ -n "$POST_URL" ]; then
wget -qO- --output-document=/dev/null --no-check-certificate --load-cookies=cookie --keep-session-cookies --post-data="USERNAME=email@gmail.com&PASSWORD=12345678&r emember=on" $POST_URL
fi
rm cookie portal.html
fi

Now a little question, because I have no knowledge with bash code:
I tried to add the 2 lines to log that you suggest like this:

#!/bin/sh

if [ "$INTERFACE" = "wwan" ] && ([ "$ACTION" = "ifup" ] || [ "$ACTION" = "update" ]); then
logger "ISP portal hotplug action"
wget -qO- --output-document=portal.html --no-check-certificate --save-cookies=cookie --keep-session-cookies www.google.pt
POST_URL=$(cat portal.html | grep 'action="https://nos' | cut -d \" -f 4)
logger "ISP portal URL: $POST_URL"
if [ -n "$POST_URL" ]; then
wget -qO- --output-document=/dev/null --no-check-certificate --load-cookies=cookie --keep-session-cookies --post-data="USERNAME=email@gmail.com&PASSWORD=12345678&r emember=on" $POST_URL
fi
rm cookie portal.html
fi

How I can see the log? why I can't see any log of this script with dmesg or logread?

NEXT STEPS:

Step 1: Sometimes the internet connection goes down... and it's necessary to login again... how to make the script work again when this happens? I think it's with watchdog, but I don't know how to use it
EDIT: this is the best way? -> http://michael.stapelberg.de/Artikel/op … _watchdog/

Step2: Use my Ubiquiti NSM2 to receive the "Nos Fon" wireless signal and this TP-Link Archer C7 v2 to distribute it... smile
What changes I need to do in the script, as I use the Ubiquiti NSM2 to manage all connections (IP: 192.168.1.20 / DHCP active) connected to a LAN port of the TP-Link Archer C7 (IP: 192.168.1.1 / GW: 192.168.1.20 / DHCP deactivated) -> Note: If I connect the Ubiquiti directly to WAN phisical port, doesn't work.. I don't know why...

Step3: Modify the script to work with both portuguese hotspots: "Nos Fon" and "Meo Wifi"... what is important to know about this other hotspots to do it? Source code of the login webpage?

EDIT: The autologin doesn't work if I have my laptop connected with LAN cable...
If I disconnect the cable from laptop -> reboot the router -> wait 1 minute -> connect again the cable to the laptop, it works ok.. I already made this test many times... Any idea? smile

(Last edited by gandamaluko on 9 May 2015, 10:52)

I had it working until one month ago.. now it changed and it doesn't autologin anymore. The router is not near me (actually it's in a different country LOL) but will have to check there sooner or later.

I fixed the script to login with FON credentials. It works on my mac, but I didn't test it on the router yet.
note:
You may have to uncomment the "#if [ "$INTERFACE"......" and "#fi" lines to work on the router, also remove the echo lines if you want.

#!/bin/sh

# autologin for FON NOS(ZON) FREE hotspot with Fon.com credentials 
#=========================
# Your fon.com login
email=your_email@xxx.xx
password=xxxxx
#=========================

#if [ "$INTERFACE" = "wwan" ] && ([ "$ACTION" = "ifup" ] || [ "$ACTION" = "update" ]); then
logger "ISP portal hotplug action"

wget -qO- --output-document=portal.html --no-check-certificate --save-cookies=cookie --keep-session-cookies www.google.pt

POST_URL=$(cat portal.html | grep '<a href="https://nos2.portal.fon.com/jcp?res=hsp-notyet' | cut -d \" -f 2 | sed -e 's/%21/!/g' -e 's/%23/#/g' -e 's/%24/$/g' -e 's/%26/\&/g' -e "s/%27/'/g" -e 's/%28/(/g' -e 's/%29/)/g' -e 's/%3A/:/g' -e 's/%2F/\//g' -e 's/%3F/?/g' -e 's/%3D/=/g' -e 's/&amp;/\&/g')

if [ -n "$POST_URL" ]; then

wget -qO- --output-document=portal2.html --no-check-certificate --save-cookies=cookie --keep-session-cookies $POST_URL

POST_URL_FON=$(cat portal2.html |  grep 'LoginURL' | sed -e 's/<LoginURL>//g' -e 's/<\/LoginURL>//g' |  sed -e 's/%21/!/g' -e 's/%23/#/g' -e 's/%24/$/g' -e 's/%26/\&/g' -e "s/%27/'/g" -e 's/%28/(/g' -e 's/%29/)/g' -e 's/%3A/:/g' -e 's/%2F/\//g' -e 's/%3F/?/g' -e 's/%3D/=/g' -e 's/&amp;/\&/g')

logger "ISP portal URL: $POST_URL_FON"

wget -qO- --output-document=/dev/null --no-check-certificate --load-cookies=cookie --keep-session-cookies --post-data="USERNAME=$email&PASSWORD=$password&remember=on" $POST_URL_FON
rm cookie portal.html portal2.html
else
logger "Already Logged in"
echo "Already Logged in"
rm cookie portal.html
fi

#fi

Hi peekpt and hi all,

I am trying to start from your work to connect my openwrt router to the Vodafone-WiFi hotspot network ... but I am not familiar with scripting nor linux.

When I connect with my PC (through the openwrt router) to the captive portal, the web page address is the following:

h**ps://it.portal.vodafone-wifi.com/jcp/it?res=welcome&nasid=90-35-6E-AA-BB-CC&uamip=192.168.6.1&uamport=80&mac=F4-F2-6D-DD-EE-FF&challenge=e2984a2911df68fa0f8c8e635114329c&ip=192.168.6.2&userurl=h**p%3A%2F%2F192.168.0.1&lang=it_IT&LANGUAGE=it_IT

where:
90-35-6E-AA-BB-CC is the hotspot MAC (I guess)
192.168.6.1 is the hotspot IP
F4-F2-6D-DD-EE-FF is the Openwrt WWAN MAC
192.168.6.2 is the WWAN IP
%3A%2F%2F192.168.0.1&lang=it_IT&LANGUAGE=it_IT is the requested page that activate the captive portal login

I don't know how to adapt your script to work with this portal. Can you help please?

Also, I am not sure how to keep the script running.
I've understood that it is possible to use it as a FIREWALL-CUSTOM RULE but I can't see anything in the System Log, even after a reboot. (I expect to see at least an error line).
Can you also give me some instructions to let the script running and check if it is working?

Thank you very much!!

Hi,

i followed this thread and tried to find another solution for auto login.
I found a python script "zon_fon_authenticate" on git hub which is working good for me with fon login portal after editing the url prefix.

The only problem is, that python is large. I installed it on ram to test it on an embedded device. But that means no power cycle safety for internet connection.

Because of that I'd like to transform the parse_qs code in the python script to a shell script and use wget again.

Anny ideas how to achieve this?

Thank you very much!

The discussion might have continued from here.