wlan0 only works with eth0 connected

The situation:

I’m using the latest Jetbot image

I’m using the edimax Wifi included with the Jetbot kit

I followed the instructions here: https://learn.sparkfun.com/tutorials/ad … jetson/all

I’m accessing the terminal via SSH over eth0.

The problem:

When I run the command

nmcli d wifi connect [SSID] password [PASSWORD]

I see:

Error: Failed to add/activate new connection: Not authorized to control networking.

Okay, no big deal.

sudo usermod -G netdev -a yourusername 

Followed by a reboot. No joy. Sudo and it works.

Device 'wlan0' successfully activated with '2908c843-12a7-4582-9f37-long hex string'. 

The OLED now shows an IP for both eth0 and wlan0. Good indications.

Reboot the device with eth0 unplugged. wlan0 shows an IP on the OLED display.

I’m thinking I’m in the home stretch: Type the wlan0 IP into PuTTY and hit ‘Connect’

Network error: Software caused connection abort"

:expressionless: that shouldn’t have happened.

Plug in eth0 again. Connect to wlan0’s IP through PuTTY. IT WORKS. eth0’s IP: IT WORKS. Unplug eth0. Neither works.

There is no /etc/network/interfaces file. Tried adding it, and that broke eth0. I had to reimage the microSD.

Ideas?

I haven’t used PuTTY since Microsoft started including secure shell, years ago… so I can’t really help troubleshoot that.

However, I can say that I have had the most success getting the WiFi adapter working (after the driver installation) by configuring the WiFi connection through the desktop (i.e. plugging in a screen) and using the GUI.

I would suggest you try to ping the IP address to test the network connection from the windows command prompt. Another option is to access your router’s admin page to verify that the Jeston Nano is connected to the network.

Otherwise, the information displayed by the OLED comes from these lines:

https://github.com/NVIDIA-AI-IOT/jetbot … py#L27-L47

It should be noted that the service could have been frozen if the CPU/memory load is too high, like when the desktop interface is loading.

The OLED is working, and it shows IP information for connected interfaces.

When eth0 is unplugged, it only shows eth0 as unplugged,

and when eth0 is plugged in, it shows both eth0 and wlan0 with their own distinct IPs.

I can connect to the Jetson via SSH on either wlan0 or eth0 successfully. It responds to pings on both IPs. But as soon as I unplug eth0, wlan0 stops responding too. (and then the SSH disconnects)

I don’t have an extra display to use for the desktop interface… :frowning:

It occurred to me that you could try unplugging and plugging the USB WiFi adapter back in (after the WiFi disconnects). I doubt that would fix your issue, but it is worth a shot as a quick fix.

I was implying that you plug in a display or TV (that you have… don’t ssh to the Jetson from another computer) and use the GUI to initially configure the WiFi connection (on a freshly installed OS… after the driver installation). After that, you can try to use it without the display.

  • - Start with a fresh OS on the SD card
  • - Assemble the hardware (plug in the display/TV from your other computer)
  • - Boot and install the WiFi adapter driver
  • - Reboot with USB adapter plugged in
  • - Configure the WiFi through the desktop GUI and check the adapter is working (ifconfig, web browser without ethernet, etc.)
  • - Shutdown
  • - Then you can move your display back to your other computer and use the Jetson headless.
  • Otherwise, I think you are having issues with your network configuration, which is more of a Linux issue. Unfortunately, my “Linux-fu” isn’t very extensive. (*I don’t necessarily see any issues in the instructions or your steps to add permissions. However, the missing /etc/network/interfaces file is weird and there are multiple troubleshooting paths for that; some of which are more extensive than my Linux knowledge. Therefore, you may have more luck on a Linux specific forum digging into that without trying a fresh install.)

    I was able to borrow a HDMI capture card to act as a display:

    You were right; setting it up on the GUI was much easier and a reboot shows the Nano can connect to WiFi.

    However, the OLED says “No Internet!” despite it being able to successfully load Sparkfun.com (convenient URL that wasn’t cached) I can ping 8.8.8.8 successfully.

    Do you have any suggestions on how to make the OLED work as advertised? The IP thing is actually super useful.

    wlan1 is connected, not wlan0 (via ifconfig)

    …I’m reading through the linked code now

    Are you using our micro-OLED display (the square and not the rectangle one)?

    Are you using our jetbot folder [https://github.com/sparkfun/jetbot]?

    Is there anything else displayed on the OLED?

    I am using this microOLED

    https://www.sparkfun.com/products/14532

    that came with this kit

    https://www.sparkfun.com/products/16417

    I am using the JetBot image Sparkfun Jetbot v01-10.zip that was current as of May 6, 2020.

    The OLED is displaying:

    page 1[CPU 2.9%\nMem 50.8%\nDisk 46%]

    page 2[ Mem: 1.93/3.9 GB \n Disk: 25/57 GB\n]

    page 3[ No Internet!]

    I haven’t updated any of the jetbot scripts to match the github, but ifconfig is properly returning an IP address for wlan0

    BTW: Thanks for the help, Santa_Impersonator

    It seems like the code is failing here: https://github.com/NVIDIA-AI-IOT/jetbot … py#L27-L47

    Try unplugging the adapter and plugging it back in, sometimes that fixes the issue.

    Yes, I agree. (that it is failing on those lines; unsure of why.) I attempted that (unplug, replug) with no joy.

    You can test out the commands in the terminal and then test them out in Python (I think we pre-installed ipython3 in the Jetbot v01-10 image) to see if they are throwing any errors. Also, it looks like Nvidia recently updated that code: https://github.com/NVIDIA-AI-IOT/jetbot … 9b0a420bd9

    (*We are currently in the process of merging the commits from Nvidia for our repo: [https://github.com/sparkfun/jetbot/]. The version you are using v01-10, I believe is from this release: [https://github.com/sparkfun/jetbot/releases/tag/v0.0.3].)

    Other than that… you may need to hit up a Linux forum or submit an issue to Nvidia on GitHub.

    Okay. I think I’m steps away from solving everything:

    To get wifi working, I had to

    1. Plug in a HDMI display and use the GUI to connect (this created a /etc/network/interfaces file)

    2. add a line at the end to /etc/network/interfaces

    # Stop connecting with wlan0. It doesn't work
    iface wlan0 inet manual
    
    1. Reboot

    2. Delete all known Wifi Connections via the GUI

    3. Connect to the one true Wifi Connection via wlan1

    4. Reboot

    AND now Wifi works.

    The new problem being: The OLED shows “No Internet” when the DHCP table shows an IP leased to the Jetson Nano, and the Jetson Nano will accept SSH connections.

    sudo find / -iname utils.py 2>/dev/null | grep jetbot/utils

    /usr/local/lib/python3.6/dist-packages/jetbot-0.4.0-py3.6.egg/jetbot/utils/utils.py
    /usr/local/lib/python2.7/dist-packages/jetbot-0.4.0-py2.7.egg/jetbot/utils/utils.py
    /home/jetbot/jetbot/build/lib.linux-aarch64-2.7/jetbot/utils/utils.py
    /home/jetbot/jetbot/build/lib/jetbot/utils/utils.py
    /home/jetbot/jetbot/jetbot/utils/utils.py
    

    and I’m just going one by one, replacing them with the file you linked at https://github.com/NVIDIA-AI-IOT/jetbot … 9b0a420bd9

    EDIT:

    Looks like the one that matters is /usr/local/lib/python3.6/dist-packages/jetbot-0.4.0-py3.6.egg/jetbot/utils/utils.py

    Checking the diff between the copy on the image and the one linked shows

    28c28,29
    <     if get_network_interface_state(interface) == 'down':
    ---
    >     state = get_network_interface_state(interface)
    >     if state == 'down' or state == None:
    29a31
    >
    35c37,48
    <     return subprocess.check_output('cat /sys/class/net/%s/operstate' % interface, shell=True).decode('ascii')[:-1]
    ---
    >     if not os.path.exists('/sys/class/net/%s/operstate' % interface):
    >         #print("%s file does NOT exist" % interface)
    >         return None
    >
    >     try:
    >         status = subprocess.check_output('cat /sys/class/net/%s/operstate' % interface, shell=True).decode('ascii')[:-1]
    >     except Exception as err:
    >         print("Exception: {0}".format(err))
    >         return None
    >     else:
    >         return status
    >
    

    Rebooted… still shows no internet on the OLED.

    As I’m connecting to it via SSH without an ethernet cable.

    that solved… one problem. and created another. :cry: Par for the course.

    Have you got any other ideas, Santa_Impersonator? I think this has drifted away from the dark arts of Linux-Fu but I appreciate your helping me out this long.

    From what I can tell, the OLED is being updated by a service? Created by create_stats_service.py? But I’m unsure what starts it.

    Hi, I know this post is a bit old but I’ve got a solution so I think it’s worth to reply

    First of all, thank you ajtoth for your walkthrough it was really helpful!

    As I understand, the code in charge of finding if the jetbot is connected to internet is in:

    /usr/local/lib/python3.6/dist-packages/jetbot-0.4.0-py3.6.egg/jetbot/apps/stats.py

    There it checks if eth0 or wlan0 has an ip and, if so, it prints it on the OLED. Those two are passed as strings in another function to do the check. Just replace all the ‘wlan0’ by ‘wlan1’ in the file and it works.

    I’ve put below the part of the code where it checks if wlan0 is connected to internet.

    I hope it helps.

            # Checks for WiFi Connection
            try:
                    wlan = get_ip_address('wlan0')
                    if wlan != None:
                            a = a + 2
    
                    #Check String Length
                    if len(wlan) > 10:
                            # Find '.' to loop numerals
                            while c != -1:
                                    x2 = LCDWIDTH - disp._font.width * (len(wlan) - c)
                                    j = c + 1
                                    c = wlan.find('.', j)
    
            except Exception as e:
                    print(e)
    

    Gaalua,

    Thank you for your response! In fact, I came to that same solution independently a few weeks ago.

    wlan0 remained disconnected, but wlan1 was connected. The OLED script only checks to see if wlan0 is connected, so I changed it to wlan1 and it displays correctly!

    I am currently in the middle of updating our fork. I’ll be sure to add changes to check both wlan0 and wlan1.

    <3

    You’re great. Thank you!

    Update: The changes are in this [branch of the repo and we have submitted a pull request in Nvidia’s repo: https://github.com/NVIDIA-AI-IOT/jetbot/pull/467](GitHub - sparkfun/jetbot at update-SparkFun_hardware)