From 8462fe3c636d2aad064e0c239bd0954ce714fe50 Mon Sep 17 00:00:00 2001 From: Daniel Kulp Date: Thu, 7 Nov 2024 12:02:04 -0500 Subject: [PATCH] Pi5 does not have external wifi adapters --- src/boot/FPPINIT.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/boot/FPPINIT.cpp b/src/boot/FPPINIT.cpp index 72dd7e481..533b58b47 100644 --- a/src/boot/FPPINIT.cpp +++ b/src/boot/FPPINIT.cpp @@ -927,6 +927,21 @@ static void detectNetworkModules() { // PutFileContents("/home/fpp/media/config/fpp-network-modules.conf", content); } } +static void checkPi5Wifi() { +#ifdef PLATFORM_PI + if (startsWith(GetFileContents("/proc/device-tree/model"), "Raspberry Pi 5")) { + // Pi5 does not have external wifi adapters, make sure we have them disabled + if (FileExists("/etc/modprobe.d/blacklist-native-wifi.conf")) { + unlink("/etc/modprobe.d/blacklist-native-wifi.conf"); + } + std::string v; + getRawSetting("wifiDrivers", v); + if (v != "Kernel") { + setRawSetting("wifiDrivers", "Kernel"); + } + } +#endif +} static void setupAudio() { if (!FileExists("/root/.libao")) { @@ -1278,6 +1293,7 @@ int main(int argc, char* argv[]) { printf("FPP - Directories created\n"); checkSSHKeys(); handleBootPartition(); + checkPi5Wifi(); checkHostName(); checkFSTAB(); setupApache();