YAML based config for PI / Portduino (#2943)

* Add configuration via /etc/meshtastic/config.yaml

* Move example config, support more locations

* Fix config check

* Use access() to check for config file presence

* Throw an error and exit on radio init fail

* Adds error check for reading Bluetooth MAC

* Settle on meshtasticd, add install script

* Shell fixes

* Fine. I'll put it back and then disable you

* Get wrekt, shellchekt

* Firat attempt at adding raspbian CI build

* Tickle the workflow

* Beatings will continue til morale improves

* Permissions are overrated

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
This commit is contained in:
Ben Meadors
2023-11-18 08:12:34 -06:00
committed by GitHub
parent 9d4af1146e
commit 46bd6ca7ba
14 changed files with 206 additions and 51 deletions

View File

@@ -69,6 +69,7 @@ NRF52Bluetooth *nrf52Bluetooth;
#ifdef ARCH_RASPBERRY_PI
#include "platform/portduino/PiHal.h"
#include "platform/portduino/PortduinoGlue.h"
#include <fstream>
#include <iostream>
#include <string>
@@ -690,15 +691,32 @@ void setup()
#endif
#ifdef ARCH_RASPBERRY_PI
PiHal *RadioLibHAL = new PiHal(1);
if (!rIf) {
rIf = new SX1262Interface((LockingArduinoHal *)RadioLibHAL, 21, 16, 18, 20);
if (!rIf->init()) {
LOG_WARN("Failed to find SX1262 radio\n");
delete rIf;
rIf = NULL;
} else {
LOG_INFO("SX1262 Radio init succeeded, using SX1262 radio\n");
if (settingsMap[use_sx1262]) {
if (!rIf) {
PiHal *RadioLibHAL = new PiHal(1);
rIf = new SX1262Interface((LockingArduinoHal *)RadioLibHAL, settingsMap[sx126x_cs], settingsMap[sx126x_dio1],
settingsMap[sx126x_reset], settingsMap[sx126x_busy]);
if (!rIf->init()) {
LOG_ERROR("Failed to find SX1262 radio\n");
delete rIf;
exit(EXIT_FAILURE);
} else {
LOG_INFO("SX1262 Radio init succeeded, using SX1262 radio\n");
}
}
} else if (settingsMap[use_rf95]) {
if (!rIf) {
PiHal *RadioLibHAL = new PiHal(1);
rIf = new RF95Interface((LockingArduinoHal *)RadioLibHAL, settingsMap[rf95_nss], settingsMap[rf95_irq],
settingsMap[rf95_reset], settingsMap[rf95_dio1]);
if (!rIf->init()) {
LOG_ERROR("Failed to find RF95 radio\n");
delete rIf;
rIf = NULL;
exit(EXIT_FAILURE);
} else {
LOG_INFO("RF95 Radio init succeeded, using RF95 radio\n");
}
}
}