HaLow Integration on Raspberry Pi 5

Hi all,

I wanted to share my recent experience bringing up WiFi HaLow on the Raspberry Pi 5 (Rpi 5). Below is a summary of the overall steps I took, issues encountered, and some tips to help others avoid the same roadblocks.


System Details:

  • OS: Debian GNU/Linux 12 (Bookworm)
  • Kernel: Version 6.6.51
  • HaLow Integration Package: MM610x Software Release Package 1.12.4 (Morse Micro)

Steps Taken:

  1. Setup Environment:
  • Installed necessary toolchains, dependencies, and libraries for cross-compilation.
  • Cloned the MM610x Software Release Package (1.12.4) from the Morse Micro repositories.
  1. Patching the Kernel:
  • Applied necessary kernel patches for S1G (802.11ah) support.
  • Cross-compiled the kernel for the Rpi 5 with Morse-specific options enabled (cryptographic APIs for Hostapd).
  1. Driver and Firmware:
  • Compiled Morse Micro’s morse.ko and dot11ah.ko drivers and installed them into the Rpi 5 rootfs.
  • Loaded firmware and board configuration files for the MM6108-MF08651-US module into Rpi 5 rootfs.
  • Created symbolic links for correct board type firmware.
  1. Device Tree Source Overlays (DTS) Setup:
  • Created device tree overlays for MM6108-MF08651-US module connected via SDIO on the GPIO pins.
  • Due to the new RP1 I/O peripheral, the Rpi 5 is able to have the on-chip WiFi interface (which is now connected directly to the Application Processor of the Rpi 5) as well as a HaLow interface.
  1. Morse Micro Userspace Software Setup:
  • Ensure that necessary dependencies like OpenSSL and libnl are available for cross-compilation.
  • For each utility (wpa_supplicant_s1g, hostapd_s1g, morse_cli), compile the programs with make and install the binaries in the target rootfs.

Bringing Up HaLow:

After compiling and setting up the Morse Micro driver, firmware, DTBOs and user-space software, the next step is to bring up the WiFi HaLow interface:

  1. Verify Installation:
  • Reboot the Rpi 5 and confirm the driver is registered and loading the kernel module parameters, firmware is loaded, and userspace tools are installed. The terminal command dmesg shows this.
  • If all is installed correctly, a new phy and associated network device (wlan1) should be registered with the kernel.
  1. Configuring the Interface:
  • Use ifconfig wlan1 up to bring the HaLow interface online.
  • Confirm that the HaLow interface (wlan1) can scan other HaLow networks using sudo iw dev wlan1 scan | grep SSID.
  1. STA Mode Setup:
  • Create a minimal wpa_supplicant.conf file and start wpa_supplicant_s1g to set up the Rpi 5 as a STA and connect to an AP.
  1. AP Mode Setup:
  • Create a minimal hostapd.conf file and start hostapd_s1g to set up the Rpi 5 as an AP.
  • Set up the AP as a DHCP server; Use the dnsmasq application to assign IP addresses to connected clients.

Final Outcome:

The WiFi HaLow interface is now fully functional on the Raspberry Pi 5, both as a station (STA) and as an access point (AP).

2 Likes

To simplify the setup process for integrating WiFi HaLow on the Raspberry Pi 5, I’ve compiled all necessary components into Debian (.deb) packages. This should make the installation process much smoother, without the need for manual compilation or configuration. Here’s what the .deb packages cover:

Included Debian Packages:

  1. Morse Micro Driver (morse.ko, dot11ah.ko)
  2. Firmware and Board Configuration Files
  3. Device Tree Overlays
  4. User-Space Utilities:
  • wpa_supplicant_s1g
  • hostapd_s1g
  • morse_cli

Patched Linux Kernel (with necessary S1G and cryptographic API support) not included as I did not test it on a fresh Rpi 5.

mm-driver_1.12.4-1.deb (2.9 MB)
mm-firmware_1.12.4-1.deb (202.2 KB)
mm-hostapd_1.12.4-1.deb (2.7 MB)
mm-wpa-supp_1.12.4-1.deb (1.1 MB)
mm-morsecli_1.12.4-1.deb (120.1 KB)
mm-overlays_1.12.4-1.deb (1.6 KB)

3 Likes

@live-love-laugh-wifi thanks for uploading these Debian packages! I’m interested in polishing these further and making them a bit more compatible across kernel versions.

It looks like the driver is targeting a kernel version (6.6.51-v8-16k+) different to the image from Raspberry Pi (RaspiOS Lite, 6.6.31). Can you share any steps you took to align the driver package you compiled and the kernel version?

That kernel version looks a lot like the default version if you check out the default rpi-6.6.y branch from https://github.com/raspberrypi/linux

The stable_20240529 tag seems to coincide with what the imager gives you if you flash a new SD card. (verifying that now)

Hi, first timer to this community but I have to say I love the idea / fact that you’re looking to get the Morse Micro HaLow Wi-Fi working with the Pi 5.

I have tried to follow along using the information above, however I’m unfortunately not having much luck.

Configuration
I am using Pi 5’s (8GB model) with the Morse Micro HaLow board (switched over from the Morse Micro Pi-4B EVK). I have the active cooler in place too.

Issue
When I try and install the various .deb packages through the terminal I am noticing that they appear to be failing. This may be because the first package that I’m trying to install keeps failing (the mm-driver_1.12.4-1.deb file). I’ve attached details below (had to copy the terminal text to a textfile given scrot doesn’t work properly on the Pi 5).

Method
I started with a fresh install of Bookworm (noting I tried the 64-bit lite version, 64-bit full version and 32-bit version), however I get the same issue with both 64-bit versions, and the 32-bit version fails because it identifies that it’s looking for 64-bit :slight_smile: .

  1. List item
  2. I downloaded the .deb packages into the Downloads folder.
  3. I attempted to install the first .deb package (mm-driver_1.12.4-1.deb) using the command sudo apt install ./mm-driver_1.12.4-1.deb and noticed errors.
  4. I attempted to remedy one of the 2 errors (couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)) by changing the file permissions and trying again (see below)
  5. Upon re-trying the sudo apt install ./mm-driver_1.12.4-1.deb I am still receiving an error that appears to be related to a post-installation of the driver.

Terminal Output
I have copied the output displayed within the terminal. I have inserted some blank lines to break up the output to make it a little easier to read.

pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME=“Debian GNU/Linux 12 (bookworm)”
NAME=“Debian GNU/Linux”
VERSION_ID=“12”
VERSION=“12 (bookworm)”
VERSION_CODENAME=bookworm
ID=debian
HOME_URL=“https://www.debian.org/
SUPPORT_URL=“Debian -- User Support
BUG_REPORT_URL= <had to chop this one out as the community system, doesn’t let me include more than 2 links>

pi@raspberrypi:~ $ uname -m
aarch64

pi@raspberrypi:~ $ cd Downloads
pi@raspberrypi:~/Downloads $ ls -l
total 7208
-rw-r–r-- 1 pi pi 3025368 Oct 19 09:38 mm-driver_1.12.4-1.deb
-rw-r–r-- 1 pi pi 207096 Oct 19 09:38 mm-firmware_1.12.4-1.deb
-rw-r–r-- 1 pi pi 2838552 Oct 19 09:38 mm-hostapd_1.12.4-1.deb
-rw-r–r-- 1 pi pi 123010 Oct 19 09:38 mm-morsecli_1.12.4-1.deb
-rw-r–r-- 1 pi pi 1640 Oct 19 09:39 mm-overlays_1.12.4-1.deb
-rw-r–r-- 1 pi pi 1168164 Oct 19 09:38 mm-wpa-supp_1.12.4-1.deb

pi@raspberrypi:~/Downloads $ sudo apt install ./mm-driver_1.12.4-1.deb
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Note, selecting ‘mm-driver’ instead of ‘./mm-driver_1.12.4-1.deb’
The following packages were automatically installed and are no longer required:
chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg-extra
Use ‘sudo apt autoremove’ to remove them.
The following NEW packages will be installed:
mm-driver
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/3,025 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 /home/pi/Downloads/mm-driver_1.12.4-1.deb mm-driver arm64 1.12.4-1 [3,025 kB]
Selecting previously unselected package mm-driver.
(Reading database … 247966 files and directories currently installed.)
Preparing to unpack …/mm-driver_1.12.4-1.deb …
Unpacking mm-driver (1.12.4-1) …
Setting up mm-driver (1.12.4-1) …
mv: cannot move ‘/lib/modules/placeholder/extra’ to ‘/lib/modules/6.6.51+rpt-rpi-2712/extra’: Directory not empty
dpkg: error processing package mm-driver (–configure):
installed mm-driver package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
mm-driver
N: Download is performed unsandboxed as root as file ‘/home/pi/Downloads/mm-driver_1.12.4-1.deb’ couldn’t be accessed by user ‘_apt’. - pkgAcquire::Run (13: Permission denied)
E: Sub-process /usr/bin/dpkg returned an error code (1)
pi@raspberrypi:~/Downloads $ ^C
pi@raspberrypi:~/Downloads $

pi@raspberrypi:~/Downloads $ sudo chown -Rv _apt:root /home/pi/Downloads/
changed ownership of ‘/home/pi/Downloads/mm-driver_1.12.4-1.deb’ from pi:pi to _apt:root
changed ownership of ‘/home/pi/Downloads/mm-wpa-supp_1.12.4-1.deb’ from pi:pi to _apt:root
changed ownership of ‘/home/pi/Downloads/mm-morsecli_1.12.4-1.deb’ from pi:pi to _apt:root
changed ownership of ‘/home/pi/Downloads/mm-firmware_1.12.4-1.deb’ from pi:pi to _apt:root
changed ownership of ‘/home/pi/Downloads/mm-hostapd_1.12.4-1.deb’ from pi:pi to _apt:root
changed ownership of ‘/home/pi/Downloads/mm-overlays_1.12.4-1.deb’ from pi:pi to _apt:root
changed ownership of ‘/home/pi/Downloads/’ from pi:pi to _apt:root

pi@raspberrypi:~/Downloads $ sudo chmod -Rv 700 /home/pi/Downloads/
mode of ‘/home/pi/Downloads/’ changed from 0755 (rwxr-xr-x) to 0700 (rwx------)
mode of ‘/home/pi/Downloads/mm-driver_1.12.4-1.deb’ changed from 0644 (rw-r–r–) to 0700 (rwx------)
mode of ‘/home/pi/Downloads/mm-wpa-supp_1.12.4-1.deb’ changed from 0644 (rw-r–r–) to 0700 (rwx------)
mode of ‘/home/pi/Downloads/mm-morsecli_1.12.4-1.deb’ changed from 0644 (rw-r–r–) to 0700 (rwx------)
mode of ‘/home/pi/Downloads/mm-firmware_1.12.4-1.deb’ changed from 0644 (rw-r–r–) to 0700 (rwx------)
mode of ‘/home/pi/Downloads/mm-hostapd_1.12.4-1.deb’ changed from 0644 (rw-r–r–) to 0700 (rwx------)
mode of ‘/home/pi/Downloads/mm-overlays_1.12.4-1.deb’ changed from 0644 (rw-r–r–) to 0700 (rwx------)

pi@raspberrypi:~/Downloads $ sudo apt install ./mm-driver_1.12.4-1.deb
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Note, selecting ‘mm-driver’ instead of ‘./mm-driver_1.12.4-1.deb’
mm-driver is already the newest version (1.12.4-1).
The following packages were automatically installed and are no longer required:
chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg-extra
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mm-driver (1.12.4-1) …
mv: cannot move ‘/lib/modules/placeholder/extra’ to ‘/lib/modules/6.6.51+rpt-rpi-2712/extra’: Directory not empty
dpkg: error processing package mm-driver (–configure):
installed mm-driver package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
mm-driver
E: Sub-process /usr/bin/dpkg returned an error code (1)
pi@raspberrypi:~/Downloads $ ^C
pi@raspberrypi:~/Downloads $

Summary
I was wondering what I may be doing wrong? Any guidance would be greatly appreciated as I am super keen to try and get this working. Thanking all community members in advance for any feedback.

Cheers, James.

1 Like

I built these debian packages around a custom kernel I had built late September. I’ve retargeted the debian packages for the kernel in the release available for download on the raspberry pi website, and packaged the patched mac80211 as mm-mac80211_6.6.31-rpt-rpi-2712-1.12.4.deb and updated the driver and overlays to fix some small bugs.

# Flash 2024-07-04-raspios-bookworm-arm64-lite.img.xz from https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz

# Configure ssh and your user information.
# Create empty ssh file and a userconf file in boot partition

sudo apt install libnl-3-dev libnl-genl-3-dev libnl-route-3-dev
sudo dpkg -i /tmp/mm-hostapd_1.12.4-1.deb
sudo dpkg -i /tmp/mm-wpa-supp_1.12.4-1.deb
sudo dpkg -i /tmp/mm-morsecli_1.12.4-1.deb
sudo dpkg -i /tmp/mm-firmware_1.12.4-1.deb
sudo dpkg -i /tmp/mm-mac80211_6.6.31-rpt-rpi-2712-1.12.4.deb
sudo dpkg -i /tmp/mm-driver_1.12.4-rpt-rpi-2712.deb
sudo dpkg -i /tmp/mm-overlays_1.12.4-2.deb

Note, mm-driver might result in an error when first installing. If this occurs, install all other packages first, reboot the Rpi 5 and then install the mm-driver again.

mm-overlays_1.12.4-2.deb (1.7 KB)
mm-driver_1.12.4-rpt-rpi-2712.deb (2.9 MB)
mm-mac80211_6.6.31-rpt-rpi-2712-1.12.4.deb (319.4 KB)
mm-wpa-supp_1.12.4-1.deb (1.1 MB)
mm-morsecli_1.12.4-1.deb (120.1 KB)
mm-hostapd_1.12.4-1.deb (2.7 MB)
mm-firmware_1.12.4-1.deb (202.2 KB)

2 Likes