Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BtWiFi_with_FON automatic login written as a bash script. I have this running every 10 minutes on my raspberry pi
#!/bin/bash
# CONF
DBG=true
RELOG_UNAME=your@email.com
RELOG_PASSW=xxxxxxxxxxxxxxx
# END CONF
IS_LOGGED_IN=$(wget "https://www.btopenzone.com:8443/home" --timeout 30 -O - 2>/dev/null | grep "accountLogoff")
if [ "$IS_LOGGED_IN" ]
then
[[ $DBG ]] && echo "currently logged in. Nothing to do.."
else
[[ $DBG ]] && echo "It's not logged in.. Will log in!"
OUT=$(wget -qO- --post-data "USERNAME=$RELOG_UNAME&PASSWORD=$RELOG_PASSW" "https://btwifi.portal.fon.com/remote?res=hsp-login&HSPNAME=FonBT%3AGB&WISPURL=https%3A%2F%2Fwww.btopenzone.com%3A8443%2FfonLogon&WISPURLHOME=https%3A%2F%2Fwww.btopenzone.com%3A8443&VNPNAME=FonBT%3AGB&LOCATIONNAME=FonBT%3AGB")
ONLINE=$(echo $OUT | grep youre_online )
if [ "$ONLINE" ]
then
[[ $DBG ]] && echo "You're online!"
else
[[ $DBG ]] && echo "Could not login :("
fi
fi
@gingerbeardman

This comment has been minimized.

Copy link

@gingerbeardman gingerbeardman commented Jul 13, 2016

Thanks for this! Logout URL for testing is https://www.btopenzone.com:8443/accountLogoff/home

@gingerbeardman

This comment has been minimized.

Copy link

@gingerbeardman gingerbeardman commented Jul 15, 2016

This modified version works for me, there must have been some HTML changes at the BT end:

#!/bin/sh

# CONF

DBG=false
RELOG_UNAME="email@domain.com"
RELOG_PASSW="Pa55word\!"

# END CONF

IS_LOGGED_IN=$(/opt/bin/wget "https://www.btopenzone.com:8443/home" --no-check-certificate --no-cache --timeout 30 -O - 2>/dev/null | grep "now logged in")

if [ "$IS_LOGGED_IN" ]

then
  [[ $DBG ]] && echo "Currently logged in. Nothing to do... :)"
  [[ $DBG ]] && logger -t "logon_fon" "Currently logged in. Nothing to do... :)"

else
  [[ $DBG ]] && echo "You're not logged in... will log in now!"
  [[ $DBG ]] && logger -t "logon_fon" "You're not logged in... will log in now!"
  OUT=$(/opt/bin/wget -qO - --no-check-certificate --no-cache --post-data "username=$RELOG_UNAME&password=$RELOG_PASSW&provider=tbb" "https://www.btopenzone.com:8443/tbbLogon")
  ONLINE=$(echo $OUT | grep "now logged on" )
  if [ "$ONLINE" ]
  then
    [[ $DBG ]] && echo "You're online!"
    [[ $DBG ]] && logger -t "logon_fon" "You're online!"
  else
    [[ $DBG ]] && echo "Could not login :("
    [[ $DBG ]] && logger -t "logon_fon" "Could not login :("
  fi
fi
@TeamMorris

This comment has been minimized.

Copy link

@TeamMorris TeamMorris commented Oct 11, 2016

BT changed the login procedure - this works for me for BT Wifi:

#!/bin/sh

# CONF

DBG=true
RELOG_UNAME="usernamehere"
RELOG_PASSW="passwordhere"

# END CONF

IS_LOGGED_IN=$(wget "https://www.btopenzone.com:8443/home" --no-check-certificate --no-cache --timeout 30 -O - 2>/dev/null | grep "now logged in")

if [ "$IS_LOGGED_IN" ]

then
  $DBG && echo "Currently logged in. Nothing to do... :)"
  $DBG && logger -t "logon_fon" "Currently logged in. Nothing to do... :)"

else
  $DBG && echo "You're not logged in... will log in now!"
  $DBG && logger -t "logon_fon" "You're not logged in... will log in now!"
  OUT=$(wget -qO - --no-check-certificate --no-cache --post-data "username=$RELOG_UNAME&password=$RELOG_PASSW" "https://www.btopenzone.com:8443/ante")
  ONLINE=$(echo $OUT | grep "now logged on" )
  if [ "$ONLINE" ]
  then
    $DBG && echo "You're online!"
    $DBG && logger -t "logon_fon" "You're online!"
  else
    $DBG && echo "Could not login :("
    $DBG && logger -t "logon_fon" "Could not login :("
  fi
fi
@KevWal

This comment has been minimized.

Copy link

@KevWal KevWal commented Jan 7, 2017

And another slight update, the post-data URL now appears to be: https://www.btopenzone.com:8443/tbbLogon

@kn9

This comment has been minimized.

Copy link

@kn9 kn9 commented Oct 4, 2017

Any Windows implementation, please.

@andrewkerr5

This comment has been minimized.

Copy link

@andrewkerr5 andrewkerr5 commented Nov 9, 2017

kn9, you may be able to run this on windows with bash for windows:https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/ although i would recommend a raspberry pi with a big antenna

@jsavage

This comment has been minimized.

Copy link

@jsavage jsavage commented Nov 21, 2017

Any hints on how to test this when sshing into a pi via eth0?

@mgate784

This comment has been minimized.

Copy link

@mgate784 mgate784 commented Jan 18, 2018

Hi, i have a tp link mr3220 mounting openwrt and ROOTer mod,
it's possible set an automatic login from a wifi community (like FON) using that as wifi hotspot? for example, i have set connection (in my case) to Vodafone Wi-Fi, wich is a wifi community, the ssid it's not encrypted but when i enable the connection in wifi hotspot manager section ( https://ibb.co/cGP6wm ), if i visit any page, there's a redirect to this url:

( https://it.portal.vodafone-wifi.com/jcp/it?res=welcome&nasid=90-35-6E-BE-27-40&uamip=192.168.6.1&uamport=80&mac=C0-4A-00-F4-C3-84&challenge=78fa6058aca0bc59f48e49ec131bdd6f&ip=192.168.6.4&userurl=http%3A%2F%2Fwww.gstatic.com%2Fgenerate_204&lang=it_IT&LANGUAGE=it_IT )

this is a screenshot of the page that appears ( http://ibb.co/dBGmwm ) where i have to put my login credential, and then the internet connection it's available for all users connected to the wifi generated by my tplink tp-mr3220

it's possible to do an auto-login script? and where i have to insert it? thank you

@neburferfa

This comment has been minimized.

Copy link

@neburferfa neburferfa commented Aug 31, 2018

Hi,

Someone know that is an iPhone app that installs in your phone the FON_FREE_INTERNET profile and it connects automatically to all the hotspots.

Could be possible to extract from that profile the autologin files?

Seems to be 3 signing certificates:
1 mconfsigner@fon.com
2 mconfsigner@fon.com
3 Entrust Class 1 Client CA

And then add it to the openwrt or dd-wrt

Thanks,

@topdag

This comment has been minimized.

Copy link

@topdag topdag commented May 3, 2019

Great work guys. Was searching for a solution and found this.
Have the above updated script running on AR750 which works well. Get good speeds.
Only thing is that is tends to get "stuck" around every 24hours or so. Will post log of immediatley before for more info when it happens again. Any ideas?

neburferfa - theres a good guide online for this from neilalexander.dev
Got his solution working on a Android smartphone with not much fuss, but no luck on the AR750 yet. It looks a bit tricky. Will post back if I get it working.

@el-vishal

This comment has been minimized.

Copy link

@el-vishal el-vishal commented Jul 8, 2019

Great follow-up guys. This script worked for me for "BT-WIFI-Broadband" (not FON). Running it via crontab on every 3rd minute. I wish there was an interrupt to avoid that delay as well ;-)

#!/bin/sh

# CONF

DBG=true
RELOG_UNAME="username"
RELOG_PASSW="password"

# END CONF

IS_LOGGED_IN=$(wget "https://www.btopenzone.com:8443/home" --no-check-certificate --no-cache --timeout 30 -O - 2>/dev/null | grep "now logged in")

if [ "$IS_LOGGED_IN" ]

then
  $DBG && echo "Currently logged in. Nothing to do... :)"
  $DBG && logger -t "logon_fon" "Currently logged in. Nothing to do... :)"

else
  $DBG && echo "You're not logged in... will log in now!"
  $DBG && logger -t "logon_fon" "You're not logged in... will log in now!"
  OUT=$(wget -qO - --no-check-certificate --no-cache --post-data "username=$RELOG_UNAME&password=$RELOG_PASSW" "https://www.btopenzone.com:8443/tbbLogon")
  ONLINE=$(echo $OUT | grep "now logged on" )
  if [ "$ONLINE" ]
  then
    $DBG && echo "You're online!"
    $DBG && logger -t "logon_fon" "You're online!"
  else
    $DBG && echo "Could not login :("
    $DBG && logger -t "logon_fon" "Could not login :("
  fi
fi
@Lammy94

This comment has been minimized.

Copy link

@Lammy94 Lammy94 commented Jul 20, 2019

Really useful Script! I've been testing it on a raspberry pi which auto-connects to open wifi networks; and only want it to try on specific networks, therefore added a small extension:

#!/bin/bash
#CONF
DBG=true
RELOG_UNAME="<username>"
RELOG_PASSW="<pass>"

#FUNCTION TO CONNECT
connect_to_wifi () {
  IS_LOGGED_IN=$(wget "https://www.btopenzone.com:8443/home" --no-check-certificate --no-cache --timeout 30 -O - 2>/dev/null | grep "now logged in")

  if [ "$IS_LOGGED_IN" ]

  then
    $DBG && echo "Curren3tly logged in. Nothing to do... :)"
    $DBG && logger -t "logon_fon" "Currently logged in. Nothing to do... :)"

  else
    $DBG && echo "You're not logged in... will log in now!"
    $DBG && logger -t "logon_fon" "You're not logged in... will log in now!"
    OUT=$(wget -qO - --no-check-certificate --no-cache --post-data "username=$RELOG_UNAME&password=$RELOG_PASSW" "https://www.btopenzone.com:8443/tbbLogon")
    ONLINE=$(echo $OUT | grep "now logged on" )
    if [ "$ONLINE" ]
    then
      $DBG && echo "You're online!"
      $DBG && logger -t "logon_fon" "You're online!"
    else
      $DBG && echo "Could not login :("
      $DBG && logger -t "logon_fon" "Could not login :("
    fi
}

#GET CURRENT WIFI
myssid=$(iwgetid -r)
#ARRAY CONTAINING SUPPORTED WIFI NETWORKS
supportedssid=("BTWifi-with-FON" "BTWi-fi")

#IF NETWORK IS SUPPROTED, ATTEMPT TO CONNECT
if [[ " ${supportedssid[@]} " =~ " ${myssid} " ]];
then
  echo "Wifi is BT open, will try to connect you"
  connect_to_wifi
else
  echo "Wifi is $myssid"
fi
@Vinblastine

This comment has been minimized.

Copy link

@Vinblastine Vinblastine commented Aug 18, 2019

I'm sorry to say that I could not get this to work. I have been trying to use the 'BT Wifi' selection. I added the "&provider=btoz" to the beginning and to the end of the wget post data string but I just could not get it to work. I am still a bit of a beginner with scripting and linux so I likley doing something wrong. I have tried my best to troubleshoot it but I just seem to be getting nowhere. Could anyone share their working code using "BT WIFI" as the provider?

@Vinblastine

This comment has been minimized.

Copy link

@Vinblastine Vinblastine commented Aug 18, 2019

Typically just after I post this I have manged to work it out by taking another look at the webpage source code. So it seems that to use 'BT WIFI Broadband' the post-data URL is different. It needs to be "https://www.btwifi.com:8443/ante"
I also added the 'provider=btoz&' to the post-data. Im not sure if its still necessary but I left it it in as the script worked!

Here is the code below that I managed to get to work.

#!/bin/sh

# CONF

DBG=true
RELOG_UNAME="username"
RELOG_PASSW="password"

# END CONF

IS_LOGGED_IN=$(wget "https://www.btopenzone.com:8443/home" --no-check-certificate --no-cache --timeout 30 -O - 2>/dev/null | grep "now logged in")

if [ "$IS_LOGGED_IN" ]

then
  $DBG && echo "Currently logged in. Nothing to do... :)"
  $DBG && logger -t "logon_fon" "Currently logged in. Nothing to do... :)"

else
  $DBG && echo "You're not logged in... will log in now!"
  $DBG && logger -t "logon_fon" "You're not logged in... will log in now!"
  OUT=$(wget -qO - --no-check-certificate --no-cache --post-data "provider=btoz&username=$RELOG_UNAME&password=$RELOG_PASSW" "https://www.btwifi.com:8443/ante")
  ONLINE=$(echo $OUT | grep "now logged on" )
  if [ "$ONLINE" ]
  then
    $DBG && echo "You're online!"
    $DBG && logger -t "logon_fon" "You're online!"
  else
    $DBG && echo "Could not login :("
    $DBG && logger -t "logon_fon" "Could not login :("
  fi
fi

@johnk59

This comment has been minimized.

Copy link

@johnk59 johnk59 commented Jan 3, 2020

Hi

Are there instructions on how to get scripts working on Open Wrt router?

Thanks

John

@sscarduzio

This comment has been minimized.

Copy link
Owner Author

@sscarduzio sscarduzio commented Jan 3, 2020

what errors do you have?

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Jan 20, 2020

I wish there was an interrupt to avoid that delay as well ;-)

Have a look for mwan3. It's normally a load-balancing WAN solution, but even if you just have one internet connection it offers a hotplug script you can hook-into to detect its status based on the result of a ping.

https://openwrt.org/docs/guide-user/network/wan/multiwan/mwan3

@seatrout

This comment has been minimized.

Copy link

@seatrout seatrout commented Feb 3, 2020

Llamy94's script works for me on a raspberry pi with a couple of small tweaks -- as he posted, there is a missing "fi" in the main function; and it needs the 'provider=btoz&' added to the post url.

So, a working script for BT Wifi-with-Fon as of February 2020 is this:


#!/bin/bash
#CONF
DBG=true
RELOG_UNAME="<username>"
RELOG_PASSW="<pass>"

#FUNCTION TO CONNECT
connect_to_wifi () {
  IS_LOGGED_IN=$(wget "https://www.btopenzone.com:8443/home" --no-check-certificate --no-cache --timeout 30 -O - 2>/dev/null | grep "now logged in")

  if [ "$IS_LOGGED_IN" ]

  then
    $DBG && echo "Curren3tly logged in. Nothing to do... :)"
    $DBG && logger -t "logon_fon" "Currently logged in. Nothing to do... :)"

  else
    $DBG && echo "You're not logged in... will log in now!"
    $DBG && logger -t "logon_fon" "You're not logged in... will log in now!"
    OUT=$(wget -qO - --no-check-certificate --no-cache --post-data "provider=btoz& username=$RELOG_UNAME&password=$RELOG_PASSW" "https://www.btopenzone.com:8443/tbbLogon")
    ONLINE=$(echo $OUT | grep "now logged on" )
    if [ "$ONLINE" ]
    then
      $DBG && echo "You're online!"
      $DBG && logger -t "logon_fon" "You're online!"
    else
      $DBG && echo "Could not login :("
      $DBG && logger -t "logon_fon" "Could not login :("
    fi
  fi
}

#GET CURRENT WIFI
myssid=$(iwgetid -r)
#ARRAY CONTAINING SUPPORTED WIFI NETWORKS
supportedssid=("BTWifi-with-FON" "BTWi-fi")

#IF NETWORK IS SUPPROTED, ATTEMPT TO CONNECT
if [[ " ${supportedssid[@]} " =~ " ${myssid} " ]];
then
  echo "Connected to a BT wifi net: will try to log in"
  connect_to_wifi
else
  echo "Wifi is $myssid"
fi
@mandregomes

This comment has been minimized.

Copy link

@mandregomes mandregomes commented Mar 14, 2020

Llamy94's script works for me on a raspberry pi with a couple of small tweaks -- as he posted, there is a missing "fi" in the main function; and it needs the 'provider=btoz&' added to the post url.

So, a working script for BT Wifi-with-Fon as of February 2020 is this:


#!/bin/bash
#CONF
DBG=true
RELOG_UNAME="<username>"
RELOG_PASSW="<pass>"

#FUNCTION TO CONNECT
connect_to_wifi () {
  IS_LOGGED_IN=$(wget "https://www.btopenzone.com:8443/home" --no-check-certificate --no-cache --timeout 30 -O - 2>/dev/null | grep "now logged in")

  if [ "$IS_LOGGED_IN" ]

  then
    $DBG && echo "Curren3tly logged in. Nothing to do... :)"
    $DBG && logger -t "logon_fon" "Currently logged in. Nothing to do... :)"

  else
    $DBG && echo "You're not logged in... will log in now!"
    $DBG && logger -t "logon_fon" "You're not logged in... will log in now!"
    OUT=$(wget -qO - --no-check-certificate --no-cache --post-data "provider=btoz& username=$RELOG_UNAME&password=$RELOG_PASSW" "https://www.btopenzone.com:8443/tbbLogon")
    ONLINE=$(echo $OUT | grep "now logged on" )
    if [ "$ONLINE" ]
    then
      $DBG && echo "You're online!"
      $DBG && logger -t "logon_fon" "You're online!"
    else
      $DBG && echo "Could not login :("
      $DBG && logger -t "logon_fon" "Could not login :("
    fi
  fi
}

#GET CURRENT WIFI
myssid=$(iwgetid -r)
#ARRAY CONTAINING SUPPORTED WIFI NETWORKS
supportedssid=("BTWifi-with-FON" "BTWi-fi")

#IF NETWORK IS SUPPROTED, ATTEMPT TO CONNECT
if [[ " ${supportedssid[@]} " =~ " ${myssid} " ]];
then
  echo "Connected to a BT wifi net: will try to log in"
  connect_to_wifi
else
  echo "Wifi is $myssid"
fi

Hi seatrout

Unfortunatly this is not working for me... I have not done the script, but tried to make the connection via terminal using only the relevant lines of the script above. In summary I am not able to login using the command: "wget -qO - --no-check-certificate --no-cache --post-data "provider=btoz& username=$RELOG_UNAME&password=$RELOG_PASSW" "https://www.btopenzone.com:8443/tbbLogon"".

I would really want to have something like this working can you help me?
Thanks in advance

@mrfaptastic

This comment has been minimized.

Copy link

@mrfaptastic mrfaptastic commented Apr 8, 2020

I would really want to have something like this working can you help me?
Thanks in advance

Hi. I have created a new script using python which works perfectly for me. I suggest installing python 3 and the python requests library and having this run every couple of minutes in a cron job.

https://gist.github.com/mrfaptastic/bc1b02f53acafaeccca0724277996eca

The benefit of being a python script is you could run this on a windows PC as well periodically if you install Python for windows.

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Apr 17, 2020

So I converted this into a (badly written) batch file for Windows, using wget from GnuWin32... but the POST doesn't work.

Everything else is fine: detecting the connection and figuring out if I'm logged in are working. This is the wget I use for the login:

wget -O - --no-check-certificate --no-cache --post-data="provider=btoz&username=[username]&password=[password]" "https://www.btopenzone.com:8443/tbbLogon"

The only notable change is that "post-data" has an "=" on Windows.

Provider is btoz for "BTWifi-with-FON" connections. Obviously the and are replaced. I've even tried them hardcoded, with no luck. Tried switching it to "btwfi.com:8443/tbbLogon" as well, just in case. Nope.

Anyone have any ideas why it's (presumably) not accepting the POST parameters?

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Apr 17, 2020

Update: got it working.

I'm using "BT Wi-fi Login" (i.e. BTWifi-with-Fon connections) and needed more parameters and a different URL at the end:

wget -qO - --no-check-certificate --no-cache --post-data="xhtmlLogon=https://www.btwifi.com:8443/ante&provider=btoz&username=[your_username]&password=[your_password]" "https://www.btwifi.com:8443/ante"

For non-Windows, make the '--post-data="blahblahblah...' work by removing the "=" (so '--post-data "blahblahblah...').

Hope it helps!

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Apr 20, 2020

I recently implemented a BT Fon connection-plugin for a little utility I've called Cloud Connect, which I wrote in turn using an FSM library I've been working on called Statebot-sh. If you're interested, please check it out. :)

Of course, doing it this way is major overkill for a little form-posting script! The whole thing is hundreds of lines vs. ~50 here. But it was a lot of fun to write, and FSMs are of course useful for many other things, too.

Just to tickle your fancy, here's the "chart" I used to write Cloud Connect with:

CLOUD_CONNECT_CHART='

  idle ->

  pinging ->
    (online | offline) ->
      pinging

  offline ->
    logging-in -> (online | failure)

  failure -> offline

  // Go directly to [offline] on Hotplug "ifdown"
  online -> offline

  // Pause/resume functionality.
  (idle|pinging|online|offline|logging-in|failure) ->
    paused -> idle

'

I hope it's enough to pique your interest, but even if it's not, thanks for reading. :)

@dan-robotics

This comment has been minimized.

Copy link

@dan-robotics dan-robotics commented Jun 10, 2020

@SpikeTheLobster: Can you share the Windows file to try it?

Thanks.

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Jun 10, 2020

@dan-robotics: This is the batch file I have running every couple of minutes, although I call it via a vbs script which stops the window appearing. Note that you need wget from the GnuWin32 (free) package and I didn't bother setting paths or anything... just went to the dir and ran stuff from there. Excuse the kludge job with minimal checking and no clever stuff. :)

You'll need to change "BTWifi-with-FON" to "BTWi-Fi" (two occurrences) as your local hotspots update to the new SSID. And replace [your_username] and [your_password] where wget posts login info to the BT webpage. I left the on-screen notes in (echo blahblahblah) for times I want to see it running in a normal window.

@echo off
D:
CD "D:\Program Files (x86)\GnuWin32\bin\"

:restart
echo Checking for an active connection...
(netsh wlan show interface | findstr "BTWifi-with-FON" >nul 2>&1)&&GOTO :connected

echo Not found. Reconnecting...
GOTO :no_network

REM Grab the login page and check whether already logged in
:connected
echo.
echo Connected. Checking login...
echo.
wget "https://www.btopenzone.com:8443/home" --no-check-certificate --no-cache --timeout=5 -q -O bt_page.htm
findstr /C:"now logged on to BT Wi-Fi" bt_page.htm

REM Logged in, nothing to do
if %errorlevel%==0 (GOTO :all_done)

REM Otherwise, log in and recheck
echo Not logged in... sending info...
echo.
wget -q -O bt_page.htm --no-check-certificate --no-cache --post-data="xhtmlLogon=https://www.btwifi.com:8443/ante&provider=btoz&username=[your_username]&password=[your_password]" "https://www.btwifi.com:8443/ante"
GOTO :restart

REM Reconnect wifi and recheck
:no_network
netsh wlan connect name="BTWifi-with-FON"
timeout 10
GOTO :restart

:all_done
echo All done
exit

The VB script file is a single line, saved as "invisible.vbs":

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False

And I call it by using something like this:

wscript.exe "D:\Scripts\invisible.vbs" "D:\Scripts\Reconnect_BT.bat"

Hope it helps!

@dan-robotics

This comment has been minimized.

Copy link

@dan-robotics dan-robotics commented Jun 10, 2020

HI @SpikeTheLobster,

  1. I tried the .bat file that you have send.
  2. Installed the wget.
  3. Made the files and vbs script.
  4. Run and seems to connect to the wi-fi automatically, and it reconnect after disconnect.
  5. Not able to login on the login page.
  6. .vbs file give me this error: "subscript out of range" CODE: 800A0009 - Microsoft VBscript runtime error.

If I run the .vbs file it goes in the background and it does not give any error, but it does do the automatically login, it gave me the webpage to do the manual login.
It is good to connect me to the wi-fi automatically if I am disconnected. But still need to login manually. It will be nice to do it automatically.

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Jun 10, 2020

@dan-robotics

You're probably logging in with a different service (or BT is just being annoying). My script is specifically for the "BT Wi-fi" login option, not broadband or any other. You could pull the POST info from the original script or examine their page's source code to figure out what you need to send. That's how I worked out the parameters for mine. :)

The wget error... guessing you're on Win10? Run it as admin and it works fine. Otherwise, it can't write in the wget directory, so it falls over and dies. That might also affect the VB script - I don't know if that works on Win10, though you may be able to do something with PowerShell instead. I found the "invisible" thing on StackExchange, so you could probably find something for Win10 there. ;)

@mevrard31

This comment has been minimized.

Copy link

@mevrard31 mevrard31 commented Jun 10, 2020

hello this is my good scrypt, i use mobaexterm on my windows labtop


uname=xxxxxx@gmail.com
#SFR ADDRESS OR TELEPHONE NUMBER
pass=xxxxxx
#ACCOUNT PASSWORD
target=https://sfr.portal.fon.com

echo Step 1: get the location with wget
wget -O /dev/null -o loc http://perdu.com
echo `grep Location loc` > loc
location=`awk 'BEGIN { FS=" " } { print $2 }' loc`
echo Step 2: extract challenge, MAC addresses, ... from location

challenge=`awk 'BEGIN { FS="&" } { print $4 }' loc | awk 'BEGIN { FS="=" } { print $2 }'`
nasid=`awk 'BEGIN { FS="&" } { print $6 }' loc | awk 'BEGIN { FS="=" } { print $2 }'`
mac=`awk 'BEGIN { FS="&" } { print $7 }' loc | awk 'BEGIN { FS="=" } { print $2 }'`
uamport=`awk 'BEGIN { FS="&" } { print $3 }' loc | awk 'BEGIN { FS="=" } { print $2 }'`
uamip=`awk 'BEGIN { FS="&" } { print $2 }' loc | awk 'BEGIN { FS="=" } { print $2 }'`
mode=`awk 'BEGIN { FS="&" } { print $8 }' loc | awk 'BEGIN { FS="=" } { print $2 }'`
channel=`awk 'BEGIN { FS="&" } { print $9 }' loc | awk 'BEGIN { FS="=" } { print $2 }' | awk 'BEGIN { FS=" " } { print $1 }'`
if [  -z "$channel" ]
then
	exit
fi
echo Step 3: prepare POST with target URL (set in the code)
postdata="https://sfr.portal.fon.com/remote?VNPNAME=FonSFR%3AFR&LOCATIONNAME=FonSFR%3AFR&WISPURL=https%3A%2F%2Fhotspot.wifi.sfr.fr%2FindexEncryptingChilli.php%3Fres%3Drlp%26uamip%3D$uamip%26uamport%3D$uamport%26challenge%3D$challenge%26mode%3D$mode%26mac%3$mac%26userurl%3Dhttps%253A%252F%252Fsfr.portal.fon.com%252Fstatic%252Fsuccess%252Fhtml%252Fen_GB%252Fsuccessalien.html&WISPURLHOME=https%3A%2F%2Fhotspot.wifi.sfr.fr%2FindexEncryptingChilli.php%3Fres%3Dnot_yet%26uamip%3D$uamip%26uamport%3D$uamport%26challenge%3D$challenge%26mode%3D$mode%26mac%3D$mac%26userurl%3Dhttp%253A%252F%252Fyahoo.fr%252F&HSPNAME=FonSFR%3AFR&LANGUAGE=fr_FR&res=hsp-login"
echo Step 4: send POST request
wget -O debug.html $target  --no-check-certificate --post-data="chooseUser=passusers&USERNAME=$uname&PASSWORD=$pass&choix=fon&username=$uname&password=$pass&conditions=on&cond=on" "$postdata"
echo Step 5: get a page on local AP
newloc=`grep location debug.html | awk 'BEGIN { FS="\"" } { print $2 }'`
wget $newloc -O newloc
@dan-robotics

This comment has been minimized.

Copy link

@dan-robotics dan-robotics commented Jun 10, 2020

@dan-robotics

You're probably logging in with a different service (or BT is just being annoying). My script is specifically for the "BT Wi-fi" login option, not broadband or any other. You could pull the POST info from the original script or examine their page's source code to figure out what you need to send. That's how I worked out the parameters for mine. :)

The wget error... guessing you're on Win10? Run it as admin and it works fine. Otherwise, it can't write in the wget directory, so it falls over and dies. That might also affect the VB script - I don't know if that works on Win10, though you may be able to do something with PowerShell instead. I found the "invisible" thing on StackExchange, so you could probably find something for Win10 there. ;)

Thank you.
It's working. Moved the files in the bin directory where wget is located started with admin from there and voila.
If the network became unavailable will reconnect itself again?

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Jun 10, 2020

@dan-robotics

For the automatic reconnection, you'll need to schedule the task to run every x minutes. Windows has a built-in scheduler, so I created a job in mine to kick off the batch file (or, in my case, the VBS script which calls the batch file) at midnight and run every 2 minutes for the whole day. That way the longest the device is offline is 2 minutes (unless the hotspot disappears or something awful).

@Mayday1972

This comment has been minimized.

Copy link

@Mayday1972 Mayday1972 commented Jun 13, 2020

Hello all,

Could someone help me? I am a bit of a computer idiot so please be patient! I have BT WiFi with FON and BT WiFi-x near my home. Do I use this coding to get free WiFi with BT even if I don't have a BT account at all? I need it for my dissertation and we don't have good connection in my house :(

If yes, where exactly do I copy and paste this coding on my Windows 10? And how on earth how do I set up a scheduling like others mentioned?

Many thanks :)

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Jun 13, 2020

@Mayday1972:

No, this is not for free access to anything. It automates the BT login process.
BT do a £15-per-month (effectively unlimited) mobile offering which works with BTWifi-with-FON (currently becoming BTWi-fi instead). BTWifi-x was their secure hotspot network which, apparently, they're decommissioning.

@Lammy94

This comment has been minimized.

Copy link

@Lammy94 Lammy94 commented Jun 13, 2020

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Jun 14, 2020

@SpikeTheLobster Hope you don't mind, but I took the info from your Windows script and popped it into a Linux one: https://github.com/shuckster/statebot-sh/blob/master/examples/cloud-connect/plugins/bt-openzone/config.sh

I have a FON account rather than OpenZone, so I can't test it, but I thought I'd put it up as a second example plugin for the Cloud Connect thing I posted earlier. I put a credit to you in a code-comment.

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Jun 14, 2020

@shuckster You're welcome to do whatever you want with it, without any need to credit anything. It's effectively a kludged-together bastardisation of the original relog.sh at the top of this conversation and a bunch of the other scripts here. :)

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Jun 14, 2020

@SpikeTheLobster Thank you! I guess a lot of Gists are treated as "free for all", but it doesn't always sit right. :)

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Jun 18, 2020

image

We've made some changes — Existing FON Account holders please create a new BT Account

Looks like BT + FON is no more. 😕

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Jun 18, 2020

Yeah, all the "BTWifi-with-FON" hotspots are becoming "BTWi-fi". I just changed that text in my script, everything else still works for me. So far...

@progforums

This comment has been minimized.

Copy link

@progforums progforums commented Jun 19, 2020

FON accounts stopped working today :(

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Jun 19, 2020

I happened to notice the removal in-progress. First the FON login URL would immediately timeout, then after about 30 minutes the "FON" option was completely removed from the BT captive-portal page itself.

There were (still are?) a few "FON" elements hidden in the page, so I was hopeful that this might have been to do with system-maintenance, but after randomly navigating the payment-plans I discovered the "We made some changes" notice I screenshot'ed above.

The options left are: [ BT Broadband ] [ BT Business ] [ BT Wifi ]

Certainly our scripts should be updated for the new SSID, and it's reassuring to know that OpenZone still works per your update @SpikeTheLobster, but it looks like the party is over for FON users.

@barty23

This comment has been minimized.

Copy link

@barty23 barty23 commented Jun 20, 2020

As a fonera user does this mean the option to login to bt using fon has gone?

@progforums

This comment has been minimized.

Copy link

@progforums progforums commented Jun 20, 2020

It would appear so, yes.

@andyb9

This comment has been minimized.

Copy link

@andyb9 andyb9 commented Jul 6, 2020

guys, any update?

ie is it true that fon users can no longer log onto BT-Wifi, as i can't seem to log on with my current username and password :(

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Jul 6, 2020

@andyb9 Believe if or not, here's an update from earlier today:
https://twitter.com/FonCare/status/1280009463290880000
image

Prior to this I have noticed that BT have been asking FON customers to call a support-number when they mention issues with BTWifi-with-FON:
https://twitter.com/bt_uk/status/1274659288917716993

I have not tried calling this number myself yet, but judging by FonCare's tweet today things don't look promising. :(

@andyb9

This comment has been minimized.

Copy link

@andyb9 andyb9 commented Jul 7, 2020

thanks shuckster, very sad new indeed ;(

@chneau

This comment has been minimized.

Copy link

@chneau chneau commented Sep 19, 2020

#!/bin/bash

RELOG_UNAME=username
RELOG_PASSW=password
IS_LOGGED_IN=$(wget "https://www.btopenzone.com:8443/home" --no-check-certificate --no-cache --timeout 30 -O - 2>/dev/null | grep "now logged on")

if [ "$IS_LOGGED_IN" ]; then
  echo "Currently logged in. Nothing to do... :)"
  exit 0
fi
echo "You're not logged in... will log in now!"
OUT=$(wget -qO - --no-check-certificate --no-cache --post-data "username=wam/$RELOG_UNAME&password=$RELOG_PASSW" "https://www.btwifi.com:8443/ante")
ONLINE=$(echo $OUT | grep "now logged on" )
if [ "$ONLINE" ]; then
  echo "You're online!"
  exit 0
fi
echo "Could not login :("
exit 1

this works

@progforums

This comment has been minimized.

Copy link

@progforums progforums commented Sep 19, 2020

@chneau - do you mean it works with FON credentials, or BT Wifi credentials?

@chneau

This comment has been minimized.

Copy link

@chneau chneau commented Sep 19, 2020

@progforums BT wifi creds for me

@s0urc3-ray

This comment has been minimized.

Copy link

@s0urc3-ray s0urc3-ray commented Oct 15, 2020

I don't know how I managed it but I've ended up with a BT WiFi Account that Never Stops Working Despite Me Having No BT Services for 2+ years. Anybody want to buy Never Expiring BT WiFi Account?

Does anybody here know of a easy way to get Virgin Media's Fantastic* WiFi Access without needing a Contract?
They have Terminated their Virgin Mobile Pay as You Go Services so that Free Option is Gone :(

  • == Uncapped Speeds, I've hit crazy high speeds from the Green Cabinet before, Reliable Login done the Proper Way, Great Coverage and Signal Quality if you have a Roadside Room.
@progforums

This comment has been minimized.

Copy link

@progforums progforums commented Oct 15, 2020

I don't know how I managed it but I've ended up with a BT WiFi Account that Never Stops Working Despite Me Having No BT Services for 2+ years. Anybody want to buy Never Expiring BT WiFi Account?

How much would you be asking? (considering BT could switch it off at any time!)

@topdag

This comment has been minimized.

Copy link

@topdag topdag commented Nov 2, 2020

Have been using this solution for a while now (with my "BT Broadband" credentials while I work away) but recently started getting notifications that it could not login --- the account had been suspended by BT "due to unusual activity".
Got it all back up and working again with password change. Any ideas? Are BT monitoring this in some way?

Also - I updated the script for the grep for "now logged on" as the "logged in" had changed on their landing screen once login was authenticated.
And updated for the link as noted above being "www.btwifi.com" instead of the "www.btopenzone.com" in the hope that might help fix it.

@grenjack

This comment has been minimized.

Copy link

@grenjack grenjack commented Dec 13, 2020

Have been using this solution for a while now (with my "BT Broadband" credentials while I work away) but recently started getting notifications that it could not login --- the account had been suspended by BT "due to unusual activity".
Got it all back up and working again with password change. Any ideas? Are BT monitoring this in some way?

Also - I updated the script for the grep for "now logged on" as the "logged in" had changed on their landing screen once login was authenticated.
And updated for the link as noted above being "www.btwifi.com" instead of the "www.btopenzone.com" in the hope that might help fix it.

@topdag What's the working script you have please? I'm trying to login using my BT Broadband credentials but keeps looping on 'connected ... not logged in checking info'

@grenjack

This comment has been minimized.

Copy link

@grenjack grenjack commented Dec 13, 2020

@SpikeTheLobster If you have an updated script that currently works would love to know

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Dec 13, 2020

@SpikeTheLobster If you have an updated script that currently works would love to know

I haven't changed my script at all since updating "BTWifi-with-FON" to "BTWi-fi". It still works. Just checked by comparing my current script to the one I posted above and that's the only change.

Actually, that's not true: I added a check to see if my WiFi was disabled, just in case (the script loops eternally if not). If it's off, the script ends. That's just an extra line after the first netsh:

(netsh wlan show interface | findstr /C:"There is no wireless interface on the system.")&&GOTO :all_done

@aidanmacgregor

This comment has been minimized.

Copy link

@aidanmacgregor aidanmacgregor commented Dec 27, 2020

I recently implemented a BT Fon connection-plugin for a little utility I've called Cloud Connect, which I wrote in turn using an FSM library I've been working on called Statebot-sh. If you're interested, please check it out. :)

Of course, doing it this way is major overkill for a little form-posting script! The whole thing is hundreds of lines vs. ~50 here. But it was a lot of fun to write, and FSMs are of course useful for many other things, too.

Just to tickle your fancy, here's the "chart" I used to write Cloud Connect with:

CLOUD_CONNECT_CHART='

  idle ->

  pinging ->
    (online | offline) ->
      pinging

  offline ->
    logging-in -> (online | failure)

  failure -> offline

  // Go directly to [offline] on Hotplug "ifdown"
  online -> offline

  // Pause/resume functionality.
  (idle|pinging|online|offline|logging-in|failure) ->
    paused -> idle

'

I hope it's enough to pique your interest, but even if it's not, thanks for reading. :)

I Have Just Flashed OpenWRT To A Bt Homehub 5A Using Serial & i am wondering if its possible to install this with the btwif login using a Bt Broadband Account?

Or Anyone Help Me Getting Autologin Working On OpenWRT? Thanks

@aidanmacgregor

This comment has been minimized.

Copy link

@aidanmacgregor aidanmacgregor commented Dec 27, 2020

@SpikeTheLobster If you have an updated script that currently works would love to know

I haven't changed my script at all since updating "BTWifi-with-FON" to "BTWi-fi". It still works. Just checked by comparing my current script to the one I posted above and that's the only change.

Actually, that's not true: I added a check to see if my WiFi was disabled, just in case (the script loops eternally if not). If it's off, the script ends. That's just an extra line after the first netsh:

(netsh wlan show interface | findstr /C:"There is no wireless interface on the system.")&&GOTO :all_done

hi, cn you give ant advice on running this under openwrt? Thanks

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Dec 27, 2020

hi, cn you give ant advice on running this under openwrt? Thanks

Yes: don't try. It's a Windows script... you want the bash stuff higher up. :)

@05pitmas

This comment has been minimized.

Copy link

@05pitmas 05pitmas commented Dec 28, 2020

I wonder if anyone would be able to help or give advice as complete novice on this. I have a GL-AR750S and trying to upload / run this script to auto login details for my BT broadband credentials.

Would anyone be able to help with the process I need to undertake to get the router to run the process as well as confirm whether I need to change anything to login as a BT Broadband user?

Thank you

@aidanmacgregor

This comment has been minimized.

Copy link

@aidanmacgregor aidanmacgregor commented Dec 28, 2020

I wonder if anyone would be able to help or give advice as complete novice on this. I have a GL-AR750S and trying to upload / run this script to auto login details for my BT broadband credentials.

Would anyone be able to help with the process I need to undertake to get the router to run the process as well as confirm whether I need to change anything to login as a BT Broadband user?

Thank you

Same Here Struggling To Get Working , not Got much Experience with Linux, openwrt & Scripts

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Dec 30, 2020

@aidanmacgregor @05pitmas - The Cloud Connect project is more complex than the much simpler script at the top of this Gist, but I did update it recently and also wrote some Installation and Quick Start instructions, which I hope will be a bit more useful than what was there before.

I can tell you that I have also acquired a GL-AR750S and Cloud Connect works great with it, as it did before on a GL-AR300M and GL-MT300N-V2 before (I love these little boxes. :)

(If you're not sure how to use SSH you might need a bit more help, but I thought you may have got that far already.)

@aidanmacgregor

This comment has been minimized.

Copy link

@aidanmacgregor aidanmacgregor commented Jan 2, 2021

@aidanmacgregor @05pitmas - The Cloud Connect project is more complex than the much simpler script at the top of this Gist, but I did update it recently and also wrote some Installation and Quick Start instructions, which I hope will be a bit more useful than what was there before.

I can tell you that I have also acquired a GL-AR750S and Cloud Connect works great with it, as it did before on a GL-AR300M and GL-MT300N-V2 before (I love these little boxes. :)

(If you're not sure how to use SSH you might need a bit more help, but I thought you may have got that far already.)

Yhea i managed to flash using serial, managed to get samba 4 working which needed some files edited using ssh and winSCP, i know my way around roughly just not fluent enough to know all this off the top of my head yet, ive been messing with android firmwares too :)

@mandregomes

This comment has been minimized.

Copy link

@mandregomes mandregomes commented Jan 24, 2021

Hello all, I would like to write a very simple script for my RPI to auto login to the closest BTwifi public hotspot using my login info. There is the captive portal page and then it is now required to click on button "Login now" and then choose the account type in the drop down list and finally insert the username and password in the the 2 fields. Anyone can help me achieving this in a simple script? I was also thinking using a simple webpage like google and the ping function or another function to check if the RPI is online or offline? What would be the best and simplest way to do it? Thanks for your attention and time ;)

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Jan 24, 2021

@mandregomes I'm not sure how simple you'll find it, but check out the Cloud Connect script I mentioned previously. It's more complex than the other scripts posted here, but as I'm using it right now to post this message I can tell you for sure it works with a valid BTWi-fi account. (Maybe just going over the README will be valuable if you don't think you'll use the actual script?)

In my experience, using the "closest" hotspot isn't always what you want, but it's certainly normal behaviour for most wireless-networking drivers. On the GL-iNet devices I'm using myself, by default, they will try to choose the hotspot with the best signal/noise ratio. But that doesn't guarantee the fastest speed or most reliable connection. Fortunately, the boxes allow for a specific BSSID to be "forced", even if there are others available with "stronger" S/N ratios.

Cloud Connect (and the scripts posted by others in this Gist) only detect the "BTWi-fi" SSID before running their automatic login procedure, which work basically as you've described in terms of "filling in the login form" automatically, drop-down included.

If you're writing your own script, just use this Gist as a reference as I did when I wrote Cloud Connect. You're welcome to dive into the repository of Cloud Connect and use it as a reference to write your own script, too.

Good luck! :)

@Ribsy8

This comment has been minimized.

Copy link

@Ribsy8 Ribsy8 commented Jan 25, 2021

Since they changed the web interface and I log into via BT Broadband, it took me hours to get it working. This was tested on ubunto, and I am not a programmer so hope it helps those that are stuck.

The line that needs amended is below. I removed the provider, and changed url to https://www.btwifi.com:8443/tbbLogon

OUT=$(wget -qO - --no-check-certificate --no-cache --post-data "username=$RELOG_UNAME&password=$RELOG_PASSW" "https://www.btwifi.com:8443/tbbLogon")
@mandregomes

This comment has been minimized.

Copy link

@mandregomes mandregomes commented Jan 31, 2021

@Ribsy8 Does that work on a raspberry pi OS?

@Ribsy8

This comment has been minimized.

Copy link

@Ribsy8 Ribsy8 commented Feb 6, 2021

Sorry I dont know. I managed to get it working in lububto and ubunto only. Someone else would know or can help

@thisisaz

This comment has been minimized.

Copy link

@thisisaz thisisaz commented Feb 8, 2021

@SpikeTheLobster any chance you can elaborate on what you do with wget? I installed it, made the batch file, but it doesn’t recognise the command wget, so mabe I need to put something in somewhere? I just really need this working but have no idea what to do so mabe you can do a real dummy walk through version? All help would be greatly appriciated! Thanks

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Feb 8, 2021

@thisisaz Chances are it's because wget doesn't put itself on your PATH in Windows. That's why my batch starts with the lines to go to the right drive and the folder with wget in it (so it's working in that folder). You should put wget on your path, blah blah, but I couldn't be bothered.

@thisisaz

This comment has been minimized.

Copy link

@thisisaz thisisaz commented Feb 8, 2021

@SpikeTheLobster great this actually worked and I believe it is doing it job, have to wait about a hour when it logs out and see if it logs back in, only thing is I have to select broadband in the drop down menu so I’m hoping this doesn’t effect it. I’ll let you know, thanks for your help

@sscarduzio

This comment has been minimized.

Copy link
Owner Author

@sscarduzio sscarduzio commented Feb 8, 2021

Hi, I'm the original author of this 7 years old script, and I'm quite amazed it's still useful (albeit modified in different forms) to so many people for so many years. Should this maybe become a repository? So we could collect and maintain all the variants?

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Feb 8, 2021

@thisisaz It'll probably send the wrong form values, since it's set to choose WiFi. I suspect broadband has a different form destination (and provider setting.

From a VERY quick look (no guarantee this'll work), you'd need to change the POST line:

wget -q -O bt_page.htm --no-check-certificate --timeout=10 --no-cache --post-data="https://www.btwifi.com:8443/tbbLogon&provider=tbb&username=[username]&password=[password]" "https://www.btwifi.com:8443/tbbLogon"

@Ribsy8

This comment has been minimized.

Copy link

@Ribsy8 Ribsy8 commented Feb 9, 2021

Maybe a bit off topic, but is there a way to force change the ip address by logging off, removing cookies or hidden files? To get a fresh up address on reconnecting? Any help would be much appreciated

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Feb 9, 2021

@Ribsy8 On Windows, you can't force it to get a different IP but you can release the current one and flush DNS, then let it reconnect.

ipconfig /release all
ipconfig /flushdns

A more extreme version disables/reenables your WiFi connection, using the interface name on the Windows Networking list (mine includes a 5-second pause to give it a chance to drop and everything):

netsh interface set interface name="[Wireless Network Connection]" disable
ipconfig /flushdns
timeout 5
netsh interface set interface name="[Wireless Network Connection]" enable

@Ribsy8

This comment has been minimized.

Copy link

@Ribsy8 Ribsy8 commented Feb 10, 2021

thanks Spike, I did some research last night, and found a way to get a forced new ip address via changing the mac address of network adapter. I made a script of it in linux. Bt wifi seems to play up sometimes so the tip on flushing dns fixed the problems i was getting intermittently so thanks for the info. You could in theory get this working in windows by using a mac address changer or manually changing it before reconnecting to bt wifi, tips would be here for windows https://www.digitalcitizen.life/change-mac-address-windows. If anyone can make an easy script file for windows xp, 7 and 10 please let me know.

My linux script goes like this, you need to download macchanger and make a script called btfon.sh which does the auto connecting to bt wifi. my script flushes the dns just to be sure u dont get any errors. Spent a good few hours getting this to work and googling all the error messages until it was working. Also i ran this as root. Hope this helps someone. Disclaimer, most of the code is via many of the helpful contributors here so credit goes to them, and all the other people that have been posting solutions of errors on other websites.

my cma.sh
#!/bin/bash
service network-manager stop
echo stopping network services
sleep 5s
ifconfig wlxf8d111b5c5c0 down
sleep 5s
macchanger -b -a wlxf8d111b5c5c0
sleep 5s
ifconfig wlxf8d111b5c5c0 up
sleep 5s
echo Restarting Wifi
sleep 5s
service network-manager start
echo starting network services
sleep 20s
systemd-resolve --flush-caches
echo flushing dns
sleep 5s
/home/user/btfon.sh
sleep 20s
curl bot.whatismyipaddress.com

my btfon,sh (checks wifi is connect to bt wifi before continuing to BT Broadband)
#!/bin/bash
#CONF
DBG=true
RELOG_UNAME=""
RELOG_PASSW=""

#FUNCTION TO CONNECT
connect_to_wifi () {
IS_LOGGED_IN=$(wget "https://www.btopenzone.com:8443/home" --no-check-certificate --no-cache --timeout 30 -O - 2>/dev/null | grep "now logged in")

if [ "$IS_LOGGED_IN" ]

then
$DBG && echo "Currently logged in. Nothing to do... :)"
$DBG && logger -t "logon_fon" "Currently logged in. Nothing to do... :)"

else
$DBG && echo "You're not logged in... will log in now!"
$DBG && logger -t "logon_fon" "You're not logged in... will log in now!"
OUT=$(wget -qO - --no-check-certificate --no-cache --post-data "username=$RELOG_UNAME&password=$RELOG_PASSW" "https://www.btwifi.com:8443/tbbLogon")
ONLINE=$(echo $OUT | grep "now logged on" )
if [ "$ONLINE" ]
then
$DBG && echo "You're online!"
$DBG && logger -t "logon_fon" "You're online!"
else
$DBG && echo "Could not login :("
$DBG && logger -t "logon_fon" "Could not login :("
fi
fi
}

#GET CURRENT WIFI
myssid=$(iwgetid -r)
#ARRAY CONTAINING SUPPORTED WIFI NETWORKS
supportedssid=("BTWifi-with-FON" "BTWi-fi")

#IF NETWORK IS SUPPROTED, ATTEMPT TO CONNECT
if [[ " ${supportedssid[@]} " =~ " ${myssid} " ]];
then
echo "Connected to a BT wifi net: will try to log in"
connect_to_wifi
else
echo "Wifi is $myssid"
fi

my bt.sh (This one is the shortened version that doesn't check the wifi is on bt wifi or you cant get iwgetid to work), will connect to BT Broadband)
#!/bin/bash

RELOG_UNAME=""
RELOG_PASSW=""
IS_LOGGED_IN=$(wget "https://www.btopenzone.com:8443/home" --no-check-certificate --no-cache --timeout 30 -O - 2>/dev/null | grep "now logged on")

if [ "$IS_LOGGED_IN" ]; then
echo "Currently logged in. Nothing to do... :)"
exit 0
fi
echo "You're not logged in... will log in now!"
OUT=$(wget -qO - --no-check-certificate --no-cache --post-data "username=$RELOG_UNAME&password=$RELOG_PASSW" "https://www.btwifi.com:8443/tbbLogon")
ONLINE=$(echo $OUT | grep "now logged on" )
if [ "$ONLINE" ]; then
echo "You're online!"
exit 0
fi
echo "Could not login :("
exit 1

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Apr 17, 2021

Hi, I'm the original author of this 7 years old script, and I'm quite amazed it's still useful (albeit modified in different forms) to so many people for so many years. Should this maybe become a repository? So we could collect and maintain all the variants?

I missed the notification for this post, but this is a great idea @sscarduzio . 👍 It can only improve discoverability, which is currently served by having to read this thread from top-to-bottom.

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Apr 17, 2021

My lady uses a Win10 laptop, so I just spent a little while converting the basic script to Powershell.

Known issues:

  • Unfortunately, Powershell doesn't allow you to switch on/off the wifi (in the same way as clicking it on/off in the tray) without messing with the registry, so this detects "wifi off" and exits. Turn wifi on manually and it'll do the rest... hopefully. Powershell is VERY twitchy and random, in my experience.
  • The "hidden" windowstyle switch for scheduling/running doesn't really work: you get a flicker of ugly blue window, then it goes away.
  • The POST of form data doesn't cater for the connection dropping while sending, so it could potentially loop endlessly at that point. You could drop in an IF (tidy) or something.
  • Task scheduler command is: powershell.exe -windowstyle hidden [ps1 file with path, e.g. "C:\Users\Me\Reconnect.ps1"]

Hope it helps. :)

$connection = netsh wlan show interface

if ($connection -like '*Software Off*')
    {
    exit
    }

do 
    {
    netsh wlan connect name="BTWi-fi"
    timeout 5
    $connection = netsh wlan show interface
    } until ($connection -ilike '*BTWi-fi*')

$form = @{
            provider = 'btoz'
            username = 'username'
            password = 'password'
        }

$webpage = wget https://www.btopenzone.com:8443/home -DisableKeepAlive -TimeoutSec 30
while ($webpage -inotlike '*now logged on to BT Wi-Fi*')
    {
    $webpage = wget -Method Post -Uri https://www.btwifi.com:8443/ante -Body $form 
    }

exit
@topdag

This comment has been minimized.

Copy link

@topdag topdag commented Apr 21, 2021

Have been using this solution for a while now (with my "BT Broadband" credentials while I work away) but recently started getting notifications that it could not login --- the account had been suspended by BT "due to unusual activity".
Got it all back up and working again with password change. Any ideas? Are BT monitoring this in some way?

Also - I updated the script for the grep for "now logged on" as the "logged in" had changed on their landing screen once login was authenticated.
And updated for the link as noted above being "www.btwifi.com" instead of the "www.btopenzone.com" in the hope that might help fix it.

Still working good on the GLi.net AR750s router following the instructions (using bash script)
Only thing I noticed was, when I reset my router recently, it had issues with "wget" call in the code where it suddenly didn't like the "--no-cache" argument and spat out an error, so just removed that (seems to work ok still).
Still looking for a more secure way to do all this (e.g. utilizing btwifi-x), but is beyond me.

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Apr 21, 2021

Still looking for a more secure way to do all this (e.g. utilizing btwifi-x), but is beyond me.

BTWiFi-X is discontinued. I contacted them a while back to ask how to get access, since it's secure, but apparently they're dismantling that network completely.

@topdag

This comment has been minimized.

Copy link

@topdag topdag commented Apr 26, 2021

Still looking for a more secure way to do all this (e.g. utilizing btwifi-x), but is beyond me.

BTWiFi-X is discontinued. I contacted them a while back to ask how to get access, since it's secure, but apparently they're dismantling that network completely.

Ah bummer - that makes sense why its less prevalent.

Would basic wifi snooping put us risk of inadvertently revealing the username and password when the script is reconnecting?
Is there possibly any way to make this method a bit more secure?

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Apr 26, 2021

Would basic wifi snooping put us risk of inadvertently revealing the username and password when the script is reconnecting?
Is there possibly any way to make this method a bit more secure?

If the account is compromised you can always reset it via a telephone call to their support line. Not sure if BT has 2-factor authentication for its accounts, but it might comfort you to turn that on if they do, since the issue you're describing is precisely the use-case for it.

Anyway, are you sure about the balance of risk on this one? I mean, after you've successfully logged-on ALL of your network traffic is going over somebody else's connection. If you're happy with that, you're probably happy about briefly sending the username/password of your BT account via cleartext.

@topdag

This comment has been minimized.

Copy link

@topdag topdag commented Apr 26, 2021

Would basic wifi snooping put us risk of inadvertently revealing the username and password when the script is reconnecting?
Is there possibly any way to make this method a bit more secure?

If the account is compromised you can always reset it via a telephone call to their support line. Not sure if BT has 2-factor authentication for its accounts, but it might comfort you to turn that on if they do, since the issue you're describing is precisely the use-case for it.

Anyway, are you sure about the balance of risk on this one? I mean, after you've successfully logged-on ALL of your network traffic is going over somebody else's connection. If you're happy with that, you're probably happy about briefly sending the username/password of your BT account via cleartext.

Thanks for your input shuckster. Some things to consider.
I understand the https://www.btwifi.com:8443/home
capture portal has end to end encryption - AES 256 GCM and ECDHE_RSA - would that mean login credentials are not sent as clear text?
I'm not really worried about the hub owner snooping or anything like that, more just understanding the level of risk out of educational interest.
It's certainly, on balance, very nice to have "free" internet wherever BTWifi is, just seeking to understand how it all works.

@SpikeTheLobster

This comment has been minimized.

Copy link

@SpikeTheLobster SpikeTheLobster commented Aug 4, 2021

A small update...

Over time, I've noticed that the wget command to check logged-in status tends to lock up on Windows, as well as causing trouble by trying to write a file (which, as noted above, requires admin access). Since I'm running the script every 2 minutes and Windows appears to be incapable of following the "if running, don't start another" instruction in the scheduler (!), that often means I have about 30 processes at the end of the day, grinding the connection and slowing everything down.

So I've switched my logged-in check to ping a server outside the BT network. The ping only works when logged in - BT blocks it otherwise. I went for my GoDaddy VPS's address but one of the Google.com servers would work as well.

To do this, I've replaced these lines:

`wget "https://www.btwifi.com:8443/home" --no-check-certificate --tries=2 --no-cache --timeout=10 -q -O bt_page.htm
findstr /C:"now logged on to BT Wi-Fi" bt_page.htm

REM Logged in, nothing to do
if %errorlevel%==0 (GOTO :all_done)`

With this:

(ping 166.62.44.150 | findstr /C:"Reply from 166.62.44.150") && GOTO :all_done

Works a treat: no more clogging. :)

@adammcguk

This comment has been minimized.

Copy link

@adammcguk adammcguk commented Oct 30, 2021

@shuckster I just tried the cloud-connect statebot plugin today and it works well on my GL.iNet GL-AR750S router. It's the first time I've done anything remotely like this. However, when the router is powered off at the mains and back on, I get the captive portal screen for BT WiFi , but once logged in, it seems to work fine. Is this normal? Also, I'm using BT Broadband credentials, so I renamed and edited the dot-secrets file in the bt-broadband folder. I also changed the default plugin value in cloud-connect/_config.sh from "bt-wifi" to "bt-broadband". Is that correct? Also, there was no file in /etc/crontabs, so I created one named "root". Same goes for "99-captive-portal". I had to create that file too. Does that sound right? Thank you for the help.

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Oct 30, 2021

Hey @adammcguk . Sounds like you've done pretty well with setting up to me! Nice work.

It's true that if you reboot your 750S you'll see the captive-portal page until cron runs the Cloud Connect script again. For me, this happens within 7 minutes, but perhaps checking every 5 or 3 minutes is better. You can adjust this in your root crontab:

# /etc/crontabs/root
# Check the connection every 3rd minute :
*/3 * * * * /opt/statebot/examples/cloud-connect/cc.sh check

Ideally, the "hotplug" script should take care of the first login after power-on. If you're already happy with your crontab settings, you can try tweaking the sleep 5 line in the hotplug.sh script here to hopefully improve power-on login time. Perhaps a value of 30 (seconds) would work better for you.

@adammcguk

This comment has been minimized.

Copy link

@adammcguk adammcguk commented Oct 30, 2021

@shuckster Thanks for the help. The router was kept on today but I came back to no internet and the captive portal. If I reboot the router, I'm also not getting auto logged in even after waiting for an hour. Can't seem to figure it out :( Is there anyway to run a test or diagnostic to make sure it is running properly? As mentioned, I did change the default plugin value in cloud-connect/_config.sh from "bt-wifi" to "bt-broadband" - was that OK. Otherwise, how does this plugin know whether to use bt-wifi/bt-broadband/bt-business-broadband? Thanks again.

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Oct 30, 2021

The cc.sh script uses the values in _config.sh, but you can do things manually with cloud-connect.sh for testing.

In your case, run ./cloud-connect.sh bt-broadband check from the folder that CC lives in. Some information will print and let you know if it went well or not.

After this, you can then see if cc.sh is picking up your _config.sh by running: ./cc.sh check

If these both look okay then it may be that your cron job is not running. To confirm that, reboot and then keep an eye on what's in the /tmp folder after your 750S has been running long enough to do a few CC checks. You should see a file called /tmp/bt_cookies.txt if it has been working okay.

The commands to enable/(re)start cron are:

/etc/init.d/cron enable
/etc/init.d/cron restart

No harm in trying to run those first before doing the debugging steps above.

@adammcguk

This comment has been minimized.

Copy link

@adammcguk adammcguk commented Oct 30, 2021

@shuckster I rebooted the router and there was no auto login to the captive portal. After logging into the portal manually, I checked

"./cloud-connect.sh bt-broadband check" produces:

"Specified plugin: [bt-broadband]
Loading plugin: ./plugins/bt-broadband/api.sh
Checking Wifi connected to: BTWi-fi
. :
| | Statebot :: cloud-connect
| | Current state: [online]
||_______________________________________ _ _ _ _ _

INFO: eId:1 Handling event: check, from state [online]
INFO: eId:1 Changing state: online->pinging
INFO: eId:1 on_transitions() undefined: Skipping transition handlers
Checking Captive Portal status...
INFO: eId:2 Handling event: connected, from state [pinging]
INFO: eId:2 Changing state: pinging->online
INFO: eId:2 on_transitions() undefined: Skipping transition handlers
Online!
Failure count: 1
WARN: Problem running THEN function: online_action
INFO: cloud-connect :: Exiting with state :: online"

and "./cc.sh check" produces:

"Specified plugin: [bt-broadband]
Loading plugin: ./plugins/bt-broadband/api.sh
Checking Wifi connected to: BTWi-fi
. :
| | Statebot :: cloud-connect
| | Current state: [online]
||_______________________________________ _ _ _ _ _

INFO: eId:1 Handling event: check, from state [online]
INFO: eId:1 Changing state: online->pinging
INFO: eId:1 on_transitions() undefined: Skipping transition handlers
Checking Captive Portal status...
INFO: eId:2 Handling event: connected, from state [pinging]
INFO: eId:2 Changing state: pinging->online
INFO: eId:2 on_transitions() undefined: Skipping transition handlers
Online!
Failure count: 0
WARN: Problem running THEN function: online_action
INFO: cloud-connect :: Exiting with state :: online"

/tmp/bt_cookies.txt exists and contains:

#HttpOnly_www.btwifi.com FALSE / FALSE 0 JSESSIONID F5EF10C9C981E14254BB9CCFC15B26DB

Do you need to enable cron each time the router reboots?

Thanks again, I really hope to get this working and appreciate your help.

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Oct 30, 2021

Looks like the script works fine! (The logs prefixed with INFO: are nothing to worry about - just informational as you might guess.)

So yes, it does seem like an issue with cron. Try enabling it through the web UI:

  • Login to the GL-iNet Admin Panel
  • More Settings > Advanced
  • (Login again)
  • System > Scheduled Tasks
  • Check the content of the crontab
  • "Submit" when done
@adammcguk

This comment has been minimized.

Copy link

@adammcguk adammcguk commented Oct 30, 2021

Hi, I was hoping this would be the case and would solve it but the captive portal has returned and won't auto login.

Here was the cron section as I had it via the web UI:

# Every 3rd minute, check the connection:
*/3 * * * * /opt/statebot/examples/cloud-connect/cc.sh check

I then ran ./cloud-connect.sh bt-broadband check:

Specified plugin: [bt-broadband]
Loading plugin: ./plugins/bt-broadband/api.sh
Checking Wifi connected to: BTWi-fi
. : 
| |  Statebot :: cloud-connect
| |  Current state: [offline]
|_|________________________________________ _ _ _  _  _ 

INFO: <eId:1> Handling event: check, from state [offline]
INFO: <eId:1> Changing state: offline->pinging
INFO: <eId:1> on_transitions() undefined: Skipping transition handlers
Checking Captive Portal status...
INFO: <eId:2> Handling event: disconnected, from state [pinging]
INFO: <eId:2> Changing state: pinging->offline
INFO: <eId:2> on_transitions() undefined: Skipping transition handlers
INFO: <eId:3> Handling event: login, from state [offline]
INFO: <eId:3> Changing state: offline->logging-in
INFO: <eId:3> on_transitions() undefined: Skipping transition handlers
WARN: Not logged-in, trying...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0> POST /tbbLogon HTTP/1.1
> Host: www.btwifi.com:8443
> User-Agent: curl/7.66.0
> Accept: */*
> Cookie: JSESSIONID=8B59E05FBACD05F6C638379547456221
> Content-Length: 119
> Content-Type: application/x-www-form-urlencoded
> 
} [119 bytes data]
< HTTP/1.1 302 
< Cache-Control: no-cache
< Pragma: no-cache
< Set-Cookie: JSESSIONID=D262CEE456D4E0932B2D3583F25DBB11; Path=/; HttpOnly
< Location: /home
< Content-Length: 0
< Date: Sat, 30 Oct 2021 22:36:28 GMT
< 
100   119    0     0  100   119      0     22  0:00:05  0:00:05 --:--:--   343
> GET /home HTTP/1.1
> Host: www.btwifi.com:8443
> User-Agent: curl/7.66.0
> Accept: */*
> Cookie: JSESSIONID=D262CEE456D4E0932B2D3583F25DBB11
> 
< HTTP/1.1 200 
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Type: text/html;charset=UTF-8
< Content-Length: 27410
< Date: Sat, 30 Oct 2021 22:36:28 GMT
< 
{ [8033 bytes data]
100 27410  100 27410    0     0   4999      0  0:00:05  0:00:05 --:--:--  4999
INFO: Checking for login redirection...
INFO: <eId:4> Handling event: failed, from state [logging-in]
INFO: <eId:4> Changing state: logging-in->failure
INFO: <eId:4> on_transitions() undefined: Skipping transition handlers
ERR!: Could not login :(
WARN: Failure count: 3
Retry limit not yet reached...
INFO: <eId:5> Handling event: disconnected, from state [failure]
INFO: <eId:5> Changing state: failure->offline
INFO: <eId:5> on_transitions() undefined: Skipping transition handlers
WARN: OFFLINE!
INFO: cloud-connect :: Exiting with state :: offline

I then ran: ./cc.sh check:

Specified plugin: [bt-broadband]
Loading plugin: ./plugins/bt-broadband/api.sh
Checking Wifi connected to: BTWi-fi
. : 
| |  Statebot :: cloud-connect
| |  Current state: [offline]
|_|________________________________________ _ _ _  _  _ 

INFO: <eId:1> Handling event: check, from state [offline]
INFO: <eId:1> Changing state: offline->pinging
INFO: <eId:1> on_transitions() undefined: Skipping transition handlers
Checking Captive Portal status...
INFO: <eId:2> Handling event: disconnected, from state [pinging]
INFO: <eId:2> Changing state: pinging->offline
INFO: <eId:2> on_transitions() undefined: Skipping transition handlers
INFO: <eId:3> Handling event: login, from state [offline]
INFO: <eId:3> Changing state: offline->logging-in
INFO: <eId:3> on_transitions() undefined: Skipping transition handlers
WARN: Not logged-in, trying...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0> POST /tbbLogon HTTP/1.1
> Host: www.btwifi.com:8443
> User-Agent: curl/7.66.0
> Accept: */*
> Cookie: JSESSIONID=3151714CC152640035D93A0483AB7CF2
> Content-Length: 119
> Content-Type: application/x-www-form-urlencoded
> 
} [119 bytes data]
< HTTP/1.1 302 
< Cache-Control: no-cache
< Pragma: no-cache
< Set-Cookie: JSESSIONID=60808BC8206E1515932332CF14FDF039; Path=/; HttpOnly
< Location: /home
< Content-Length: 0
< Date: Sat, 30 Oct 2021 22:36:57 GMT
< 
100   119    0     0  100   119      0     22  0:00:05  0:00:05 --:--:--   543
> GET /home HTTP/1.1
> Host: www.btwifi.com:8443
> User-Agent: curl/7.66.0
> Accept: */*
> Cookie: JSESSIONID=60808BC8206E1515932332CF14FDF039
> 
< HTTP/1.1 200 
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Type: text/html;charset=UTF-8
< Content-Length: 27410
< Date: Sat, 30 Oct 2021 22:36:58 GMT
< 
{ [8033 bytes data]
100 27410  100 27410    0     0   5092      0  0:00:05  0:00:05 --:--:--  324k
INFO: Checking for login redirection...
INFO: <eId:4> Handling event: failed, from state [logging-in]
INFO: <eId:4> Changing state: logging-in->failure
INFO: <eId:4> on_transitions() undefined: Skipping transition handlers
ERR!: Could not login :(
WARN: Failure count: 4
Retry limit not yet reached...
INFO: <eId:5> Handling event: disconnected, from state [failure]
INFO: <eId:5> Changing state: failure->offline
INFO: <eId:5> on_transitions() undefined: Skipping transition handlers
WARN: OFFLINE!
INFO: cloud-connect :: Exiting with state :: offline

My previous successful checks were only the case after I manually logged into the captive portal. Otherwise it just sits at this failed state. Does any of this information help? Thanks again @shuckster .

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Oct 30, 2021

There are a couple more things this might be down to: First, check the web UI GL-iNet > More Settings > Custom DNS Server. Disable "DNS Rebinding Attack Protection" if it's enabled. Alternatively, it might be that CC is not looking at the right network interface. I'm not too sure about that one, as CC is configured by default for my own 750S, and I haven't deviated from any important default settings.

If you're still not having luck, check out the contents of /tmp/bt_previous_attempt.html to see if you get any errors from the captive-portal page as CC tries to login.

@adammcguk

This comment has been minimized.

Copy link

@adammcguk adammcguk commented Oct 31, 2021

The contents of bt_previous_attempt.html are below. I wonder if some of the tags in the page source code are different from the ones you've listed in cloud-connect/plugins/bt-broadband/config.sh. For example, in the page source code, I see reference to https://www.btwifi.com:8443/ante but not in your config.sh. It is in your config.sh for /plugins/bt-wifi but not /plugins/bt-broadband. Is that relevant?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-GB" xml:lang="en-GB" class="noJS version-a" >
  <head>
    <meta http-equiv="X-UA-Compatible" content="chrome=1; IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <title>Unlimited wi-fi from BT Wi-fi</title>
    <meta http-equiv="Pragma" content="no-cache"/>
    <meta http-equiv="Expires" content="-1"/>
    <meta name="Keywords" content="BT, British Telecommunications, Help, Support, Advice, broadband, fibre, connection, speed, email, TV, phone,
    <meta name="Description" content="Help with BT's broadband, TV and phone services, plus billing options and advice."/>

    <link href="https://cdn.btwifi.com/contentserver/_assets/css/2020/btwifi_2020.css" media="all" type="text/css" rel="stylesheet"/>
    <link href="https://cdn.btwifi.com/contentserver/captiveportal/bthomehub/css/homepage-styles.css" media="all" type="text/css" rel="stylesheet
    <!--[if lte IE 8]>
    <link rel="stylesheet" type="text/css" href="https://cdn.btwifi.com/contentserver/captiveportal/bthomehub/css/homepage-ie8-and-down.css" />
    <![endif]-->
        <script type="text/javascript">
    window._exhaust_init_queue = window._exhaust_init_queue || [];
    window.emitToExhaust = function( event_name, json_payload ) {
        var args = arguments;
        if ( typeof window._exhaust == "object" ) {
            window._exhaust.trigger.apply( window._exhaust, args );
            return true;
        } else {
            window._exhaust_init_queue.push( args );
            return false;
        }
    }
</script>

<script type="text/javascript">

   var pageName = "OZ|Home Hub|Landing Page";
   var breadcrumb = "";
   var genericOrigin = "Hotspot|Home Hub|Landing Page";



    var pageName = pageName.replace(/\|/g, ':');

var breadcrumb = pageName.replace(/\:/g, ',');                                                                                              
    var genericOrigin = genericOrigin.replace(/\|/g, ':');                                                                                       
                                                                                                                                                
    if(breadcrumb != ''){                                                                                                                        
        breadcrumb = breadcrumb.split(",")                                                                                                       
    }                                                                                                                                            
                                                                                                                                                 
            var environment = "production";                                                                                                      
                                                                                                                                                 
    var digitalData = {                                                                                                                          
        "application": {                                                                                                                         
            "name": "BT Wifi", // fixed value                                                                                                    
            "environment": environment, //fill with "development" or "production" - set above                                                    
            "version": "1.0.0", //release number current is example only                                                                         
            "is_spa": false // Is single-page application                                                                                        
        },                                                                                                                                       
        "page": {                                                                                                                              
            "id": "", // not relevant leave empty string                                                                                       
            "title": document.title, //fixed                                                 
            "url": window.location.href, //fixed                                             
            "referrer": document.referrer, //fixed                                           
            "breadcrumb": breadcrumb, //array of strings describing the heirarchy found in heir1 values of each page in your current implementati
            "language": "en-gb", // insert language and country code in string if possible or relevant e.g. en-gb                                
            "timestamp": new Date(), //fixed                                                                                                     
            "category": {                                                                                                                        
                "primaryCategory": "customer", //fixed                                                                                           
                "type": "", //leave empty string                                                                                                 
                "channel": "Consumer", // fixed                                                                                                  
                "area": "BT Wifi" //fixed                                                                                                        
            }                                                                                                                                    
        },                                                                                                       
        "vendor": {                                                                                                                              
            "adobe": {                                                                                           
                "analytics": {                                                                                                                   
                    "pageName": pageName //populate with current page names that fill s.pageName in existing implementation                      
                }                                                                                                                                
            }                                                                                                                                    
        },                                                                                                                                       
        "hotspot" : {                                                                                                                            
            "genericorigin" : genericOrigin, //populate with the value defined in s.eVar3 in existing implementation                             
        },                                                                                                                                       
        "event": [],                                                       
"system": [],                                                                                                                            
        "user": []                                                                                                                               
    };                                                                                                                                           
    //console.log(digitalData)                                                                                                                   
  </script>                                                                                                                                      
                                                                                                                                                 
                                                                                                                                                 
       <script src="https://assets.adobedtm.com/launch-EN549d3cbbc3794bf68dbc51200841a239.min.js" async></script>                                
    </head>                                                                                                                                      
  <!--[if IE 9]><body class="ie9"><![endif]-->                                                                                                   
  <!--[if IE 8]><body class="ie8"><![endif]-->                                                                                                   
  <!--[if IE 7]><body class="ie7"><![endif]-->                                                                                                   
  <!--[if !(IE 7) & !(IE 8) & !(IE 9)]><body><![endif]-->                                                                                        
<body class="btwf-site btwf-site--circularFont bthub-site">                                                                                      
                                                                                                                                                 
  <div class="main" id="root">                                                                                                                   
    <header class="btwf-siteHeader btwf-siteHeader--small u-clearfix">                                                                           
      <div class="btwf-container">                                                                                                               
        <div class="btwf-container__inner">                                                                                                      
          <div class="btwf-siteHeader__inner u-clearfix">                                                                                        
                                                                                                                                                 
            <div class="btwf-siteHeader__left u-clearfix">                                                                                       
              <h1 class="btwf-siteHeader__brand">BT Wi-Fi</h1>                                                                                   
              <div class="btwf-siteHeader__title">                                                                                               
                <h2 class="btwf-siteHeader__headline">You are connected to a BT Wi-Fi Hotspot</h2>                                               
              </div>                                                                                                                             
            </div>                                                                                                                               
                                                                                                                                                 
          </div>                                                                                                                                 
        </div>                                                                                                                                   
      </div>                                                                                                               
    </header>                                                                                                                                    
                                                                                                                           
    <section class="btwf-section btwf-section--white">                                                                                           
      <div class="btwf-container btwf-section__container">                                                                                       
        <div class="btwf-container__inner">                                                                                                      
          <div class="btwf-block">                                                                                                               
            <div class="btwf-block__container">                                                                                                  
                                                                                                                                                 
                              <div id="bthub-loginForm" class="bthub-loginForm has-error is-active u-clearfix">                                  
                                  <div class="bthub-loginForm__inner">                                                                           
                                                                                                             
<header class="btwf-title btwf-title--large bthub-loginForm__title">                                                       
                        <h2 class="btwf-title__headline">Already a customer?</h2>                                                                
                        <button class="btwf-btn bthub-loginForm__toggleButton" id="bthub-loginForm-toggle">Log in now</button>                   
                      </header>                                                                                                                  
                                                                                                                                                 
                      <div id="bthub-loginForm-wrapper" class="bthub-loginForm__wrapper">                                                        
                                                                                                                                                 
                        <div class="btwf-block">                                                                                                 
  <div class="btwf-block__container btwf-block__container--oneThird">                                                                            
    <form id="provider_form" class="bthub-form bthub-form--providers selector">                                                                  
      <fieldset class="bthub-form__fieldset providerblock">                                                                                      
                                                                                                                                                 
          <label for="select-providers" class="bthub-form__label selector__label">Account</label>                                                
          <select id="select-providers" class="bthub-form__input bthub-selector selector__items">                                                
            <option value="wifi" id="select-provider-wifi" class="bthub-selector__item selector__item">BT Wi-Fi</option>                         
            <option value="tbb" id="select-provider-tbb" class="bthub-selector__item selector__item">BT Broadband</option>                       
            <option value="btb" id="select-provider-btb" class="bthub-selector__item selector__item">BT Business Broadband</option>              
          </select>                                                                                                                              
                                                                                                                                                 
      </fieldset>                                                                                                                                
    </form>                                                                                                                                      
  </div>                                                                                                                                         
  <div class="btwf-block__container btwf-block__container--twoThird">                                                                            
      <form id="wifi_login_form" class="bthub-form bthub-form--wifi login_form" class="validateMe" method="post" action="https://www.btwifi.com:8
                                                                                                                                                 
        <h3 class="bthub-form__title">BT Wi-fi Login</h3>                                                                                        
                                                                                                                                                 
        <fieldset class="bthub-form__fieldset">                                                                                                  
                <label id="lbl-wifi-inputUsername" for="inputUsername" class="bthub-form__label">Username</label>                                
                <input id="wifi-inputUsername" type="text" name="inputUsername" tabindex="3" value="" placeholder="John Smith" autocomplete="on" 
                <input name="username" id="wifi-username" type="hidden" value="" />                                                             
        </fieldset>                                                                                                                              
                                                                                                                                                 
        <fieldset class="bthub-form__fieldset">                                                                                                  
                <label id="lbl-wifi-password" for="password" class="bthub-form__label">Password</label>                                          
                <input id="wifi-password" type="password" name="password" tabindex="4" value="" placeholder="********" autocomplete="on" class="b
        </fieldset>                                                                                                                              
                                                                                                                                                 
                        <p class="bthub-form__error">Please enter your username. Please enter your password.</p>                                 
                                                                                                                                                 
        <fieldset class="bthub-form__fieldset">                                                                                                  
                <input type="submit" value="Log in" class="btwf-btn" tabindex="5" id="wifi-submit">      
</fieldset>                                                                                                                              
                                                                                                                                                 
        <input name="xhtmlLogon" type="hidden" value="https://www.btwifi.com:8443/ante" />                                                       
                                                                                                                                                 
</form>                                                                                                                                          
      <form id="tbb_login_form" class="bthub-form bthub-form--tbb login_form validateMe is-hidden" method="post" action="https://www.btwifi.com:8
                                                                                                                                                 
        <h3 class="bthub-form__title">BT Broadband Login</h3>                                                                                    
                                                                                                                                                 
        <fieldset class="bthub-form__fieldset">                                                                                                  
                <label id="lbl-tbb-username" for="tbb-username">BT ID</label>                                                                    
                <input id="tbb-username" type="text" name="username" tabindex="3" value="" placeholder="This is usually your email address" autoc
        </fieldset>                                                                                                                              
                                                                                                                                                 
        <fieldset class="bthub-form__fieldset">                                                                                                  
                <label id="lbl-tbb-password" for="tbb-password">Password</label>                                                                 
                <input id="tbb-password" type="password" name="password" value="" tabindex="4" autocomplete="on" class="bthub-form__input bthub-f
        </fieldset>                                                                                                                              
                                                                                                                                                 
        <p id="form_errors_js" class="bthub-form__error">Please check you have entered your Username/Password correctly</p>                      
                                                                                                                                                 
                        <p id="form_errors_submit" class="bthub-form__error">Please enter your username. Please enter your password.</p>         
                                                                                                                                                 
        <fieldset class="bthub-form__fieldset">                                                                                                  
                <input id="tbb-submit" type="submit" value="Log in" class="btwf-btn" tabindex="5">                                               
        </fieldset>                                                                                                                              
                                                                                                                                                 
        <input name="xhtmlLogon" type="hidden" value="https://www.btwifi.com:8443/tbbLogon" />                                                   
                                                                                                                                                 
</form>                                                                                                                                          
      <form id="btb_login_form" class="bthub-form bthub-form--btb login_form validateMe is-hidden" method="post" action="https://www.btwifi.com:8
                                                                                                                                                 
        <h3 class="bthub-form__title">BT Business Broadband Login</h3>                                                                           
                                                                                                                                                 
        <fieldset class="bthub-form__fieldset">                                                                                                  
                <label id="lbl-btb-username" for="btb-username" class="bthub-form__label">Email address</label>                                  
                <input id="btb-username" type="text" name="username" tabindex="3" value="" autocomplete="on" class="bthub-form__input bthub-form_
        </fieldset>                                                                                                                              
                                                                                                                                                 
        <fieldset class="bthub-form__fieldset">                                                                                                  
                <label id="lbl-btb-password" for="btb-password" class="bthub-form__label">Password</label>                                       
                <input id="btb-password" type="password" name="password" value="" tabindex="4" autocomplete="on" class="bthub-form__input bthub-f
</fieldset>                                                                                                                              
                                                                                                                                                 
                        <p class="bthub-form__error">Please check you have entered your Username/Password correctly</p>                          
                                                                                                                                                 
        <fieldset class="bthub-form__fieldset">                                                                                                  
                <input type="submit" value="Log in" tabindex="5" id="btb-submit" class="btwf-btn">                                               
        </fieldset>                                                                                                                              
                                                                                                                                                 
        <input name="xhtmlLogon" type="hidden" value="https://www.btwifi.com:8443/ante" />                                                       
                                                                                                                                                 
</form>                                                                                                                                          
  </div>                                                                                                                                         
</div>                                                                                                                                           
                        <div class="bthub-loginForm__links">                                                                                     
                            <a href="https://info.btwifi.com:442/help/bt-login.jsp"  class="btwf-textBtn"  target="_blank">Having trouble logging
                        </div>                                                                                                                   
                                                                                                                                                 
                      </div>                                                                                                                     
                                                                                                                                                 
                    </div>                                                                                                                       
                </div>                                                                                                                           
            </div>                                                                                                                               
          </div>                                                                                                                                 
        </div>                                                                                                                                   
      </div>                                                                                                                                     
    </section>                                                                                                                                   
                                                                                                                                                 
    <section class="btwf-section btwf-section--grey">                                                                                            
      <div class="btwf-container btwf-section__container">                                                                                       
        <div class="btwf-container__inner">                                                                                                      
          <div class="btwf-block btwf-block--grey">                                                                                              
            <div class="btwf-block__container">                                                                                                  
              <div class="bthub-productCards">                                                                                                   
                    <header class="btwf-title btwf-title--large bthub-productCards__title">                                                      
                      <h2 class="btwf-title__headline">Not already a customer? Buy instant access now</h2>                                       
                    </header>                                                                                                                    
                    <ul class="bthub-productCards__cards u-clearfix">                                                                            
                      <li id="product_1_hour" class="bthub-productCards__card bthub-productCard">                                                
                        <div class="bthub-productCard__inner">                                                                                   
                          <div class="bthub-productCard__content">                                                                               
                            <h3 class="bthub-productCard__title">1 hour</h3>                                                                     
                            <p class="bthub-productCard__price">&pound;4.99</p>        
</div>                                                                                                                 
                          <a                                                                                                                     
                            href="https://my.btwifi.com/selfcare/purchase?product=BT Wifi 1 hour Home Hub"                                       
                            class="btwf-btn btwf-btn--white bthub-productCard__button"                                                           
                            title="Buy 1 hour wi-fi access now"                                                                                  
                            id="btn-buy_product_1_hour"                                                                                          
                          tabindex="7">Buy</a>                                                                                                   
                        </div>                                                                                                                   
                      </li>                                                                                                                      
                      <li id="product_1_day" class="bthub-productCards__card bthub-productCard bthub-productCard--highlighted">                  
                        <div class="bthub-productCard__inner">                                                                                   
                          <div class="bthub-productCard__content">                                                                               
                            <h3 class="bthub-productCard__title">1 day</h3>                                                                      
                            <p class="bthub-productCard__price">&pound;7.99</p>                                                                  
                          </div>                                                                                                                 
                          <a href="https://my.btwifi.com/selfcare/purchase?product=BT Wifi 1 day Home Hub"                                       
                            class="btwf-btn btwf-btn--white bthub-productCard__button"                                                           
                            title="Buy 1 day wi-fi access now"                                                                                   
                            id="btn-buy_product_1_day"                                                                                           
                          tabindex="8">Buy</a>                                                                                                   
                        </div>                                                                                                                   
                      </li>                                                                                                                      
                      <li id="product_5_days" class="bthub-productCards__card bthub-productCard">                                                
                        <div class="bthub-productCard__inner">                                                                                   
                          <div class="bthub-productCard__content">                                                                               
                            <h3 class="bthub-productCard__title">5 days</h3>                                                                     
                            <p class="bthub-productCard__price">&pound;19.99</p>                                                                 
                          </div>                                                                                                                 
                          <a                                                                                                                     
                            href="https://my.btwifi.com/selfcare/purchase?product=BT Wifi 5 day Home Hub"                                        
                            class="btwf-btn btwf-btn--white bthub-productCard__button"                                                           
                            title="Buy 5 days wi-fi access now"                                                                                  
                            id="btn-buy_product_5_days"                                                                                          
                          tabindex="9">Buy</a>                                                                                                   
                        </div>                                                                                                                   
                      </li>                                                                                                                      
                      <li id="product_30_days" class="bthub-productCards__card bthub-productCard">                                               
                        <div class="bthub-productCard__inner">                                                                                   
                          <div class="bthub-productCard__content">                                                                               
                            <h3 class="bthub-productCard__title">30 days</h3>                                                                    
                            <p class="bthub-productCard__price">&pound;39</p>                                                                    
                          </div>                                             
<a                                                                                                                     
                            href="https://my.btwifi.com/selfcare/purchase?product=BT Wifi 30 day"                                                
                            class="btwf-btn btwf-btn--white bthub-productCard__button"                                                           
                            title="Buy 30 days wi-fi access now"                                                                                 
                            id="btn-buy_product_30_days"                                                                                         
                          tabindex="10">Buy</a>                                                                                                  
                        </div>                                                                                                                   
                      </li>                                                                                                                      
                    </ul>                                                                                                                        
              </div>                                                                                                                             
            </div>                                                                                                                               
          </div>                                                                                                                                 
        </div>                                                                                                                                   
      </div>                                                                                                                                     
    </section>                                                                                                                                   
                                                                                                                                                 
    <section class="btwf-section">                                                                                                               
      <div class="btwf-container btwf-section__container">                                                                                       
        <div class="btwf-container__inner">                                                                                                      
          <div class="btwf-block">                                                                                                               
            <div class="btwf-block__container">                                                                                                  
              <a href="https://info.btwifi.com:442/help/login-with-bt/free-app.jsp" target="_blank" class="btwf-banner">                         
                <div class="btwf-banner__inner">                                                                                                 
                  <div class="btwf-title btwf-title--white btwf-title--small btwf-banner__title">                                                
                    <h2 class="btwf-title__headline">Already a BT Broadband or BT Mobile customer?</h2>                                          
                    <p class="btwf-banner__copy">Stay connected on the go by downloading the BT Wi-Fi App from your preferred App store!</p>     
                  </div>                                                                                                                         
                  <div class="btwf-banner__btnContainer">                                                                                        
                    <span class="btwf-banner__btn btwf-banner__btn--playStore">Get it on Google Play</span>                                      
                    <span class="btwf-banner__btn btwf-banner__btn--appStore">Download on the App Store</span>                                   
                  </div>                                                                                                                         
                </div>                                                                                                                           
              </a>                                                                                                                               
            </div>                                                                                                                               
          </div>                                                                                                                                 
        </div>                                                                                                                                   
      </div>                                                                                                                                     
    </section>                                                                                                                                   
                                                                                                                                                 
    <footer class="btwf-siteFooter btwf-siteFooter--purple u-clearfix">                                                                          
      <div class="btwf-siteFooter__bottom u-clearfix">                                                                                           
        <div class="btwf-container">                               
<div class="btwf-container__inner">                                                                                                    
            <ul class="footer-links">                                                                                                            
              <li class="footer1"><a href="https://info.btwifi.com:442/help/index.jsp" title="Help"  tabindex="12" target="_blank">Help</a></li> 
              <li class="footer2"><a href="https://info.btwifi.com:442/help/security/index.jsp" tilt="Security"  tabindex="13" target="_blank">Se
              <li class="footer4"><a href="https://info.btwifi.com:442/index.jsp" title="BT Wi-fi website"  tabindex="15" target="_blank">BT Wi-f
              <li class="footer5"><a href="https://info.btwifi.com:442/terms-and-conditions/" title="Terms &amp; conditions"  tabindex="16" targe
              <li class="footer6"><a href="https://info.btwifi.com:442/terms-and-conditions/privacy-policy.jsp#16" title="Cookie Policy"  tabinde
              <li class="last"><a href="https://www.bt.com/privacy-policy/" title="Privacy policy"  tabindex="17" target="_blank">Privacy policy<
            </ul>                                                                                                                                
          </div>                                                                                                                                 
        </div>                                                                                                                                   
      </div>                                                                                                                                     
    </footer>                                                                                                                                    
                                                                                                                                                 
  </div>                                                                                                                                         
                                                                                                                                                 
    <script type="text/javascript" src="https://cdn.btwifi.com/contentserver/captiveportal/bthomehub/js/jquery-respond-modernizr-login_script.js"
                                                                                                                                                 
<!-- COOKIE BANNER -->                                                                                                                           
<div class="cookieUI" id="cookieConsent">                                                                                                        
                <form action="" name="cookie-consent" id="cookie-consent-form">                                                                  
                        <div class="cookieUI__popup">                                                                                            
                                                                                                                                                 
                                <div class="cookieUI__step welcome-step">                                                                        
                                                <a href="#" class="change-language change-language--welsh translation--english">Cymraeg</a>      
                                                <a href="#" class="change-language change-language--english translation--welsh">English</a>      
                                        <img alt="BT Logo" class="cookieUI__btLogo" src="https://cdn.btwifi.com/contentserver/_assets/images/btlo
                                                                                                                                                 
                                                                                                                                                 
                                        <div class="cookieUI__section">                                                                          
                                                <h2><span class="translation--english">Cookies</span><span class="translation--welsh">Cwcis</span
                                                                                                                                                 
                                                                                                                                                 
                                                <p class="translation--english">We use cookies to do things like remember what you've added to yo
                                                <p  class="translation--welsh">Rydym yn defnyddio cwcis i wneud pethau fel cofio beth ydych chi w
                                                <div>                                                                                            
                                                                <button class="cookieUI__btn btn--next"  data-next="about"><span  class="translat
                                                                </button><button class="cookieUI__btn blue btn--acceptAll"  data-section="all" da
                                                        </div>                                                                                   
                                        </div>                                                                                                   
                                </div>                                                  
<!-- ABOUT -->                                                                                                   
                                                                                                                                                 
                                <div class="cookieUI__step about">                                                                               
                                        <div class="cookieUI__section">                                                                          
                                                <h3><span class="translation--english">About cookies</span><span class="translation--welsh">Yngl&
                                                                                                                                                 
                                                <p  class="translation--english">Some cookies are essential - we can't provide our services witho
                                                <p  class="translation--welsh">Mae rhai cwcis yn hanfodol - ni allwn ddarparu ein gwasanaethau he
                                                                                                                                                 
                                                <div>                                                                                            
                                                        <button class="cookieUI__btn btn--next"  data-next="functional"><span  class="translation
                                                </div>                                                                                           
                                        </div>                                                                                                   
                                        <div class="bottomButtonContainer">                                                                      
                                                <div class="bottomButtonInner">                                                                  
                                                        <a class="bottomButtonLink" href="https://info.btwifi.com:442/terms-and-conditions/privac
                                                                <span  class="translation--english">More about cookies</span><span  class="transl
                                                                </a>                                                                             
                                                </div>                                                                                           
                                        </div>                                                                                                   
                                </div>                                                                                                           
                                                                                                                                                 
                                                                                                                                                 
                                <!-- FUNCTIONAL -->                                                                                              
                                                                                                                                                 
                                <div class="cookieUI__step functional">                                                                          
                                        <div class="progressBarContainer">                                                                       
                                                <div class="progressBarProgress" style="width: calc(33.3333%);"></div>                           
                                                <ul class="progressBar">                                                                         
                                                        <li class="progressBarActive"></li>                                                      
                                                        <li class=""></li>                                                                       
                                                        <li class=""></li>                                                                       
                                                </ul>                                                                                            
                                        </div>                                                                                                   
                                        <div class="cookieUI__section">                                                                          
                                                <h3>                                                                                             
                                                        <span class="translation--english">Functional cookies</span><span class="translation--wel
                                                </h3>                                                                                            
                                                <p class="translation--english">These cookies let us do things like remember your login details a
                                                <p class="translation--welsh">Mae'r cwcis hyn yn caniat&aacute;u i ni wneud pethau fel cofio eich
                                                <br>                                                  
<b><span class="translation--english">Allow functional cookies?</span><span class="translation--w
                                                <div>                                                                                            
                                                        <button class="cookieUI__btn blue btn--cookie"  data-next="targeting"  data-section="func
                                                        <button class="cookieUI__btn blue btn--cookie"  data-next="targeting"  data-section="func
                                                </div>                                                                                           
                                        </div>                                                                                                   
                                        <div class="bottomButtonContainer">                                                                      
                                                <div class="bottomButtonInner">                                                                  
                                                        <a class="bottomButtonLink noChevron btn--cookie" href="#"  data-section="all" data-value
                                                </div>                                                                                           
                                        </div>                                                                                                   
                                </div>                                                                                                           
                                                                                                                                                 
                                                                                                                                                 
                                <!-- TARGETING -->                                                                                               
                                <div class="cookieUI__step targeting">                                                                           
                                        <div class="progressBarContainer">                                                                       
                                                <div class="progressBarProgress" style="width: calc(66.6667%);"></div>                           
                                                <ul class="progressBar">                                                                         
                                                        <li class="progressBarActive"></li>                                                      
                                                        <li class="progressBarActive"></li>                                                      
                                                        <li class=""></li>                                                                       
                                                </ul>                                                                                            
                                        </div>                                                                                                   
                                        <div class="cookieUI__section">                                                                          
                                                <h3>Targeting cookies<span class="translation--english"></span><span class="translation--welsh"><
                                                <p class="translation--english">We use these cookies to do things like show you content and promo
                                                <p class="translation--welsh">Rydym yn defnyddio'r cwcis hyn i wneud pethau fel dangos cynnwys a 
                                                                <br>                                                                             
                                                <b><span class="translation--english">Allow targeting cookies?</span><span class="translation--we
                                                <div>                                                                                            
                                                        <button class="cookieUI__btn blue btn--cookie"  data-next="thankyou" data-section="target
                                                        <button class="cookieUI__btn blue btn--cookie"  data-next="thankyou" data-section="target
                                                </div>                                                                                           
                                        </div>                                                                                                   
                                        <div class="bottomButtonContainer">                                                                      
                                                <div class="bottomButtonInner">                                                                  
                                                        <a class="bottomButtonLink noChevron btn--cookie" href="#"  data-section="all" data-value
                                                </div>                                                                                           
                                        </div>                                                                                                   
                                </div>                                                                     
<!-- THANKS -->                                                                                                  
                                                                                                                                                 
                                <div class="cookieUI__step thankyou">                                                                            
                                        <div class="progressBarContainer">                                                                       
                                                <div class="progressBarProgress" style="width: calc(100%);"></div>                               
                                                <ul class="progressBar">                                                                         
                                                        <li class="progressBarActive"></li>                                                      
                                                        <li class="progressBarActive"></li>                                                      
                                                        <li class="progressBarActive"></li>                                                      
                                                </ul>                                                                                            
                                        </div>                                                                                                   
                                        <div class="cookieUI__section">                                                                          
                                                <h3><span class="translation--english">Thanks, you're all set</span><span class="translation--wel
                                                <p><span class="translation--english">You can change your cookies settings whenever you like by u
                                                <div>                                                                                            
                                                        <button class="cookieUI__btn blue btn--accept" type="submit"  ><span  class="translation-
                                                </div>                                                                                           
                                        </div>                                                                                                   
                                </div>                                                                                                           
                        </div>                                                                                                                   
                </form>                                                                                                                          
        </div>                                                                                                                                   
<!-- END COOKIE BANNER -->                                                                                                                       
                                                                                                                                                 
<script  type="text/javascript">                                                                                                                 
  function cookieConsent_OnAccept (){                                                                                                            
    if(cookieConsent.targeting){                                                                                                                 
      acceptedCookieScript('targeting');                                                                                                         
    }                                                                                                                                            
  }                                                                                                                                              
</script>                                                                                                                                        
<link media="all" type="text/css" href="https://cdn.btwifi.com/contentserver/_assets/css/cookies.css?v=1.1" rel="stylesheet" />                  
<script type="text/javascript" src="https://cdn.btwifi.com/contentserver/_assets/js/json2.js"></script>                                          
<script type="text/javascript" src="https://cdn.btwifi.com/contentserver/_assets/js/cookie-banner.js"></script>  </body>                         
</html>                                                                                                                                          
<!--                                                                                                                                             
<?xml version="1.0" encoding="UTF-8"?>                                                                                                           
<WISPAccessGatewayParam>                                                                                                                         
  <Redirect>                                                                                                                                     
    <AccessProcedure>1.0</AccessProcedure>                                                                                                       
    <AccessLocation>owfch69</AccessLocation>                                                                                                     
    <LocationName>btopenzone,BTOpenzone Hotspot</LocationName>            
<LoginURL>https://www.btwifi.com:8443/wbacOpen</LoginURL>                                                                                    
    <MessageType>100</MessageType>                                                                                                               
    <ResponseCode>0</ResponseCode>                                                                                                               
  </Redirect>                                                                                                                                    
</WISPAccessGatewayParam>                                                                                                                        
-->                                                                                                                                              
<!-- http://86.189.0.251/contentserver/captiveportal//bthomehub/landing.htm -->                                                                  
<!-- tree:bnlv02453-pal-pal07.btwifi.com -->      
@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Oct 31, 2021

Good spot. Yes, it's worth changing this line to this one instead as you've alluded to.

You may also need to use the BT_LOGIN_FORM from the same file (view selection range here). Check the provider=btoz line though -- it may have to be provider=tbb even in the ante endpoint. 🤔

@adammcguk

This comment has been minimized.

Copy link

@adammcguk adammcguk commented Oct 31, 2021

I finally got it to work, so you can update your bt-broadband plugin. The config.sh should be:

#!/bin/sh
# shellcheck disable=SC2034

# Network
BT_SSID=${CC_WIRELESS_SSID_MATCH:-"BTWi-fi\|BTWifi-with-FON"}
BT_IFACE=${CC_WIRELESS_IFACE:-"wlan-sta"}
BT_COOKIES="/tmp/bt_cookies.txt"
BT_PREVIOUS_ATTEMPT="/tmp/bt_previous_attempt.html"
BT_REBOOT_LOG="${HOME}/bt_reboot_log.txt"

# Portal status + login URLs
BT_STATUS_URL="https://www.btwifi.com:8443/home"
BT_LOGIN_URL="https://www.btwifi.com:8443/tbbLogon"
BT_LOGIN_FORM="\
  xhtmlLogon=https://www.btwifi.com:8443/tbbLogon&\
  submitButton=Login&\
  inputUsername=${__USERNAME__}&\
  username=${__USERNAME__}&\
  password=${__PASSWORD__}&\
  provider=tbb"

# Remove indentation from the form above
BT_LOGIN_FORM=$(echo "${BT_LOGIN_FORM}"|sed -e 's/  //g')

# Found in the HTML when logged-in
BT_STATUS_TEXT="now logged on"
BT_LOGIN_SUCCESS_TEXT="${BT_STATUS_TEXT}"

BT_CURL_OPTS="\
  -L \
  --verbose \
  --max-time 60 \
  --interface ${BT_IFACE} \
  --cookie-jar ${BT_COOKIES} \
  --cookie ${BT_COOKIES}"

I copied most of this from your config.sh for bt-wifi but changed the option to 'tbb' and it took me a while to remove 'wam' in order to get it to work. Hope this helps!

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Oct 31, 2021

Excellent! Glad you got it working, and thank you for posting the working config. I've updated CC accordingly.

@aidanmacgregor

This comment has been minimized.

Copy link

@aidanmacgregor aidanmacgregor commented Dec 3, 2021

love the script, spent ages trying to get it to work, never succeeded but was probably over a year ago, solution i ended up with is using macrodroid to check connectivity every 5 seconds and run the login url if co connectivity, always on internet! must have an experiment with the script though, be awesome to run it self contained within openwrt router :)

@andyb9

This comment has been minimized.

Copy link

@andyb9 andyb9 commented Dec 3, 2021

i am surprised to see further comment on this post - i thought BT & Fon pulled BtWi_with_Fon over a year ago?

is BtWifi_with_FON back on?

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Dec 3, 2021

@andyb9 - I believe @aidanmacgregor may be talking about the Cloud Connect script I'd posted as an alternative, which happens to include configs for other BT Wifi options.

Certainly Fon no longer seems to work! I had a config for that too, but it's now defunct.

@andyb9

This comment has been minimized.

Copy link

@andyb9 andyb9 commented Dec 3, 2021

@shuckster thanks for that clarification 👍

@aidanmacgregor

This comment has been minimized.

Copy link

@aidanmacgregor aidanmacgregor commented Dec 3, 2021

@andyb9 the FON partnership ended, its now just BT Wifi for broadband customers, i still use as my current internet, been well over a year now this time and still running great, @shuckster i did see your script but concluded it was more complex to configure if i remember correctly, i just used the easy approach, can see the set up here, awesome to see people still need these solutions :) https://github.com/aidanmacgregor/BT-WiFi-Autologin-URL-WISPr-FON

@shuckster

This comment has been minimized.

Copy link

@shuckster shuckster commented Dec 4, 2021

@andyb9 - no worries!

@aidanmacgregor - yes, CC is a bit more complex. Your project looks great - nice that we have so many scripts to solve it!

@andyb9

This comment has been minimized.

Copy link

@andyb9 andyb9 commented Dec 4, 2021

@aidanmacgregor thanks for expanding on what @shuckster said, now i fully get it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment