5

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.

Big Bird
  • 85
  • 1
  • 8
  • 1
    You seem to be unclear whether you want an Access Point (**WHY?**) or connect to a router or what you expect to do with the resultant. See [How to set up networking/WiFi](https://raspberrypi.stackexchange.com/a/37921/8697) to setup networking - there are dozens of Access Point tutorials, so it seems futile to point to one which you claim doesn't work. – Milliways Jan 06 '20 at 04:31
  • 1
    "*I do not want to use a secondary router; just using the wireless capabilities of the 4B.*" By this section, you mean that you don't have any wireless devices and you want to create an AP for your wireless clients. || Although by this part, "*The 4B would connect to a wifi network wirelessly, then I would connect the Pi network.*", I realized that you want to make Raspberry Pi as a wireless bridge device. || Please make it clear. – M. Rostami Jan 06 '20 at 12:41
  • 1
    As already stated, the question is unclear. Title suggests that you want the RPi to provide a Wireless Access Point. Question says that you want the RPi to connect to a Wifi Access point. Please clarify. – Charemer Jan 06 '20 at 15:13
  • 1
    Edit: I clarified the question – Big Bird Jan 06 '20 at 16:05
  • 1
    I think you search for `SoftAp mode`. You have two interfaces on wlan0, one in managed (client) type `managed` and one in master (AP) type `__ap`. Connect your managed interface to your router. Use master interface for `hostpad` and your own Wi-Fi Access Point. (Not tested on RPi4) – Ephemeral Jan 06 '20 at 16:12
  • HUGE UPDATE: Open Vwr DOES support the pi 4 officially, but from my knowledge, it will only support it in Chinese. I highly recomend watching this video on how to set it up. (https://www.youtube.com/watch?v=Q6bAZ0QZC90). Please correct me if i am wrong, because currently, translating is tedious. Thanks to @M. Rostami for telling me to use Open Vwr in the first place. You are very appreciated. – Big Bird Jan 09 '20 at 01:35
  • @BigBird My pleasure. I've updated the answer. It's not Chinese. – M. Rostami Jan 09 '20 at 20:38

2 Answers2

3

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:

enter image description here

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  
M. Rostami
  • 4,235
  • 1
  • 15
  • 34
  • 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 Jan 07 '20 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 like `192.168.1.x`. (the `x` can be a number between `2` to `254` 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. – M. Rostami Jan 07 '20 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 put `192.168.1.1` on the computer's web browser to open LuCi web interface which is the Raspberry Pi (OpenWrt) configuration environment. – M. Rostami Jan 07 '20 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 Jan 07 '20 at 15:30
  • Oh and which folder to i put rpi-2-ext4-factory.img.gz in? – Big Bird Jan 07 '20 at 15:37
  • Extract the "rpi-2-ext4-factory.img.gz" and by that, you'll have a "rpi-2-ext4-factory.img". So, add this file to Win32DiskImager and hit the write button. Wait till the finished message appear. Finally, put the SD-Card to the Raspberry Pi. – M. Rostami Jan 07 '20 at 17:08
  • The radio0/WLAN is in a particular section. There is one of them on the configuration interface. Never mind, it's not essential. – M. Rostami Jan 07 '20 at 17:09
  • So i started up OpenWrt and typed in `uci set network.lan.ipaddr : 192.168.1.2`,`uci commit`, and `reboot -f` to make the ip address more identifiable. However, when i typed in http://192.168.1.2, it says that it refused to connect. I tried this on Chrome and on Opera. Any help? – Big Bird Jan 08 '20 at 03:48
  • What was your computer IP address? Did you set that `192.168.2.1`? – M. Rostami Jan 08 '20 at 07:57
  • i tried the updated version but luci wouldnt open. – Big Bird Jan 09 '20 at 21:00
  • @BigBird As I said, its snapshot builds. Therefore, you need to connect to the RPi by `SSH` and install the LuCi. **1.** `opkg update` - **2.** `opkg install luci`. – M. Rostami Jan 09 '20 at 21:04
2

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.

Ingo
  • 40,606
  • 15
  • 76
  • 189