In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to configure AP hotspots on the development board in Android". In daily operation, I believe many people have doubts about how to configure AP hotspots on the development board in Android. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "how to configure AP hotspots on the development board in Android". Next, please follow the editor to study!
The development board connects the power supply and the debug serial port, then opens the debug serial port terminal, then powers on the development board and waits for the system to start up, as shown in figure 99.6.1:
Then insert the U disk made in Chapter 5 into the USB interface of the development board, and you can see that the serial port prints out the information of the USB device, as shown in figure 99.6.2:
When we enter the "df" command in the debug serial port terminal, we can see the mount directory of the U disk. The running result is shown in figure 99.6.3:
Next, we enter the "cd / run/media/sda1/hostap" command on the debug serial terminal and enter the "hostap" folder we created in Chapter 5, as shown in figure 99.6.4:
When we enter the "ls" command, we can see the file copied in Chapter 5, as shown in figure 99.6.5:
Then we use the cp command to copy "lib_nl.tar.gz" and "openssl.tar.gz" to the "/ usr/lib" directory of the system directory, and the result is shown in figure 99.6.6:
Then we use the "cd / usr/lib" command to go to the "/ usr/lib" directory, as shown in figure 99.6.7:
Then enter the "tar-xvf lib_nl.tar.gz" and "tar-xvf openssl.tar.gz" commands to extract the libnl and openssll library files to the current directory (as I am using the yocto file system here, the libnl and openssll library files have been installed in the system, so I will not extract them, if you use other file systems, you need to extract them here).
Then go back to the directory of the USB disk and copy "hostapd.conf", "udhcpd.conf" and "udhcpd.leases" to the system's "/ etc" directory, as shown in figure 99.6.8:
The hostapd.conf file is the network name and password that sets the AP hotspot, and its contents are as follows:
Ctrl_interface=/var/run/hostapd
Interface=wlan0
Driver=nl80211
Ssid=Topeet_TEST
Channel=1
Macaddr_acl=0
Auth_algs=1
Hw_mode=g
Ignore_broadcast_ssid=0
Wpa=2
Wpa_passphrase=123456780
Wpa_key_mgmt=WPA-PSK
Wpa_pairwise=TKIP
Rsn_pairwise=CCMP
The above ssid is the name of the wifi (Topeet_test), and wpa_passphrase is the password of the wifi (1234567890).
The udhcpd.conf file configures dhcp and contains the following:
Start 192.168.0.2
End 192.168.0.100
Interface wlan0
Max_leases 20 # default: 254
Remaining yes # default: yes
Auto_time 7200
Decline_time 3600
Conflict_time 3600
Offer_time 60
Min_lease 60
Lease_file / etc/udhcpd.leases
Opt dns 10.221.0.11 8.8.8.8
Option subnet 255.255.255.0
Opt router 192.168.0.1
Start and end specify the IP address range assigned by wifi (192.168.0.2-192.168.0.100). You can check the other parameters online, so we won't elaborate on them here.
Then copy "hostapd" to the system's "/ usr/sbin" directory, as shown in figure 99.6.9:
Since the yocto file system uses the rfkill command to manage wifi and Bluetooth, we first enter "rfkill unblock wifi" in the debug serial port terminal to open wifi (if you are not using a yocto file system, you can ignore the next step). The running result is shown in figure 99.6.10:
Then enter the "ifconfig wlan0 192.168.0.1 up" command on the debug serial port, configure ip for wlan0, and enable wlan, as shown in figure 99.6.11:
Then enter "hostapd-B / etc/hostapd.conf-dd" in the debug serial port to start the AP hotspot, and the running result is shown in figure 99.6.12:
Then enter "udhcpd-fS / etc/udhcpd.conf &" in the debug serial port to enable the dhcp server service (udhcpd is provided by default in busybox when we create the file system. If you do not have this program in your file system, you can reconfigure busybox or migrate the udhcpd program separately. The specific migration steps are not described here). The running result is shown in figure 99.6.13:
At this point, the AP hotspot function has been enabled. We can enter "ps-el" in the debug serial port to view all processes. We can see the hostapd and udkcpd processes running in the background, as shown in figure 99.6.14:
Then we can scan the wifi using our mobile phone or notebook. We can find the "Topeet_TEST" network, connect to the wifi network, enter the password "123456780", and finally connect to the "Topeet_TEST" network. At the same time, when we debug the serial port, we will see the ip address "192.168.0.2" assigned to our mobile phone by dhcp, as shown in figure 99.6.15:
At this point, the study on "how to configure AP hotspots on the development board in Android" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.