11 Replies Latest reply on Feb 10, 2016 7:24 PM by jcuzella

    Edison WiFi woes

    rubidium

      I just tried setting up WiFi for the first time and am at an impasse.  Here's the story:

       

      1. With configure_edison --setup I gave my system a name and password, and then got to the WiFi setup.  It showed all the familiar access points in my local environment, including my router. I selected my router and entered the long WPA2 passphrase. Looks good at this point:

      Configure Edison: WiFi Connection

       

      Scanning: 1 seconds left

       

      0 :     Rescan for networks

      1 :     Manually input a hidden SSID

      2 :     personal_network-guest

      3 :     personal_network

      4 :     FT3SH

      5 :     MzMuMu

      6 :     TARTARUSNET_RPT

      7 :     TARTARUSNET

       

       

      Enter 0 to rescan for networks.

      Enter 1 to input a hidden network SSID.

      Enter a number between 2 to 7 to choose one of the listed network SSIDs: 7

      Is TARTARUSNET correct? [Y or N]: y

      Password must be between 8 and 63 characters.

      What is the network password?: ******************************

      Initiating connection to TARTARUSNET. Please wait...

      Attempting to enable network access, please check 'wpa_cli status' after a minute to confirm.

      Done. Please connect your laptop or PC to the same network as this device and go to http://192.168.2.9 or http://fswap.local in your browser.

      root@fswap:~#

       

      2. In a browser connected to the same network, I try going to http://192.168.2.9 but browser just hangs.

      3. On Edison, I ping 192.168.2.9 and get response, but ping my router at 192.168.2.1 or anything else other than the Edison and get NO response:

      root@fswap:~# ping 192.168.2.9

      PING 192.168.2.9 (192.168.2.9): 56 data bytes

      64 bytes from 192.168.2.9: seq=0 ttl=64 time=0.321 ms

      64 bytes from 192.168.2.9: seq=1 ttl=64 time=0.286 ms

      64 bytes from 192.168.2.9: seq=2 ttl=64 time=0.286 ms

      64 bytes from 192.168.2.9: seq=3 ttl=64 time=0.286 ms

      64 bytes from 192.168.2.9: seq=4 ttl=64 time=0.286 ms

      ^C

      --- 192.168.2.9 ping statistics ---

      5 packets transmitted, 5 packets received, 0% packet loss

      round-trip min/avg/max = 0.286/0.293/0.321 ms

      root@fswap:~#

      root@fswap:~#

      root@fswap:~# ping 192.168.2.1

      PING 192.168.2.1 (192.168.2.1): 56 data bytes

      ^C

      --- 192.168.2.1 ping statistics ---

      11 packets transmitted, 0 packets received, 100% packet loss

      root@fswap:~#

      4. wpa_cli -i wlan0 status looks good:

      root@fswap:~# wpa_cli -i wlan0 status

      bssid=c0:c1:c0:22:cb:e1

      ssid=TARTARUSNET

      id=8

      mode=station

      pairwise_cipher=CCMP

      group_cipher=CCMP

      key_mgmt=WPA2-PSK

      wpa_state=COMPLETED

      ip_address=192.168.2.9

      address=78:4b:87:a4:48:e7

      uuid=8a1f534b-9f9c-52d0-847d-7ef72a8ba17f

      root@fswap:~#

      The bssid shown is indeed the mac address of the wireless part of my router.

      5. My router lists a DCHP client with the correct mac address of the Edison, and the correct assigned IP address of 192.168.2.9.

       

      Everything looks good to me, except I can't communicate wirelessly to or from the Edison. I'm at a complete loss.

       

      Jim

        • 1. Re: Edison WiFi woes
          intel_dan

          You need to run 'configure_edison --server' to be able to connect to the IP of your Edison trough a browser.

          It is strange that you can not ping your router.

          1 of 1 people found this helpful
          • 2. Re: Edison WiFi woes
            rubidium

            I did run 'configure_edison --server', but to no avail. More disconcerting is my inability to ping, despite the setup looking good everywhere.

             

            Ironically, a simple 'systemctl start hostapd" effortlessly sets up the WiFi as an AP with IP address 192.168.42.1.  I can link to this with my cell phone, which is subsequently given the IP address 192.168.42.20. Then I can successfully ping 192.168.42.20 from Edison, and successfully open the page at  http://192.168.42.1 from my phone's browser. So Edison WiFi works *flawlessly* in AP more, and what's more is that it's painless to set up.


            So what's wrong with my setup above where I am simply trying to gain internet access from my Edison so that I may SSH to it and also download and install a few packages with opkg? This can't be that hard.


            Still scratching my head ...

            Jim


             

            • 3. Re: Edison WiFi woes
              rubidium

              Wow ... an apparently overlooked conflict resolved by issuing 'ifconfig usb0 down'.  Now I can SSH wirelessly.

              • 4. Re: Edison WiFi woes
                Jesse_B

                I'm finding if I have to power the edison off and back on, I then have to manually re-establish a wifi connection.  Is there a way to save the settings so I can plug it in and immediately ssh?

                • 5. Re: Edison WiFi woes
                  Jesse_B

                  Following this Connecting to a Wireless Network via Linux* it seems to be working ok, it was that or the configure_edison --server command, those the only things I attempted regarding wifi.

                  • 6. Re: Edison WiFi woes
                    szirin

                    Yes, your Wi-Fi network was using the same IP network number as Edison's USB Gadget driver network.   Good find noticing the addressing conflict between the two networks!

                    • 7. Re: Edison WiFi woes
                      rubidium

                      Same was happening to me.  Finally answered in post 13 of this thread: SSH to my edison?

                      1 of 1 people found this helpful
                      • 8. Re: Edison WiFi woes
                        szirin

                        Jesse, the instructions you followed at Connecting to a Wireless Network via Linux* use the command 'systemctl start wpa_supplicant' to start-up the Wi-Fi supplicant and network until the next reboot.   Configuring Wi-Fi with 'configure_edison --setup' also enables the supplicant (and network) to start on every boot.  It does this with the command 'systemctl enable wpa_supplicant' which enables the required service to start automatically at the appropriate point in the startup sequence.

                         

                        Try running 'systemctl enable wpa_supplicant' to enable automatically starting of Wi-Fi and use 'systemctl disable wpa_supplicant' if you ever want to disable automatic starting of Wi-Fi.

                        1 of 1 people found this helpful
                        • 9. Re: Edison WiFi woes
                          poseid

                          I still had some problems to get Wifi working with my device. Here is what i did:

                           

                          1) ensure Yocto Linux is at latest release (without it, my Wifi network is not found)

                          2) configure Wifi on edison worked, but I could not login via the browser. Only a local curl 192.168.2.112 was working

                          3) I issued ifconfig usb0 down --> now I could login via the wifi - to prevent problems I removed the usb cable for serial control

                          4) I still had to issue a route command with:

                          /sbin/route add default gw 192.168.2.1


                           

                          It would be great to be able to connect from a laptop to the Edison without these extra configuration steps.

                          • 10. Re: Edison WiFi woes
                            jcuzella

                            I had to patch the version of the "configure_edison" script that came with the intel image in order to get the WiFi password input to accept special characters.

                             

                            This was for the version of configure_edison that comes with:

                             

                            Poky (Yocto Project Reference Distro) 1.6.1

                            cat /etc/release

                            EDISON-3.0

                            Copyright Intel 2015

                             

                            To patch, create a patch / diff file:

                             

                             

                            --- a/configure_edison

                            +++ b/configure_edison

                            @@ -190,11 +190,11 @@

                             

                             

                            def _changeAPSSID(newName):

                               saveDefaultSSID()

                            -  subprocess.call(["sed", "-i", "s/^ssid=.*/ssid=" + newName + "/", "/etc/hostapd/hostapd.conf"])

                            +  subprocess.call(["sed", "-i", "s/^ssid=.*/ssid=" + re.escape(newName) + "/", "/etc/hostapd/hostapd.conf"])

                               subprocess.call("systemctl restart mdns && sleep 2", shell=True)

                             

                             

                            def _changeP2PSSID(newName):

                            -  subprocess.call(["sed", "-i", "s/^p2p_ssid_postfix=.*/p2p_ssid_postfix=" + newName + "/", "/etc/wpa_supplicant/p2p_supplicant.conf"])

                            +  subprocess.call(["sed", "-i", "s/^p2p_ssid_postfix=.*/p2p_ssid_postfix=" + re.escape(newName) + "/", "/etc/wpa_supplicant/p2p_supplicant.conf"])

                             

                             

                            def changePassword(newPass):

                               if WSREGEX.search(newPass):

                            @@ -219,7 +219,7 @@

                               chpasswdSub.communicate()[0]

                             

                             

                            def _changeAPPassword(newPass):

                            -  subprocess.call(["sed", "-i", "s/^wpa_passphrase=.*/wpa_passphrase=" + newPass + "/", "/etc/hostapd/hostapd.conf"])

                            +  subprocess.call(["sed", "-i", "s/^wpa_passphrase=.*/wpa_passphrase=" + re.escape(newPass) + "/", "/etc/hostapd/hostapd.conf"])

                             

                             

                            def getNetworkIdentity():

                               return raw_input("Please enter the network username: ")

                             

                             

                            Then, patch the file with:

                             

                            cd /usr/bin/

                            patch configure_edison  /tmp/configure_edison.patch

                            • 11. Re: Edison WiFi woes
                              jcuzella

                              Wow!  It's surprisingly hard to find the upstream source code repos for anything Intel Edison related!

                               

                              After hours of searching, I finally managed to figure out that the configure_edison script is installed by the oobe package:

                               

                              root@mu-lyrae:~# opkg whatprovides '*/configure_edison'

                              What provides */configure_edison

                              root@mu-lyrae:~# opkg search '/usr/bin/configure_edison'

                              oobe - 1.2.0-r0

                              root@mu-lyrae:~# opkg files oobe | grep configure_edison

                              /usr/bin/configure_edison

                               

                              Once I knew the package, a search for "Intel Edison oobe" finally turned up the repo that builds the Yocto image layer: meta-intel-edison - Layer for the Intel Edison Development Platform

                               

                              Cloning that repo down, I searched again for oobe, and found another reference to an upstream repo: meta-intel-edison-distro/recipes-support/oobe/oobe_1.2.0.bb#L4

                              Which pointed me finally to:

                               

                              GitHub - 01org/edison-oobe

                               

                              Finally I was able to make a Pull Request to fix the bug I found:

                               

                              Fix for WiFi Passwords with special characters by trinitronx · Pull Request #2 · 01org/edison-oobe · GitHub

                               

                              Hopefully whoever's in charge merges & it gets put into newer releases!