I want my Raspberry Pi 4B to create a wireless network that connects to my router, without using any external devices to assist the pi (ie. a secondary router or an antennae that would connect to the pi).
The 4B would connect to a wifi network wirelessly, then I would connect the Pi network. Most tutorials are about the 3 and do not work when I try them. Note that I am a pi beginner, and this is my first project.
2 Answers 2
OpenWrt is the best choice for you. It makes Raspberry Pi to a wireless router device and you don't need to run a lot of commands. Easy to use with an interactive web user interface named LuCi like picture below:
I believe it going to help you better than in other ways.
The thing you should concern is that you should don't attend this page. As this page, OpenWrt is not on the supported list, however, you can install the bcm2709
by this link - Index of (root) / snapshots / targets / brcm2708 / bcm2709. Download rpi-2-ext4-factory.img.gz
and write the image on a larger 256MB SD-Card.
The default IP is 192.168.1.1
and the DHCP server is disabled therefore add and static IP address to the host you want to configure RPi (such as 192.168.1.100
), the default user is root
and leave the password section blank.
Go to Network/Wireless
then turn radio0
or WLAN on.
As I mentioned, it's easy to configure OpenWrt and you can configure it any way you want.
UPDATE:
Raspberry Pi 4 sources provided by the Raspberry Pi Foundation are Linux>= 4.19.
OpenWrt 18.06 is based on Linux 4.9 and OpenWrt 19.07 is based on Linux 4.14, so you need to use the snapshots builds, which are based on Linux 4.19:
https://downloads.openwrt.org/snapshots/targets/brcm2708/bcm2711/
Download rpi-4-ext4-factory.img.gz
and write the image to the SD-Card.
UPDATE 02:
Snapshot builds do not include the web interface, the LuCi package. Therefore, follow the procedure:
1. Connect to the Raspberry Pi's terminal via SSH
.
2. Update package list of OpenWrt:
opkg update
3. Install LuCi package which is the web interface configuration mode:
opkg install luci
-
Just making sure im doing this right. 1. installing only rpi-2-ext4-factory.img.gz on my computer. 2. putting it on my pi sd card? 3. add my static ip to OpenWrt. 4. Turn radio0 or WLAN on. 3. I want to start it on startup, so i would use autostart to configure it to start automatically. How do i know if i want to turn on radi0 or WLAN? And do you mean the router ip of the pi is 192.168.1.1?Big Bird– Big Bird2020年01月07日 14:48:00 +00:00Commented Jan 7, 2020 at 14:48
-
1-2. Yes, Write
rpi-2-ext4-factory.img.gz
on an SD-Card and put it to your Raspberry Pi 4. || 3. No, change your computer IP address to something like192.168.1.x
. (thex
can be a number between2
to254
like `192.168.1.25). || 4. Yes. || "I want to start it on startup, so I would use autostart to configure it to start automatically." You don't need to change any configuration. It has configured itself.Mohi Rostami– Mohi Rostami2020年01月07日 15:20:27 +00:00Commented Jan 7, 2020 at 15:20 -
|| "How do i know if i want to turn on radi0 or WLAN?" I don't get what you mean. || "do you mean the router ip of the pi is 192.168.1.1?", No, After you put the SD-Card to the Raspberry Pi and turn it on, the Raspberry Pi would be up with
192.168.1.1
IP address, therefore, after you change the computer IP address, you can put192.168.1.1
on the computer's web browser to open LuCi web interface which is the Raspberry Pi (OpenWrt) configuration environment.Mohi Rostami– Mohi Rostami2020年01月07日 15:20:30 +00:00Commented Jan 7, 2020 at 15:20 -
"Go to Network/Wireless then turn radio0 or WLAN on." I wanted to know how i would know which one to turn on. So, Technically i could not use a vpn on my computer because it would change the IP adress (I know how to change my IP adress but I just wanted to confirm i could not use my vpn while connected to my pi.)Big Bird– Big Bird2020年01月07日 15:30:38 +00:00Commented Jan 7, 2020 at 15:30
-
Oh and which folder to i put rpi-2-ext4-factory.img.gz in?Big Bird– Big Bird2020年01月07日 15:37:19 +00:00Commented Jan 7, 2020 at 15:37
As far as I understand you want to have an access point that is connected with a WiFi client connection as uplink to your internet. All tutorials and automated scripts I know that work with the RasPi are made to use a wired uplink to the internet router router but not a wireless one. This is because it isn't an easy task to have a wireless access point and a wireless client uplink with only the on-board WiFi device. But it is possible if you respect a strict order by managing the network interfaces. How to do it you can look at Access point as WiFi router/repeater, optional with bridge. You only need to install hostapd as helper. All other things are built-in and you only have to configure it.
SoftAp mode
. You have two interfaces on wlan0, one in managed (client) typemanaged
and one in master (AP) type__ap
. Connect your managed interface to your router. Use master interface forhostpad
and your own Wi-Fi Access Point. (Not tested on RPi4)