Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It doesnt work ChilliController.js #580

Open
Pavewleln opened this issue May 9, 2024 · 0 comments
Open

It doesnt work ChilliController.js #580

Pavewleln opened this issue May 9, 2024 · 0 comments

Comments

@Pavewleln
Copy link

Pavewleln commented May 9, 2024

I am trying to set up a ChilliController.js. I think i have connected coova-chilli. He redirects me, everything if fine. But, the request back from the site to the router does not go througn, here is the code:

document.getElementById("loginForm").addEventListener("submit", async (event) => {
    event.preventDefault();
    const urlParams = new URLSearchParams(window.location.search);
    const username = document.getElementById("username").value;
    const password = document.getElementById("password").value;
    chilliController.host = urlParams.get('uamip');
    chilliController.port = urlParams.get('uamport');
    chilliController.interval = 60;
    // chilliController.challenge = urlParams.get('challenge');
    // chilliController.session = urlParams.get('sessionid');
    // chilliController.redir = urlParams.get('userurl');

    chilliController.onError = handleErrors;
    chilliController.onUpdate = updateUI;

    setTimeout(() => {
        chilliController.logon(username, password);
    }, 1000);
});

function updateUI(cmd) {
    alert('You called the method' + cmd + '\n Your current state is =' + chilliController.clientState);
}

function handleErrors(code) {
    alert('The last contact with the Controller failed. Error code =' + code);
}

chilliController.refresh();

I am get this
Request URL:
http://192.168.182.1:3990/json/status?callback=chilliJSON.reply&0.33341848012877806
Request Method:
GET
Status Code:
302 Moved Temporarily
Remote Address:
192.168.182.1:3990
Referrer Policy:
strict-origin-when-cross-origin

alert: JSON request timed out (or reply is not valid)

What am i doing wrong? I can assure you that username and password are correct.

Coova-chilli settings:

config chilli
    option tundev 'tun0'
    option network ''
    option ipup /etc/chilli/up.sh
    option ipdown /etc/chilli/down.sh

    # Radius parameters
    option radiusserver1 192.168.1.167
    option radiusserver2 192.168.1.167 
    option radiussecret testing123

    # DHCP Parameters
    option dhcpif br-lan
    option uamserver http://192.168.1.167/login.html
    #option uamsecret testing123
    #option uamdomain 192.168.1.167
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant