Installing OpenWrt on old Raspberry Pi 2 B v1.1, old hardware puts me in a catch-22 where I can't instal drivers

I am attempting to install OpenWRT on a Raspberry Pi 2 B v1.1. I have at my disposal a monitor, USB keyboard, windows laptop for ssh access, an ethernet connection (but only one ethernet port), and the ubiquitous Edimax brand USB WiFi adaptor. The problem is as follows:

The pi doesn't have WiFi built in, as it is a version that doesn't have that feature. I cannot use an Edimax USB WiFi adapter to connect it, as the drivers for it are not installed. to install the drivers i need to connect to the internet. Attempting to connect to my router via the ethernet port fails. I searched for solutions to these issues, and all of them suggest running opkg update. I cannot do this, as there is no connection over which to download the files. I cannot get a newer pi due to a stock shortage and price scalpers.

So you can see my issue: I have essentially, due to hardware limitations, been caught in a catch-22. I am very new to networking, so please explain any solutions as if I was 5.

Then you need local console access / serial console.

The pi has a uart, connect and configure via serial, setting the Ethernet as wan and then install the packages you need via opkg

2 Likes

Im not sure I understand what you are suggesting I do. how exactly does one connect in that manner? (i wasn't exaggerating when i said I'm very new to all this.)

First make sure you get the correct image of Openwrt on to the Pi2's sd card. Put the sd card in and power on the PI. Then connect your PC to the Pi and follow this to set it as a DHCP client. Ignore the fixed IP instructions for now, but you will use them later. After you do this you can connect the PI to the router and then connect to it via SSH with it's new IP address that it received from the router. Then you can install packages etc with internet. When you're done setting up the Pi you can set the fixed IP for it again with the instructions from the link so that you can connect clients via the ethernet port.

If you don't like this method you can still figure out how to use serial console as other's have said or add a usb ethernet adapter as suggested below me.

Be aware that alle RPis below the RPi4 are limited by their USB 2.0 based system bus, meaning they are not suited to be run as router for faster WAN speeds. Adding a USB network card (~10 bucks for a USB 2.0 one, as your RPi2 doesn't have USB3 ports anyways) would significantly ease your initial setup, otherwise you would need a managed switch to differentiate between WAN and LAN.

1 Like

To connect a serial console you need a usb 3.3 volt uart adapter, a very useful device for working with embedded hardware.

Serial pin out is included in the openwrt raspberry pi page

So let me see if i understand you correctly:
I need to buy and install a usb 3.3 volt uart adapter, then connect to it via serial to my computer?

would you mind giving me some steps to follow? Once I go through those i can look into learning more about this.

Using the local keyboard and screen, run vi /etc/config/network. There are guides to more advanced use of vi on the Internet, but basically all you need to know is:

  • Type an i first off
  • use the arrow keys to move around, you can type in new text, and backspace to erase stuff
  • when finished, press esc then w and q

Now in the file, erase eth0 from the block that creates a bridge named br-lan. Then make a new block:

config interface 'wan'
    option proto 'dhcp'
    option device 'eth0'

Write and quit to get back to the command prompt. Plug the Ethernet port into your home LAN. Then run /etc/init.d/network restart and Internet access should be possible. You can install packages. Once you have the USB to Ethernet converter driver installed, edit /etc/config/network and add eth1 (which will be the USB converter) to the lan bridge where you removed eth0. Then you can connect a PC to eth1 and access the GUI, and be routed to the Internet*

  • If your home lan uses 192.168.1.X, you'll need to change the OpenWrt LAN IP to something outside that range such as 192.168.2.1 for routing to the Internet to work.

Okay, I have internet, but cannot run opkg update. I'm getting an error like wget returned 5. at least its different from the previous error code.

One other thing I should mention: the laptop has no Ethernet port. I've been using a USB to Ethernet converter to connect from the Ethernet port of the pi to the USB port of the laptop.

The usb side connects to your computer, the pi has a serial interface built in.

Search for cp2102 on eBay, that will give you some options

ah, so i should connect that usb thing to the serial? great. quick question: where's the serial? is that the same as the GPIO?

It’s three pins of the gpio, details in the page I linked above

An easy solution would be to go to the custom image builder and build an openwrt image with the edimax drivers preinstalled.

2 Likes

would I also be able to install some other services I'm planning on implementing using the image builder? because that would save me some time.
EDIT: what version would be best for me to use, such that im able to install things like tor, pihole, unbound, etc, while being compatible with my older Pi?

Well to get pihole you will need docker. I’d expect that to bring the pi 2 to its knees, beyond adding other services.

Adblock home would be lighter, but still a lot for a pi2.

Adding more services on top is a big ask, unless the internet speed is very low and so is usage?

Get a cheap x86 box and have the headroom to do anything you want. A thin client for instance.

alright. Ive linked the pins just like you told me to. what exactly does this allow me to do? and how do i do it?

Use up to step 3 of this tutorial.

If your pc is windows rather Linux you will need a terminal emulator, such as putty or teraterm

the tutorial says i need to be running Raspbian. currently i have openWrt installed. will it still work? or do the changes carry over if i use raspbian then switch to OpenWrt after?

Openwrt is fine, it is setup with serial access

as in it already has it enabled?