Page MenuHomePhabricator

Document setup for running a throttled wifi on a pi 4
Closed, DeclinedPublic

Description

Let us both write down how to install a fresh pi 4. I'll document how to do it on a Mac and you @dpifke on Linux.

I've started but stalled on ssh to the device, let continue tomorrow and document how I am and then when we are finished move it to wiki tech page.

Event Timeline

@dpifke I started again today and tried with the default Raspberry Pi OS just to make it easy. This is how I did it on a Mac:

  1. Install Raspberry Pi OS using Raspberry Pi Imager (following https://www.raspberrypi.org/software/)
  2. Then adding a empty file named ssh on the root portion of the memory card to enable ssh.
  3. I inserted the card in the Raspberry Pi and hooked up my Mac with a network cable to the pi and started the device.
  4. SSH to the device ssh pi@raspberrypi.local (see https://www.raspberrypi.org/documentation/remote-access/ssh/README.md)
  5. Enable wifi: sudo rfkill unblock 0 and then follow the instructions in https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md (using raspi-config)
  6. Install missing dependencies: sudo apt-get install dnsmasq hostapd -y
  7. Download and made the script executable: https://gerrit.wikimedia.org/r/c/performance/network-emulator/+/596327

Then when I run it I get:

sudo ./network-emulator.sh -d 1mbit -u 1mbit -s 100 test
+ /sbin/iw phy phy0 interface add wlan1 type managed
command failed: Device or resource busy (-16)

We may need to modify step 5, or there may be something else installed by default which is causing a conflict..

My Pi 4 is supposed to arrive tomorrow; once it does, I'll set up an identical config and do some troubleshooting.

Yes, maybe I need to get a keyboard and a screen, at the moment I'm limited to get the wifi working to be able to install things, but maybe I can just turn it off.

I was able to get USB networking working by doing the following:

Add the following line to /boot/config.txt:

dtoverlay=dwc2

Add the following to the end of the line in /boot/cmdline.txt (after rootwait):

modules-load=dwc2,g_ether

You can do this either by editing the files on the SD card on a separate computer, or after logging on to the Pi.

After the next boot, a network interface will show up on the host computer via the USB-C cable, connected to the Pi's usb0 interface. On my laptop I started a DHCP daemon on that interface and was able to use it to SSH in and connect to the internet out. (Presumably there's a way to make this work on a Mac as well as on Linux.)

After disabling the default wlan0 configuration, I'm still having some issues putting it into AP mode. I'll be able to do more troubleshooting on this tomorrow.

Assigning over to you Dave!