WIFI connection test

From Wiki-Orange Pi
Revision as of 19:52, 24 April 2023 by Admin (talk | contribs)
Jump to: navigation, search
Please do not connect to WIFI by modifying the /etc/network/interfaces configuration file. There will be problems connecting to the WIFI network in this way.

1. The server image connects to WIFI through commands

When the development board is not connected to Ethernet, not connected to HDMI display, but only connected to the serial port, it is recommended to use the commands demonstrated in this section to connect to the WIFI network. Because nmtui can only display characters in some serial port software (such as minicom), and cannot display the graphical interface normally. Of course, if the development board is connected to an Ethernet or HDMI display, you can also use the commands demonstrated in this section to connect to the WIFI network.

1) First log in to the linux system, there are the following three ways
a. If the development board is connected with a network cable, you can remotely log in to the Linux system through ssh
b. If the development board is connected to the debugging serial port, you can use the serial port terminal to log in to the Linux system
c. If the development board is connected to the HDMI display, you can log in to the linux system through the terminal displayed on the HDMI

2) First use the nmcli dev wifi command to scan the surrounding WIFI hotspots

orangepi@orangepi:~$ nmcli dev wifi

Pi-5-details-pic60.png

3) Then use the nmcli command to connect to the scanned WIFI hotspot, where:
a. wifi_name needs to be replaced with the name of the WIFI hotspot you want to connect to
b. wifi_passwd needs to be replaced with the password of the WIFI hotspot you want to connect to

orangepi@orangepi:~$ nmcli dev wifi connect wifi_name password wifi_passwd

Device 'wlan0' successfully activated with 'cf937f88-ca1e-4411-bb50-61f402eef293'.

4) You can view the IP address of wifi through the ip addr show wlan0 command

orangepi@orangepi:~$ ip addr show wlan0

11: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

link/ether 23:8c:d6:ae:76:bb brd ff:ff:ff:ff:ff:ff

inet 192.168.1.11/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0
valid_lft 259192sec preferred_lft 259192sec
inet6 240e:3b7:3240:c3a0:c401:a445:5002:ccdd/64 scope global dynamic noprefixroute
valid_lft 259192sec preferred_lft 172792sec
inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute
valid_lft forever preferred_lft forever

5) Use the ping command to test the connectivity of the wifi network, and the ping command can be interrupted through the shortcut key Ctrl+C

orangepi@orangepi:~$ ping www.orangepi.org -I wlan0

PING www.orangepi.org (182.92.236.130) from 192.168.1.49 wlan0: 56(84) bytes of data.
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=1 ttl=52 time=43.5 ms
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=2 ttl=52 time=41.3 ms
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=3 ttl=52 time=44.9 ms
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=4 ttl=52 time=45.6 ms
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=5 ttl=52 time=48.8 ms
^C
--- www.orangepi.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms rtt min/avg/max/mdev = 41.321/44.864/48.834/2.484 ms

2. The server image connects to WIFI in a graphical way

1) First log in to the linux system, there are the following three ways
a. If the development board is connected with a network cable, you can remotely log in to the Linux system through ssh
b. If the development board is connected to the debugging serial port, you can use the serial port terminal to log in to the linux system (please use MobaXterm for the serial port software, and minicom cannot display the graphical interface)
c. If the development board is connected to the HDMI display, you can log in to the linux system through the terminal displayed on the HDMI

2) Then enter the nmtui command in the command line to open the wifi connection interface

orangepi@orangepi:~$ nmtui

3) Enter the nmtui command to open the interface as shown below

Pi-5-details-pic61.png

4) Select Activate a connect and press Enter

Pi-5-details-pic62.png

5) Then you can see all the searched WIFI hotspots

Pi-5-details-pic63.png

6) Select the WIFI hotspot you want to connect to, then use the Tab key to position the cursor on Activate and press Enter

Pi-5-details-pic64.png

7) Then a dialog box for entering a password will pop up, enter the corresponding password in Password and press Enter to start connecting to WIFI

Pi-5-details-pic65.png

8) After the WIFI connection is successful, a "*" will be displayed in front of the connected WIFI name

Pi-5-details-pic66.png

9) You can view the IP address of wifi through the ip addr show wlan0 command

orangepi@orangepi:~$ ip addr show wlan0

11: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 24:8c:d3:aa:76:bb brd ff:ff:ff:ff:ff:ff
inet 192.168.1.11/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0 valid_lft 259069sec preferred_lft 259069sec
inet6 240e:3b7:3240:c4a0:c401:a445:5002:ccdd/64 scope global dynamic noprefixroute
valid_lft 259071sec preferred_lft 172671sec
inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute valid_lft forever preferred_lft forever

10) Use the ping command to test the connectivity of the wifi network, and the ping command can be interrupted through the shortcut key Ctrl+C

orangepi@orangepi:~$ ping www.orangepi.org -I wlan0

PING www.orangepi.org (182.92.236.130) from 192.168.1.49 wlan0: 56(84) bytes of data.
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=1 ttl=52 time=43.5 ms
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=2 ttl=52 time=41.3 ms
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=3 ttl=52 time=44.9 ms
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=4 ttl=52 time=45.6 ms
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=5 ttl=52 time=48.8 ms
^C
--- www.orangepi.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms rtt min/avg/max/mdev = 41.321/44.864/48.834/2.484 ms

3. Test method of desktop image

1) Click the network configuration icon in the upper right corner of the desktop (please do not connect the network cable when testing WIFI)

Pi-5-details-pic67.png

2) Click More networks in the pop-up drop-down box to see all scanned WIFI hotspots, and then select the WIFI hotspot you want to connect to

Pi-5-details-pic68.png

3) Then enter the password of the WIFI hotspot, and then click Connect to start connecting to WIFI

Pi-5-details-pic69.png

4) After connecting to WIFI, you can open the browser to check whether you can access the Internet. The entrance of the browser is shown in the figure below

Pi-5-details-pic70.png

5) If you can open other web pages after opening the browser, it means that the WIFI connection is normal

Pi-5-details-pic71.png