Last Issue Review:
Getting Started with Raspberry Pi 3+
Raspberry Pi 3+ Tools for Success
Bluetooth Configuration and Testing with Raspberry Pi 3+
Painful Experience with Windows 10 IoT on Raspberry Pi 3+
For friends who travel frequently, hotel WiFi issues are often a hassle. Hotel WiFi signals are weak, insecure, slow, and often disconnect. Alternatively, the configuration may be poor, unable to support a certain number of clients, and often cannot obtain an IP address. In this case, a portable WiFi can help you.
A portable WiFi allows you to share a wired network via WiFi, creating a temporary wireless local area network that connects to the internet. On this basis, a WiFi hotspot network is established for one or more wireless internet terminals, facilitating mobile office work and providing internet access for business trips and travel. The portable WiFi is secure as it is a private wireless network for the user, avoiding the risks of information leakage from using public WiFi. Moreover, it is easy to operate, requiring no setup and can be used immediately upon powering on. Below, I will guide you step by step to turn your Raspberry Pi into a portable WiFi.
There are many ways to convert Raspberry Pi 3 into a portable WiFi. I mainly use two methods: bridge mode and building a router based on openWrt.
First, we will implement bridge mode, which requires installing some third-party software, with the core software being Hostapd. Hostapd is an open-source project, a user-space daemon for wireless access points (AP) and authentication servers. Hostapd implements IEEE802.11 AP management, IEEE802.1X/WPA/WPA2/EAP authentication, RADIUS client, EAP server, and RADIUS authorization server, supporting Linux system host AP, madwifi, and mac80211-based drivers. 1. Install the required programs: sudo apt-get install hostapd udhcpd
sudo apt-get install bridge-utils
2. Configure the network card by editing the network configuration file: sudo vim /etc/network/interfaces
Comment out all configurations related to the wireless network card, as shown below: #allow-hotplug wlan0#iface wlan0 inet manual# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf#allow-hotplug wlan1#iface wlan0 inet manual# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Add the bridge configuration to the file: auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan0
The final configuration mainly consists of the following parts: // Loopback network configuration auto lo
iface lo inet loopback
// Wired network card configuration iface eth0 inet dhcp
# Bridge configuration auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan0
3. Configure hostapd sudo vim /etc/hostapd/hostapd.conf
Configuration information as follows: interface=wlan0
driver=nl80211
bridge=br0
ssid=Raspberry_AP
channel=1
wmm_enabled=0
wpa=1
wpa_passphrase=testforap
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0
ssid=Raspberry_AP
Set the AP’s SSID and wpa_passphrase=testforap
to set the password for connecting to the AP as testforap
, then save the configuration file.
4. Restart and test hostapd sudo reboot
After rebooting, use the following command to test if hostapd is working properly: sudo hostapd -dd /etc/hostapd/hostapd.conf
If there are no errors, the mobile device should be able to search for the configured wireless AP. Then press Ctrl+C
to exit this test.
Once the previous steps are successfully completed, the last step is to set the path of the hostapd configuration file. sudo vim /etc/default/hostapd
Remove the comment symbol #
from the line DAEMON_CONF
, and change it to our configuration file path: DAEMON_CONF="/etc/hostapd/hostapd.conf"
Add hostapd to startup sudo update-rc.d hostapd enable
5. Restart and test hostapd Restart the hostapd service sudo service hostapd restart
Open the mobile WiFi, search and connect to Raspberry_AP
.
Access EEworld in the mobile browser.
The configuration process for bridge mode is quite simple. Next, I will introduce how to use openwrt to build a more powerful wireless router.
Welcome to click to read the original text and communicate with the author.
Follow EEWORLD (Electronic Engineering World) WeChat public account: reply “Submission”, your original work will have a chance to appear in our WeChat push.
To communicate with more industry peers, please click to read the original text to login to EEWORLD forum.
WeChat ID: EEWORLD Forum Activities E Master in Hand Follow EEWORLD Service Account EE Benefits At Your Fingertips
WeChat ID: EEXINRUI Chip Information Sharp Interpretation
Leave a Comment
Your email address will not be published. Required fields are marked *