How to Connect Raspberry Pi 4 with Mobile Hotspot?
Assuming that you have burnt your raspberry pi 4 with Raspbain Buster Operating System, follow the steps given below to complete the setup. If you don't know how to install the raspberry pi operating system then follow the link given below to install the raspberry pi operating system.
Setup the Hotspot in the Mobile Phone/Smartphone
First set up the mobile hotspot on your smartphone. In order to set up the smartphone hotspot, follow the steps given below.
- Click on your mobile phone Setting
- Select the Connections
- Select the Mobile Hotspot and Tethering
- Select the Mobile Hotspot and turn on the Mobile Hotspot. Then in order to know the hotspot name and password click on the Mobile Hotspot.
Note down the mobile hotspot name and password. For example,
Hotspot Name: your_hotspot_name
Password: hotspot_password
Source: https://www.raspberrypi.org/products/raspberry-pi-4-model-b/ |
Configure the Setting in your Raspberry Pi Operating System.
Now in order to configure the setting on your raspberry pi, make sure you have the following things.
Requirements:
- Memory Card Reader
- Laptop / Personal Computer(PC)
- Text Editor(Any text editor of your choice)
Now take out the memory card from the raspberry pi 4 and insert it into the card reader. Insert your card reader into your laptop or PC. There you will find two partitions or directory called boot and root. In order to connect your raspberry pi to the mobile hotspot in boot time, create the file called wpa_supplicant.conf. Inside this file write the following line of code.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
ssid="your_hotspot_name"
psk="hotspot_password"
key_mgmt=WPA-PSK
}
Alternative:
Another way to configure the wifi connection in your raspberry pi 4 is that instead of creating wpa_supplicant.conf file in boot directory, you can go to the root folder. Then inside root directory, navigate to, etc directory then again navigate to wpa_supplicant directory. There you will find wpa_supplicant.conf file.
File Location: root/etc/wpa_supplicant/
Inside that file add this line of code at the end.
network={
ssid="your_hotspot_name"
psk="hotspot_password"
key_mgmt=WPA-PSK
}
If wpa_supplicant.conf is not present then create one. Inside the file write the following line of code.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
ssid="your_hotspot_name"
psk="hotspot_password"
key_mgmt=WPA-PSK
}
Now make sure that your laptop or PC is connected to your mobile hotspot and use any software for scanning the IP address of your raspberry pi 4. For example, Advance IP Scanner for Windows Operating System and Angry IP Scanner for Linux. Once you know the IP address of your raspberry pi 4, use any method to connect to your raspberry pi 4.
Now make sure that your laptop or PC is connected to your mobile hotspot and use any software for scanning the IP address of your raspberry pi 4. For example, Advance IP Scanner for Windows Operating System and Angry IP Scanner for Linux. Once you know the IP address of your raspberry pi 4, use any method to connect to your raspberry pi 4.
Note: In case if you haven't access your raspberry pi even once, then make sure you create one ssh file without any extension inside the boot directory. So that you can ssh your raspberry pi through ssh.