Wireless RasberryPi OpenWRT AP - Deathraymind/StemLabMK2 GitHub Wiki

Materials Needed:

  • RaspberryPi
  • RaspberryPi Power Cable or USB to USB Mini
  • MicroSD Card
  • MicroSD Card Reader
  • Ethernet Cable
  • Laptop
  • Internet Connection

Download:

  1. Insert MircoSD card into MicroSD Card Reader
  2. Insert Card Reader into computer
  3. Open up your browser and go to https://openwrt.org/toh/raspberry_pi_foundation/raspberry_pi
  4. Install the OpenWRT image that matches your Pi
  5. Install RaspberryPi Imager
  6. Next click on "Choose Device" and select the RaspberryPi your are using
  7. Next click on "Choose OS"
  8. Select "Use Custom" and select the OpenWRT image you recently installed
  9. Afterwards select "Choose Storage" and select your microSD card
  10. Finally, select "Write"
  11. Once downloading is completed, remove microSD reader and mircoSDD card
  12. Insert SD card into RaspberryPi and power it on

SSHing:

  1. Use an Ethernet cable to connect your device to the RaspberryPi
  2. Configure your Ethernet adapter to have a static address of "192.168.1.10" ~ If on Windows, this can be done through the Control Panel
  3. Open up your terminal and SSH into the RaspberryPi ~ On Windows: "ssh [email protected]"

*If ssh did not work, then ensure that you have installed it. Else install PuTTY

Configurations:

  1. Type: "cd /etc/config"
  2. Afterwards type: "cp firewall firewall.bk"

*This makes a backup of the default firewall configs 3) Do it again with network & wireless: "cp network network.bk" and "cp wireless wireless.bk" 4) Configure the network file: "vi network" 5) Configure lan interface: " config interface 'lan' option device 'br-lan' option proto 'static' option ipaddr '192.168.84.1' option netmask '255.255.255.0' option ip6assign '60' option force_link '1' "

*The ipaddr field can be any private ip address

  1. Create wwan interface:

" config interface 'wwan' option proto 'dhcp' option peerdns '0' option dns '8.8.8.8' "

  1. Exit and save with: "ctrl+c" and ":wq"

Firewall Configurations:

  1. Type: "vi firewall"
  2. Go to "config zone" with option name "wan"
  3. Configure "option input" to "ACCEPT"
  4. Exit and save with: ctrl+c and :wq
  5. Reboot device: "reboot"
  6. Lastly, set your Ethernet adapter to automatically be assign an IP address (DHCP)

Wireless Configurations:

  1. SSH into your RaspberryPi
  2. Configure wireless with "vi /etc/config/wireless"
  3. Set "channel" to '7'
  4. Set "band" to '5g'
  5. Insert "option short_gi_40 '0'" at the end of "config wifi-device 'radio0'"
  6. Finally set "option disable" to '0'
  7. Exit and save with: ctrl+c and :wq
  8. Type "uci commit wireless"
  9. Lastly, type "wifi"

* If you configure it properly nothing should pop up when "wifi" is entered

Internet Configuration Through the GUI:

  1. Open up your browser and type the IP address of your RaspberryPi
  2. Login into OpenWRT
  3. Click on "Network" and then "Wireless"
  4. Next click on "Scan"
  5. Select the network you wish to recieve your internet connection from
  6. Then check the box that says "Replace wireless configurations" and enter the password of the network you're joining
  7. Scroll to the bottom of the screen and click "Save"
  8. Lastly, click "Save and Apply"

USB to Wireless Adapter Configuration:

  1. SSH into your RaspberryPi
  2. Type "opkg update"

* If the command fail then type "reboot" and SSH again into the device

  1. Next copy and paste this command: "opkg install kmod-rt2800-lib kmod-rt2800-usb kmod-rt2x00-lib kmod-rt2x00-usb kmod-usb-core kmod-usb-uhci kmod-usb-ohci kmod-usb2 usbutils openvpn-openssl luci-app-openvpn nano"
  2. Insert your USB to Wireless Adapter into your RaspberryPi
  3. Type: "usbls" to confirm that your RaspberryPi can see your wireless adapter 6)Type: "ifconfig wlan1 up"

* If using a Linksys WUSB6300 use: "opkg install kmod-rtl8812au-ct"

Wireless LAN GUI Configurations:

  1. Login into OpenWRT through your browser
  2. Go to "Network" then "Wireless"
  3. You should see that a new radio device was added and SSID
  4. Configure SSID and password
  5. Select enable
  6. Save and Apply