Navigation

    UBports Robot Logo

    UBports Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    SOLVED How to disable autoconnect for known Wi-Fi connections?

    Support
    6
    14
    484
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sven last edited by sven

      Is there a simple (or difficult) way to disable autoconnect for stored Wi-Fi connections?

      I need this to setup a hotspot more easily. Some people say that activating a hotspot is easier (i.e. less tries needed) if Wi-Fi is on, but not connected. Currently, I cannot reach this state.

      VollaPhone22 (UT, OTA-24), Pocophone F1 (pmOS, edge)

      AppLee mateo_salta 2 Replies Last reply Reply Quote 0
      • AppLee
        AppLee @sven last edited by

        @sven
        In the dropdown menu you can access the wifi parameters.
        There you can access the list of know SSID.
        Tap on the one you're connected to and you'll have the option to delete this network.

        To ease the next connection, you can display and copy the passphrase to ease logging in again πŸ˜‰

        I don't remember an option about automatic connection, but maybe I'm wrong.
        The previous method is blunt but works πŸ™‚

        1 Reply Last reply Reply Quote 1
        • Z
          zubozrout last edited by

          I don't think you can do that with the UT UI, but since there is a NetworkManager behind all this you should be able to configure things manually in a console.

          e.g. like this:
          sudo nano /etc/NetworkManager/system-connections/MyNetorkSSID

          and add autoconnect=false somewhere under [connection]. I haven't tested it but based on some sources like these config examples on the Gnome web it should be correct.

          Not sure if there is a way to do that for all as well as new networks (maybe), but from what I've seen on various forums this may not be possible.

          1 Reply Last reply Reply Quote 0
          • S
            sven last edited by

            @AppLee This rough workaround is ok.

            @zubozrout Unfortunately, the change has no effect before a reboot. After a reboot, I could not reactivate the connection by removing autoconnect=false.

            VollaPhone22 (UT, OTA-24), Pocophone F1 (pmOS, edge)

            AppLee Z 2 Replies Last reply Reply Quote 0
            • AppLee
              AppLee @sven last edited by

              @sven
              I think you can try to connect manually by tapping on the wifi SSID (white label) with autoconnect=false but I'm not sure it will work.
              I think changes to /etc/NetworkManager/system-connections/MyNetorkSSID are only applied after a reboot.

              1 Reply Last reply Reply Quote 0
              • mateo_salta
                mateo_salta @sven last edited by

                @sven i had a bug filed sonewhere to enable that setting, although the existing gsetting seems not to work

                1 Reply Last reply Reply Quote 0
                • Z
                  zubozrout @sven last edited by

                  @sven said in How to disable autoconnect for known Wi-Fi connections?:

                  autoconnect=false

                  Weird, I've just tried it and upon inserting autoconnect=false to the [connection] section in that file the respective WiFi network is not autoconnected on reboot and only if clicked on in the list of available WiFi networks with the UI. I am not sure if you need a different usecase and I misunderstood that but this config should definitely work as the network manager on the phone is basically the same thing as the one you can find on the desktop.

                  Perhaps a stupid question to ask but did you save the changes in the file before leaving the nano text editor? As I have no idea what else could cause the issue. Also for changes to this folder remounting / fs to read/write should not be necessary.

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    sven @zubozrout last edited by sven

                    @zubozrout Thanks for checking; and yes, that is the behavior I am looking for, but I cannot reproduce it on my device. What device and UT version did you use for your test?

                    VollaPhone22 (UT, OTA-24), Pocophone F1 (pmOS, edge)

                    Z 1 Reply Last reply Reply Quote 0
                    • K
                      kugiigi last edited by

                      You can also run this instead of rebooting πŸ˜„
                      sudo service network-manager restart

                      1 Reply Last reply Reply Quote 1
                      • Z
                        zubozrout @sven last edited by zubozrout

                        @sven Meizu MX4, latest devel. But I don't think this could be device or some OS version specific :(, so have no idea what could be causing NetworkManager to ignore these config file changes. After all it must be using them since it autoconnects to known networks listed in that /etc/NetworkManager/system-connections folder.

                        K 1 Reply Last reply Reply Quote 0
                        • K
                          kugiigi @zubozrout last edited by

                          @zubozrout Try to check the previous networks list. Some networks are duplicated and maybe the one you modified isn't the one you connected.

                          S 1 Reply Last reply Reply Quote 0
                          • S
                            sven @kugiigi last edited by

                            @kugiigi Thanks for your help. I can confirm that your method works on my OnePlus3T. The problem on the Cosmo seems to be a more general Wi-Fi problem that is Cosmo-specific. (In short: the Wi-Fi interface is named wlan0 instead of wlp1s0 in normal UT, see https://gitlab.com/ubports/community-ports/android9/planet-cosmocom/planet-cosmocom/-/issues/4 )

                            VollaPhone22 (UT, OTA-24), Pocophone F1 (pmOS, edge)

                            arubislander 1 Reply Last reply Reply Quote 0
                            • arubislander
                              arubislander @sven last edited by

                              @sven said in How to disable autoconnect for known Wi-Fi connections?:

                              The problem on the Cosmo seems to be a more general Wi-Fi problem that is Cosmo-specific. (In short: the Wi-Fi interface is named wlan0 instead of wlp1s0 in normal UT, see https://gitlab.com/ubports/community-ports/android9/planet-cosmocom/planet-cosmocom/-/issues/4 )

                              I doubt very much that the name of the wireless network interface is contributing to the problem. The name the kernel assigns to an interface is based on the actual hardware and the kernel version.
                              For instance the wifi interface is also called wlan0 on my Meizu Pro 5. And wifi hotspot works on his device.

                              πŸ‡¦πŸ‡Ό πŸ‡³πŸ‡± πŸ‡ΊπŸ‡Έ πŸ‡ͺπŸ‡Έ
                              Happily running Ubuntu Touch
                              BQ Aquaris M10 FHD (16.04 RC)
                              Google Pixel 3a (20.04 DEV)
                              JingPad (16.04 DEV)
                              Meizu Pro 5 (16.04 DEV)
                              PinePhone / PineTab UT CE (16.04 DEV)

                              S 1 Reply Last reply Reply Quote 0
                              • S
                                sven @arubislander last edited by

                                @arubislander OK, and I thought I had a suspect for the non-operational hotspot on the Cosmo 😞

                                VollaPhone22 (UT, OTA-24), Pocophone F1 (pmOS, edge)

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post