Captive Portal

Created on June 21, 2022

Overview

  • Captive portal is part of onboarding process which is presented to user once device is activated.
  • It allows user to configure his/her WiFi credentials to be personalized which user can remember. It is presented to user if user does factory reset too.
  • It is presented to user if user does factory reset too.
  • On fresh boot-up and factory-reset, Captive Portal prompts to change the default ssid name and password for browsing on connected client’s through Gateway network

  • On fresh boot-up and factory-reset,, anything user tries in browser will redirect to local captive portal

     https://<LAN IP >/captiveportal.php

Code Flow

 The below diagram depicts the captive portal flow via CcspPandM module.

 The below diagram depicts the captive portal flow via CcspWifiAgent module.

Objects

MODULE

XML file

PARAMETERS

CcspPandM


TR181-USGv2.XML

Device.DeviceInfo.X_RDKCENTRAL-COM_CaptivePortalEnable

Device.DeviceInfo.X_RDKCENTRAL-COM_ConfigureWiFi

CcspWiFiAgent

TR181-WiFi-USGv2.XML




Device.WiFi.SSID.1.SSID

Device.WiFi.SSID.2.SSID

Device.WiFi.AccessPoint.1.Security.KeyPassphrase

Device.WiFi.AccessPoint.2.Security.KeyPassphrase

Supported Languages

  • Currently the supported languages are “English” , “French”
  • The default language is “eng”

  • The default language will be obtained as a string through “Device.DeviceInfo.X_RDKCENTRAL-COM_Syndication.RDKB_UIBranding.DefaultLanguage”.

Trouble Shooting

  • During any captive portal issues, verify the below commands .

syscfg get redirection_flag

To get value of redirection_flag (true/false)

root@RaspberryPi-Gateway:~# syscfg get redirection_flag
true

          

 syscfg get HTTPS_Server_IP

To get HTTPS_Server_IP to which it is connected.

root@RaspberryPi-Gateway:~# syscfg get HTTPS_Server_IP
10.0.0.1

 

 syscfg get PartnerID

To get partern id of syndication partners

root@RaspberryPi-Gateway:~# syscfg get PartnerID
RDKM


 ifconfig erouter0 , brlan0

root@RaspberryPi-Gateway:~# ifconfig erouter0
erouter0  Link encap:Ethernet  HWaddr B8:27:EB:50:C1:CF
          inet addr:192.168.0.4  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fe50:c1cf/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:238 errors:0 dropped:0 overruns:0 frame:0
          TX packets:276 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:38241 (37.3 KiB)  TX bytes:34078 (33.2 KiB)

root@RaspberryPi-Gateway:~# ifconfig brlan0
brlan0    Link encap:Ethernet  HWaddr B8:27:EB:05:94:9A
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::e862:39ff:fe51:dde7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:3811 (3.7 KiB)


dmcli eRT getv Device.DeviceInfo.X_RDKCENTRAL-COM_ConfigureWiFi

root@RaspberryPi-Gateway:~#  dmcli eRT getv Device.DeviceInfo.X_RDKCENTRAL-COM_ConfigureWiFi
CR component name is: eRT.com.cisco.spvtg.ccsp.CR
subsystem_prefix eRT.
getv from/to component(eRT.com.cisco.spvtg.ccsp.pam): Device.DeviceInfo.X_RDKCENTRAL-COM_ConfigureWiFi
Execution succeed.
Parameter    1 name: Device.DeviceInfo.X_RDKCENTRAL-COM_ConfigureWiFi
               type:       bool,    value: false


 dmcli eRT getv  Device.DeviceInfo.X_RDKCENTRAL-COM_CaptivePortalEnable

root@RaspberryPi-Gateway:~#  dmcli eRT getv  Device.DeviceInfo.X_RDKCENTRAL-COM_CaptivePortalEnable
CR component name is: eRT.com.cisco.spvtg.ccsp.CR
subsystem_prefix eRT.
getv from/to component(eRT.com.cisco.spvtg.ccsp.pam): Device.DeviceInfo.X_RDKCENTRAL-COM_CaptivePortalEnable
Execution succeed.
Parameter    1 name: Device.DeviceInfo.X_RDKCENTRAL-COM_CaptivePortalEnable
               type:       bool,    value: true


ps | grep lighttpd // Lighttpd process should be running

root@RaspberryPi-Gateway:~# ps | grep lighttpd
 3562 root       0:00 lighttpd -f /var/lighttpd.conf
12172 root       0:00 grep lighttpd


/nvram/hostapd0.conf

root@RaspberryPi-Gateway:/nvram# cat /nvram/hostapd0.conf
# This is the name of the WiFi interface we configured above
interface=wlan0

 

#wlan0 is part of bridge br0
bridge=brlan0

 

# Use the nl80211 driver with the brcmfmac ( Broadcom BCM4334) driver
driver=nl80211
# This is the name of the network
ssid=RPi3_RDKB-AP0
# Use the 2.4GHz band
hw_mode=g
# Use channel 6
channel=06

 

# Enable 802.11n
ieee80211n=1

 

# Enable WMM
wmm_enabled=1

 

# Enable 40MHz channels with 20ns guard interval
#ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]

 

# Accept all MAC addresses
macaddr_acl=0

 

# Use WPA authentication
auth_algs=1
# Require clients to know the network name
ignore_broadcast_ssid=0

 


# Use WPA2
wpa=2

 

# Use a pre-shared key
wpa_key_mgmt=WPA-PSK

 

# The network passphrase
wpa_passphrase=rdk@1234

 

# Use AES, instead of TKIP
wpa_pairwise=TKIP CCMP
rsn_pairwise=TKIP CCMP

 

#set the operating channel bandwidth to 20 MHz
vht_oper_chwidth=0

 

# The list of supported rates in units of 100kbps
supported_rates=10 20 55 110 60 90 120 180 240 360 480 540

 

# Basic rate set in units of 100kbps
basic_rates=10 20

 

#Interface for separate control program. hostapd_cli command will use it when trying to connect with hostapd.
ctrl_interface_group=0
ctrl_interface=/var/run/hostapd0

 

wpa_psk_file=/etc/hostapd/hostapd0.psk
eap_server=1
#wps_state=2
ap_setup_locked=1
ap_pin=45276453
wps_pin_requests=/var/run/hostapd0.pin-req
device_name=Raspberrypi
manufacturer=Broadcom
model_name=RPI-3B
model_number=BCM43438
serial_number=8965324
device_type=6-0050F204-1
os_version=01020300
config_methods=push_button keypad label display
 




Go To Top