Seeed Studio Raspberry Pi Router Board OpenWRT Software Guide

Operating System

If you are using Raspberry Pi OS.
Open a terminal and Download demo code from:
Run example Demo:
The CM4 router board is compatible with most systems that support Raspberry Pi 4, but most Linux distributions do not optimize the network device scenarios. So OpenWRT and Raspberry Pi OS are recommended.

For Raspberry Pi OS

1. Enable USB2.0 Port: After flash the latest image file to TF card and then modify /boot/config.txt file and add following line to the file.
Save it and reboot Raspberry Pi.
2. Enable OLED onboard:
2.1 Enable I2C function, Open a terminal and typing:
sudo raspi-config
Navigate to `Interface Options` -> `I2C` -> `Enable` -> `YES`.
2.2 Download libaraies from github:
[ https://github.com/adafruit/Adafruit_Python_SSD1306 ]
sudo python -m pip install --upgrade pip setuptools wheel git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git cd Adafruit_Python_SSD1306 sudo python setup.py install pip install Adafruit-BBIO
cd examples/ python stats.py

For Using OpenWRT

OpenWRT official snapshot version
Card Reader
Etcher
7-Zip Compressed File Manager
OS image file
The official snapshot is the smallest system, using serial terminal control, you need to manually install the Web console, driver, etc. it is recommended for experienced users.
OpenWRT official website: [ https://openwrt.org/ ]
OpenWRT Develop Guide: [ https://openwrt.org/docs/guide-developer/source-code/start ]
OpenWRT User Guide: [ https://openwrt.org/docs/guide-user/start ]
OpenWRT forum: [ https://openwrt.org/contact#forum ]
OpenWRT on Raspberry Pi CM4: [ https://openwrt.org/toh/hwdata/raspberry_pi_foundation/raspberry_pi_foundation
_raspberry_pi_cm4 ]
OpenWRT Raspberry Pi Foundation: [ https://openwrt.org/toh/raspberry_pi_foundation/raspberry_pi ]
OpenWRT Use BuildSystem: [ https://openwrt.org/docs/guide-developer/build-system/use-buildsystem ]
OpenWRT Build-System: [ https://openwrt.org/docs/guide-developer/build-system/install-buildsystem ]

SD Card Installation

Suitable for Compute Module 4 Lite without eMMC version.
1. Requirements
Flash the image file to MicroSD card by using etcher imaging tool.

Build OpenWRT Customized Firmware

You can build your own firmware by building OpenWRT from source.
1.Prepare Compile Environment
Insert the microSD card or TF card into card slot on CM4 Router Board.
Connect the power supply(5V/3A) on USB-C port.
After booting up the system, please connect to internet and typing following
Install dependencies packages:
After installing, please reboot your Raspberry Pi CM4 by typing:
Create a folder and download OpenWRT source code by using git tool:
Flash the latest version of Raspberry Pi OS to TF card(32GB recommended).
Modify /boot/config.txt file and adding the following parameter to enable the USB port function:
command in a terminal:
sudo apt-get update sudo apt-get -y upgrade
sudo apt-get -y install build-essential asciidoc binutils bzip2 libncurses5-dev flex git-core p7zip p7zip-full sudo apt-get -y install libssl-dev libelf-dev autoconf automake libtool device-tree-compiler gettext libi2c-dev sudo apt-get -y install libz-dev texinfo
sudo sync && sudo reboot
mkdir openwrt && cd openwrt git clone --depth=1 https://github.com/openwrt/openwrt cd openwrt/ ./scripts/feeds update -a
./scripts/feeds install -a
Download `luci-app-oled` libraries.
cd ~/openwrt/openwrt/package/feeds/luci/ git clone https://github.com/NateLol/luci-app-oled.git cd ~/openwrt/openwrt/ ./scripts/feeds update -a ./scripts/feeds install -a ** Configure the compile options by typing: <pre> make menuconfig
And then select "Target System" and "Target Profile" as following picture:
Navigate to `kernel modules` and select `kmod-i2c-xxx` as following picutres:
And then navigate to `USB Support` to add usb2 and usb3 support.
And then select `coreutils` in `Utilites` menu.
and enable `libi2c` in `libraries` menu.
Next step is to enable LuCI `Collections` and `applications`.
Navigate to `Applications` -> `luci-app-oled` and check it:
Save the configuration to `.config` file
Compile it with following command:
Firmware will be generated on location:
Factory image file: openwrt-bcm27xx-bcm2711-rpi-4-ext4-factory.img.gz or
make V=s -j1
It may take a while, grap a cup of coffee.
~/openwrt/openwrt/bin/targets/bcm27xx/
openwrt-bcm27xx-bcm2711-rpi-4-squashfs-factory.img.gz
Sysupgrade image file:
openwrt-bcm27xx-bcm2711-rpi-4-ext4-sysupgrade.img.gz or
Flash the facotory image file to TF card via using `etcher` tool and insert the
After booting, please connect your PC or just using Raspberry Pi to the
Account: root
Password is not set. please change the password once you login.
Modify `/boot/config.txt` file and add this line:
Change the Permission of `/etc/init.d/oled` file:
After reboot, try to test if it can detect the oled's address `0x3C`
openwrt-bcm27xx-bcm2711-rpi-4-squashfs-sysupgrade.img.gz
TF card to CM4_router_board, connect the 5V power supply.
ethernet cable on CM4 Router Board in `port0` or `port1`, and then open a browser, and typing administration address:
192.168.1.1

Enable I2C device in Customized OpenWRT

dtoverlay=i2c-gpio,i2c_gpio_sda=2,i2c_gpio_scl=3,i2c_gpio_delay_us=2,bus=1
Save it and reboot Raspberry Pi CM4 Router Board.
chmod 755 /etc/init.d/oled /etc/init.d/oled restart reboot
Login to LuCI interface via browser and enable it, and then you can find the
OLED in `service` tab, you can configure it as the notifications.
Check the checkbox on `enable` and click `save it and apply`.
Loading...