Blockquote
I am trying to setup a captive portal for POC purpose, I have read all official docs from Coovachilli, and my freeRadius, Coovachilli and splash page are deployed. After I connect my open wifi SSID the splash page can popup, I design it as simple as possible the username and password are hardcoded but a button of Connect is ready for clicking to trigger chilliController.logon(username, password)... from here I can't see any feedback but a timeout kind of error. There is no error from javascript of my splash page, is there any example (no commercial solutinos please) I can learn to fix the issue I have? I feel I am in a lost land that I suspect if any conceptual idea was wrong in my mind. Any lucks?
Coovachilli Config:
#
# Sample Coova-Chilli configuration file modified by gremaudpi
#
config chilli
option interval 3600
option swapoctets 1
option debug 1
option debugfacility 3
######## TUN and DHCP Parameters ########
option tundev 'tun0'
option dhcpif 'br-wopen'
option net 10.10.100.0/24
option lease 600
option dns2 8.8.8.8
option dns1 8.8.4.4
option ipup '/etc/chilli/up.sh'
option ipdown '/etc/chilli/down.sh'
######## Radius parameters ########
option radiusserver1 '10.10.50.93'
option radiusserver2 ''
option radiusauthport 1812
option radiussecret 'testing123'
option radiusnasid 'nas01'
option ssid 'ZWLS-OPEN'
######## Universal access method (UAM) parameters ########
option uamlisten 10.10.100.1
option uamserver 'http://10.10.50.93:8011/www/LOGIN.html'
# option wwwdir "/etc/chilli/www"
option uamport 3990
option uamsecret 'testing123'
option uamallowed 'www.yahoo.com,10.10.50.1,10.10.60.1,10.10.50.93'
option uamdomain ''
option uamanydns 1
option uamaliasname 'login'
option nouamsuccess 1
Splash Page:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Coova Portal</title>
<script type="text/javascript" src="ChilliLibrary.js"></script>
<script>
chilliController.host = '10.10.100.1';
chilliController.port = '3990';
chilliController.interval = 60 ; // Default is 30 seconds
// then define event handler functions
chilliController.onError = handleErrors;
chilliController.onUpdate = updateUI ;
// when the reply is ready, this handler function is called
function updateUI( cmd ) {
alert ( 'You called the method' + cmd +
'\n Your current state is =' + chilliController.clientState ) ;
}
// If an error occurs, this handler will be called instead
function handleErrors ( code ) {
alert ( 'The last contact with the Controller failed. Error code =' + code );
}
// finally, get current state
chilliController.refresh();
function go() {
// If you use non standard configuration, define your configuration
//chilliController.host = document.getElementById("host").value ; // Default is 192.168.182.1
//chilliController.port = document.getElementById("port").value ; // Default is 3990
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
console.log(username, password);
console.log(chilliController.host);
console.log(chilliController.port);
chilliController.logon(username,password);
}
</script>
</head>
<body>
<p>Click</p>
<label for="host">Host:</label>
<input type="text" id="host" name="host" value="10.10.100.1"><br>
<label for="port">Port:</label>
<input type="text" id="port" name="port" value="3990"><br>
<label for="username">Username:</label>
<input type="text" id="username" name="username" value="dummy"><br>
<label for="password">Password:</label>
<input type="text" id="password" name="password" value="dummy123">
<br>
<a class="TSlink" href="javascript:go()">Go</a>
</body>
</html>
One symptoms is that after connect with host spot open wifi, if open a browser and type the url: http://10.10.100.1:3990/json/status?callback=chilliJSON.reply&0.430314783392284 the browser is redirect to my splash page (http://10.10.50.93:8011/www/LOGIN.html) The Chilli debug log:
chilli[5946]: dhcp_receive_ip(3760): Address found
chilli[5946]: dhcp_receive_ip(3760): Address found
chilli[6005]: redir_getreq(2150): The path: json/logon
chilli[6005]: redir_getreq(2505): -->> Setting userurl=[http://10.10.100.1:3990/json/logon?username=dummy&chapchallenge=q1w2e3r4&chappassword=cae9d6bc04f3deaa&lang=EN]
chilli[6005]: redir_main(4207): redir_accept: Original request host=10.10.100.1:3990
chilli[6005]: redir_wispr2_reply(994):
chilli[5946]: dhcp_receive_ip(3760): Address found
chilli[5946]: chilli_handle_signal(386): caught 18 via selfpipe
chilli[5946]: _sigchld(316): child 6005 terminated
chilli[5946]: child_remove_pid(138): Freed child process 6005 [[redir]]
chilli[5946]: dhcp_receive_ip(3760): Address found
chilli[5946]: dhcp_receive_ip(3760): Address found
I can not check the "status" at all, what's the problem here?