• SupportSolved
  • Connecting the MoodleBox to an access point blocks its own access point

  • Edited

Hi all

This is about the MB in https://discuss.moodlebox.net/d/485-moodlebox-490/2 - a RPi 400, MB 4.9.0.

Last time I did this, https://discuss.moodlebox.net/d/461-connecting-a-rpi-zero-2-w-bullseye-moodlebox-to-a-wireless-lan-as-well, but with too much manual interference. This time I open raspi-config and enter the ESSID and WPA passphrase. Bus as soon as I save the values, the MB's access point (ESSID MoodleBox) stops.

I didn't find anything unusual in /etc/wpa_supplicant other than funstions.sh is not executable. It is only a library for the other scripts, I discovered.

Once the MB access point stops, I have to take the RPi through a power cycle. Since the MB is truly headless, once its AP is gone, I am locked out.

    Ratna

    Hi Ratna, I do not understand your setting. Do you want to use your MoodleBox without an ethernet cable? Should the MoodleBox use an external WiFi to connect to the internet and send its own WiFi for the MoodleBox users?

    About this setting I wrote https://discuss.moodlebox.net/d/451-connecting-the-moodlebox-to-a-wifi-network/14

    I think that the file /etc/wpa_supplicant is no longer the place for setting up the WiFi in Debian 12 (Bookworm). It uses the NetworkManager and the settings in /etc/NetworkManager/system-connections/.

    Best regards,
    Ralf

      ralfkrause Thanks, Ralf! You understood my application.

      So it is the change from wpa_supplicant to NetWorkManager between Debian 11 and 12 that made my investigation of wpa_supplicant pointless. Unterstood.

      But also I wrote "This could be easily done in the 'raspi-config' program in the Raspberry Pi OS." in https://discuss.moodlebox.net/d/461-connecting-a-rpi-zero-2-w-bullseye-moodlebox-to-a-wireless-lan-as-well/3 in the same thread. Was that wrong? Or was it correct but now obsolete?

      Either way, I will try your method https://discuss.moodlebox.net/d/451-connecting-the-moodlebox-to-a-wifi-network/14 next time.

        Ratna

        Hi Ratna, in the thread https://discuss.moodlebox.net/d/461-connecting-a-rpi-zero-2-w-bullseye-moodlebox-to-a-wireless-lan-as-well/ you used MoodleBox 4.5.1 with Debian 11 (Bullseye). And MoodleBox 4.5.1 doesn't use the NetworkManager.

        Release notes for MoodleBox 4.6.0 https://github.com/moodlebox/moodlebox/releases/tag/v4.6.0
        The relevant issues are https://github.com/moodlebox/moodlebox/issues/287 and https://github.com/moodlebox/moodlebox/issues/305 .

        Ralf

          • Edited

          ralfkrause Who said Debian is conservative? :-(

          Well, there is a positive side to it too. I have a set of very old iMacs (2011-13), that function great under Debian. Only thing no wireless drivers at install - from past experience. You need to get the closed-source driver packages and install separately, not user friendly.

          That was until Debian 11. The other day I wiped them with Debian 12 and was hugely surprised that the wireless interface was detected and could continue the installation on wireless. It was DebianEdu Bookworm, to be more accurate.

          ralfkrause I think that the file /etc/wpa_supplicant is no longer the place for setting up the WiFi in Debian 12 (Bookworm). It uses the NetworkManager and the settings in /etc/NetworkManager/system-connections/.

          This is totally correct. The network layer of recent MoodleBox images (from version 4.6.0 onwards) is based on NetworkManager. You can check the implementation details here: https://github.com/moodlebox/moodlebox/issues/305.

          It seems that I didn't document (yet) the way to wirelessly connect a MoodleBox to an existing network.

          Just edit the file /etc/NetworkManager/system-connections/WifiSTA.nmconnection, indicating the SSID and password. That should do it. E.g.

          sudo -Es
          nano /etc/NetworkManager/system-connections/WifiSTA.nmconnection

          then save, or, interactively,

          sudo nmtui

          and edit the WifiSTA connection.

            • Edited

            Nicolas The new scheme works, but not reliable. Maybe I'm over-caring, not expecting the new "automation". Set it up with nmcli and double checked the WifiSTA.nmconnection. The MB refused to connect to wi-fi. Checked rfkill etc. But then in a later try couple of hours later it connected.

            But my laptop connected to the MoodleBox wi-fi didn't have Internet access. Saw that its routing was confused:

            Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
            0.0.0.0         192.168.1.1     0.0.0.0         UG    99     0        0 wlan0
            0.0.0.0         10.0.0.1        0.0.0.0         UG    600    0        0 uap0
            10.0.0.0        0.0.0.0         255.255.255.0   U     600    0        0 uap0
            192.168.1.0     0.0.0.0         255.255.255.0   U     99     0        0 wlan0

            route del -net 0.0.0.0 uap0 corrected it.

            Working right now connected to the MoodleBox wi-fi and then another leg through my home-office wi-fi. Not having a good feeling. The positive thing is, the laptop always connect to MoodleBox wi-fi, so I can log in to its shell and iron out what comes. I'm trying to get used to the new networking concept.

            Ref. https://www.jeffgeerling.com/blog/2023/nmcli-wifi-on-raspberry-pi-os-12-bookworm

              Ratna Just retested now and I cannot reproduce the faulty behavior (on latest MoodleBox image).

              Could you please confirm that in your /etc/NetworkManager/system-connections/WifiSTA.nmconnection file, you've got the line route-metric=99 like this

              ...
              [ipv4]
              method=auto
              route-metric=99
              ...

              (See https://github.com/moodlebox/moodlebox/issues/334)

                Nicolas Yeah, the route-metric is 99. (full WifiSTA.rmconnection is quoted).

                Now (after a couple of power cycles) I looked at the route:

                Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
                0.0.0.0         192.168.1.1     0.0.0.0         UG    99     0        0 wlan0
                0.0.0.0         10.0.0.1        0.0.0.0         UG    600    0        0 uap0
                10.0.0.0        0.0.0.0         255.255.255.0   U     600    0        0 uap0
                192.168.1.0     0.0.0.0         255.255.255.0   U     99     0        0 wlan0

                So the gateway through uap0 (line 2) is back. The high metric is keeping it inactive.

                This is the expected behaviour I suppose. The initial problems were probably due to me touching the configuration unnecessarily. The MB is now ready for production, so I don't want to tinker too much - unless I encounter further hiccups.

                [connection]
                id=WifiSTA
                uuid=715fbcc0-8c78-4f50-91f2-4a955f354262
                type=wifi
                interface-name=wlan0
                
                [wifi]
                mode=infrastructure
                ssid=MYSSID
                
                [wifi-security]
                key-mgmt=wpa-psk
                psk=PASSWORD
                
                [ipv4]
                method=auto
                route-metric=99
                
                [ipv6]
                addr-gen-mode=default
                method=auto
                
                [proxy]
                a month later