• Support
  • Captive portal when MoodleBox not connected to the Internet

I know this is bringing up an old topic but I have a question for you programmers out there because some of us are just teachers...
When I run the KIWIX hotspot on a pi, it comes up with an instruction screen as soon as you log in. This seems to be linked to the connectivity check rather than as a captive portal. It works in both online and offline scenarios.
Could this be replicated for the moodlebox?

Can you post some screenshots or photos of what you see with your KIWIX hotspot?

  • Ian replied to this.

    Can you please describe precisely the whole steps before you get this screen? (I cannot yet figure out what you describe)

    When I conect to the wifi (usually kiwix although you can change it, in this case "chatterchannel") this screen pops up automatically as soon as the connection is established. It does the same in windows computer as on cell phone. I believe it is linked to a connectivity check but don't know.
    It does not auto redirect but it tells the user to connect to a certain address n their browser, in our case it would advise them to connect to http://moodlebox.home
    It would be useful to have this instead of verbal instructions on how to connect to the moodle

      Ian When I conect to the wifi (usually kiwix although you can change it, in this case "chatterchannel") this screen pops up automatically as soon as the connection is established.

      So this is a captive portal. I'll try to take time to see how it works in kiwix (note to self: kiwix hotspot captive portal source).

      BTW, does "NDS" in the subject mean "NoDogSplash"? In this case, is it OK to change it?

      • Ian replied to this.

        Nicolas You are welcome to change the title.
        I always thought a captive portal was linked to a browser hence the need for an internet connection. This does not open a browser, only a notification panel.

        Nicolas changed the title to NoDogSplash again .

        I've analyzed this more deeply. The news are not good for such use case.

        How a captive portal works?

        1. The client device generates automatically a http (port 80) request. This requests tries to load a remote URL through the default gateway for a unique (or quasi-unique) time.
        2. The request URL depends on the user's device type (Android, MacOS, iOS, Windows, etc.) or on the user's browser.
        3. The captive portal "captures" it and does its thing (present a web page with infos, etc.).

        Consequence: an Internet connexion is needed for a captive portal to work.

        Nodogsplash, OpenNDS and Balena WiFi Connect all function like this, and do not work when the router (say MoodleBox) has no Internet connexion, since step 1 above fails.

        What about Kiwix hotspot?

        Kiwix hotspot works around this in its captive portal when offline by faking a correct answer from the URL given by the user's client, a complex thing to do.

        That's why Kiwix's captive portal works also when the router isn't connected to the Internet.

        Is it possible to do this in the MoodleBox?

        Certainly, but it is complex (see above) and needs a lot of programming and testing. I'll open I've opened an issue for this, but won't be able to do this alone: I've not the expertise, nor the time to implement it.

        I'm open to be sponsored for implementing such a feature.

        Edit: See this issue on Github.

          Nicolas changed the title to Captive portal when MoodleBox not connected to the Internet .
          8 months later
          16 days later

          Ian
          Please open the MoodleBox dashboard moodlebox.home/admin/tool/moodlebox/index.php
          Here we will see the ethernet ip address of your MoodleBox. Take a computer wired to the ethernet. Start the terminal application on your computer. Type the following terminal command … you should use the ip address you see in your MoodleBox dashboard. Enter the password "Moodlebox4$". Now you're connected over ethernet.

          ssh moodlebox@192.168.1.100