13 Replies Latest reply on May 4, 2016 4:46 PM by Intel Corporation

    wifi Roaming - yocto vs Ubilinux

    KyloRen

      Hi everyone,

       

      I reconfigured my Edison using latest Yocto and trying to figure out how to configure wifi roaming, since WPA_ROAM not available as it is on ubilinux what is the best way to setup the wifi?

       

      I have multiple WPA SSIDs including home, mobile hotspot and school. This used to work great on ubilinux (aptosid Manuals - Setting up for WiFi Roaming) and wonderingif I have to reimage using ubilinux.

       

      I am not a Linux expert so if there is a way to do this with wpa_supplicant or connman please let me know. Also at my son's school they have multiple APs per each classroom and we loose connectivity as he roams from one class to other. ifconfig wlan0 down and ifconfig wlan up not helping and the only way to connect is reboot.

       

      I am clearly missing something obvious here, please help

        • 1. Re: wifi Roaming - yocto vs Ubilinux
          KyloRen

          as a hack was thinking about running a cron to check connectivity and if not connected do a wpa_cli enable_network and wpa_cli select_network vs ifconfig wlan0 down/up pair.

          • 2. Re: wifi Roaming - yocto vs Ubilinux
            KyloRen

            cat /etc/version

            201603141535

            • 3. Re: wifi Roaming - yocto vs Ubilinux
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi,

               

              As you know the Edison doesn’t have the /etc/network/interfaces file in order to setup the roam feature for wpa_supplicant. You can create this file with
              mkdir /etc/network
              touch /etc/network/interfaces

              And then add the configuration of the interfaces you want to have. Once you have done this you can use ifup and ifdown to control them or create a script that runs on boot managing the interfaces.Or you can try with https://www.debuntu.org/how-to-wifi-roaming-with-wpa-supplicant/

               

              Another way could be using connman. For this you need to stop and disable the wpa_supplicant service and start and enable the connman service.
              systemctl stop wpa_supplicant
              systemctl disable wpa_supplicant
              systemctl start connman
              systemctl enable connman

               

              After this you need to edit the connman settings in /var/lib/connman and add the PreferredTechnologies: https://01.org/connman/documentation
              In order to add the interfaces, you need to run connmanctl, enable wifi, scan wifi, services, agent on, connect <wifi_*Respective Item*>, quit. These interfaces can be checked in /var/lib/connman.

               

              I hope this helps.
              Charlie

              • 4. Re: wifi Roaming - yocto vs Ubilinux
                KyloRen

                Thank you Charlie, connman worked like a charm following the steps. Follow up question in case of multiple APs (Same SSID, setup at school where they have APs in each classroom) connman automatically reconnects when roam?

                • 5. Re: wifi Roaming - yocto vs Ubilinux
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  Hi,

                  I’m very glad to know that connman has worked for you. If you have the SSIDs added as an interface on the board, it should reconnect automatically. Let me know if you have problems with this.

                  Regards,
                  Charlie
                   

                  • 7. Re: wifi Roaming - yocto vs Ubilinux
                    KyloRen

                    Hi everyone,

                    So after running connman for cpl days we lost connectivity at school, after connecting via serial port services returned none, did scan wifi and no results. Then did systemctl poweroff and after reboot when I ran services noticed that all wifi records have different ID. Looks like for some reason connman couldn't read the saved connections?Capture.PNG

                     

                    Update: Second reboot, and connman loaded and connected to saved connections.
                    Capture.PNG

                    To mitigate this problem what is the common practice? a cron to check connectivity periodically  (lets say every 30 min) and incase cant connect do a systemctl restart connman?

                    1 of 1 people found this helpful
                    • 8. Re: wifi Roaming - yocto vs Ubilinux
                      Intel Corporation
                      This message was posted on behalf of Intel Corporation

                      Hi, 

                      The problem could be that when you rebooted the board, it didn’t load all the settings successfully.
                      I think the approach you want to use is a good idea and it should work. 

                      Regards,
                      Charlie
                       

                      • 9. Re: wifi Roaming - yocto vs Ubilinux
                        KyloRen

                        some more updates, so we noticed the same issue today. Basically connman successfully switched between different SSID till later in the afternoon which it successfully connected to ATT584 (192.168.1.224) and after not being in a range for a while when the rig came back home it didn't reconnect to our home SSID. Unfortunately systemctl restart connman or stop/start didn't load the right configuration. reboot fixed the problem.

                         

                        Capture.PNG

                         

                        I am also attaching the log.

                        • 10. Re: wifi Roaming - yocto vs Ubilinux
                          KyloRen

                          Update 2: Today connman stopped working around 11:48 am PST, looks like it deleted interface wlan0 after couple of retries and like yesterday when I ran services it was all empty. reboot reloaded the config as expected, at this point I would like to get some help on 1) troubleshooting the main cause and 2) a way to recover without rebooting the rig and as pervious post systemctl restart or stop/start not helping.

                          Capture1.PNG

                          Capture2.PNG

                           

                          Logs also attached, BTW do we have access to beta image of yocto with latest connman 1.32 I think?

                          • 11. Re: wifi Roaming - yocto vs Ubilinux
                            Intel Corporation
                            This message was posted on behalf of Intel Corporation

                            Hi, 

                            Do you have improvements if you remove the PreferredTechnologies feature?
                            You can install from source the 1.32 version if you want. (https://www.kernel.org/pub/linux/network/connman/)

                            Could you post how are you setting the /var/lib/connman/settings? 
                            Are you using the recommended parameters: http://git.kernel.org/cgit/network/connman/connman.git/tree/src/main.conf or are you including something else: https://www.mankier.com/5/connman-service.config
                            Is the wpa_supplicant disabled?
                            Let’s try by using a simple connman configuration, just to see if the connectivity issues disappear and if this happens to see if the hash numbers keep changing.

                            Regards,
                            Charlie

                            • 12. Re: wifi Roaming - yocto vs Ubilinux
                              KyloRen

                              Thank you Charlie,

                               

                              So what I can say we have solid results at home with one AP and works flawlessly. I think the issue at school is related to dealing with multiple APs and roaming from one classroom to another, looking at documents couldn't find anything specifically to cover that scenario. For now I switched to using conman and BT to connect to iPhone as hotspot and so far happy. This way we look at School WiFi as back up

                               

                              As to your questions: wpa_supplicant is disabled and I am using the recommended options for sure.

                               

                              I would love to discuss more or see if we can find a work around for multi AP scenarios.

                              • 13. Re: wifi Roaming - yocto vs Ubilinux
                                Intel Corporation
                                This message was posted on behalf of Intel Corporation

                                Hi,

                                I’m glad to know that you have found a workaround for this. The main problem could be the connectivity issue that disconnects the board from the network. Have you been checking the strength of these networks? You can use commands like:

                                watch -n 1 cat /proc/net/wireless
                                watch -n 1 "awk 'NR==3 {print \"WiFi Signal Strength = \" \$3 \"00 %\"}''' /proc/net/wireless"
                                iwconfig wlan0 | grep -e 'Tx-Power\|Signal level'


                                It also seems that connman is saving the hash numbers of the interfaces so when it lose connection and/or there is a problem with the service, connman searches and scans again for interfaces available and assigns a new hash number due to have the others restricted avoiding conflicts between the interfaces.

                                Regards,
                                Charlie