mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-05 19:19:18 +00:00
Merge branch 'master' into tft-gui-work
This commit is contained in:
commit
ca6a80ad6b
17
.github/workflows/package_amd64.yml
vendored
17
.github/workflows/package_amd64.yml
vendored
@ -47,18 +47,18 @@ jobs:
|
||||
- name: build .debpkg
|
||||
run: |
|
||||
mkdir -p .debpkg/DEBIAN
|
||||
mkdir -p .debpkg/usr/share/doc/meshtasticd/web
|
||||
mkdir -p .debpkg/usr/share/meshtasticd/web
|
||||
mkdir -p .debpkg/usr/sbin
|
||||
mkdir -p .debpkg/etc/meshtasticd
|
||||
mkdir -p .debpkg/etc/meshtasticd/config.d
|
||||
mkdir -p .debpkg/etc/meshtasticd/available.d
|
||||
mkdir -p .debpkg/usr/lib/systemd/system/
|
||||
tar -xf build.tar -C .debpkg/usr/share/doc/meshtasticd/web
|
||||
tar -xf build.tar -C .debpkg/usr/share/meshtasticd/web
|
||||
shopt -s dotglob nullglob
|
||||
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi
|
||||
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi
|
||||
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
|
||||
gunzip .debpkg/usr/share/doc/meshtasticd/web/ -r
|
||||
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then mv .debpkg/usr/share/meshtasticd/web/build/* .debpkg/usr/share/meshtasticd/web/; fi
|
||||
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/meshtasticd/web/build; fi
|
||||
if [ -d .debpkg/usr/share/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/meshtasticd/web/.DS_Store; fi
|
||||
gunzip .debpkg/usr/share/meshtasticd/web/ -r
|
||||
cp release/meshtasticd_linux_x86_64 .debpkg/usr/sbin/meshtasticd
|
||||
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
|
||||
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
|
||||
@ -66,6 +66,11 @@ jobs:
|
||||
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
|
||||
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
|
||||
chmod +x .debpkg/DEBIAN/conffiles
|
||||
# Transition /usr/share/doc/meshtasticd to /usr/share/meshtasticd
|
||||
echo "rm -rf /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/preinst
|
||||
chmod +x .debpkg/DEBIAN/preinst
|
||||
echo "ln -sf /usr/share/meshtasticd /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/postinst
|
||||
chmod +x .debpkg/DEBIAN/postinst
|
||||
|
||||
- uses: jiro4989/build-deb-action@v3
|
||||
with:
|
||||
|
17
.github/workflows/package_raspbian.yml
vendored
17
.github/workflows/package_raspbian.yml
vendored
@ -47,18 +47,18 @@ jobs:
|
||||
- name: build .debpkg
|
||||
run: |
|
||||
mkdir -p .debpkg/DEBIAN
|
||||
mkdir -p .debpkg/usr/share/doc/meshtasticd/web
|
||||
mkdir -p .debpkg/usr/share/meshtasticd/web
|
||||
mkdir -p .debpkg/usr/sbin
|
||||
mkdir -p .debpkg/etc/meshtasticd
|
||||
mkdir -p .debpkg/etc/meshtasticd/config.d
|
||||
mkdir -p .debpkg/etc/meshtasticd/available.d
|
||||
mkdir -p .debpkg/usr/lib/systemd/system/
|
||||
tar -xf build.tar -C .debpkg/usr/share/doc/meshtasticd/web
|
||||
tar -xf build.tar -C .debpkg/usr/share/meshtasticd/web
|
||||
shopt -s dotglob nullglob
|
||||
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi
|
||||
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi
|
||||
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
|
||||
gunzip .debpkg/usr/share/doc/meshtasticd/web/ -r
|
||||
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then mv .debpkg/usr/share/meshtasticd/web/build/* .debpkg/usr/share/meshtasticd/web/; fi
|
||||
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/meshtasticd/web/build; fi
|
||||
if [ -d .debpkg/usr/share/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/meshtasticd/web/.DS_Store; fi
|
||||
gunzip .debpkg/usr/share/meshtasticd/web/ -r
|
||||
cp release/meshtasticd_linux_aarch64 .debpkg/usr/sbin/meshtasticd
|
||||
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
|
||||
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
|
||||
@ -66,6 +66,11 @@ jobs:
|
||||
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
|
||||
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
|
||||
chmod +x .debpkg/DEBIAN/conffiles
|
||||
# Transition /usr/share/doc/meshtasticd to /usr/share/meshtasticd
|
||||
echo "rm -rf /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/preinst
|
||||
chmod +x .debpkg/DEBIAN/preinst
|
||||
echo "ln -sf /usr/share/meshtasticd /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/postinst
|
||||
chmod +x .debpkg/DEBIAN/postinst
|
||||
|
||||
- uses: jiro4989/build-deb-action@v3
|
||||
with:
|
||||
|
17
.github/workflows/package_raspbian_armv7l.yml
vendored
17
.github/workflows/package_raspbian_armv7l.yml
vendored
@ -47,18 +47,18 @@ jobs:
|
||||
- name: build .debpkg
|
||||
run: |
|
||||
mkdir -p .debpkg/DEBIAN
|
||||
mkdir -p .debpkg/usr/share/doc/meshtasticd/web
|
||||
mkdir -p .debpkg/usr/share/meshtasticd/web
|
||||
mkdir -p .debpkg/usr/sbin
|
||||
mkdir -p .debpkg/etc/meshtasticd
|
||||
mkdir -p .debpkg/etc/meshtasticd/config.d
|
||||
mkdir -p .debpkg/etc/meshtasticd/available.d
|
||||
mkdir -p .debpkg/usr/lib/systemd/system/
|
||||
tar -xf build.tar -C .debpkg/usr/share/doc/meshtasticd/web
|
||||
tar -xf build.tar -C .debpkg/usr/share/meshtasticd/web
|
||||
shopt -s dotglob nullglob
|
||||
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi
|
||||
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi
|
||||
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
|
||||
gunzip .debpkg/usr/share/doc/meshtasticd/web/ -r
|
||||
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then mv .debpkg/usr/share/meshtasticd/web/build/* .debpkg/usr/share/meshtasticd/web/; fi
|
||||
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/meshtasticd/web/build; fi
|
||||
if [ -d .debpkg/usr/share/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/meshtasticd/web/.DS_Store; fi
|
||||
gunzip .debpkg/usr/share/meshtasticd/web/ -r
|
||||
cp release/meshtasticd_linux_armv7l .debpkg/usr/sbin/meshtasticd
|
||||
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
|
||||
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
|
||||
@ -66,6 +66,11 @@ jobs:
|
||||
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
|
||||
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
|
||||
chmod +x .debpkg/DEBIAN/conffiles
|
||||
# Transition /usr/share/doc/meshtasticd to /usr/share/meshtasticd
|
||||
echo "rm -rf /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/preinst
|
||||
chmod +x .debpkg/DEBIAN/preinst
|
||||
echo "ln -sf /usr/share/meshtasticd /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/postinst
|
||||
chmod +x .debpkg/DEBIAN/postinst
|
||||
|
||||
- uses: jiro4989/build-deb-action@v3
|
||||
with:
|
||||
|
@ -6,6 +6,7 @@ platform_packages =
|
||||
; our custom Git version until they merge our PR
|
||||
framework-arduinoadafruitnrf52 @ https://github.com/geeksville/Adafruit_nRF52_Arduino.git#4f591d0f71f75e5128fab9dc42ac72f1696cf89f
|
||||
toolchain-gccarmnoneeabi@~1.90301.0
|
||||
|
||||
build_type = debug
|
||||
build_flags =
|
||||
-include arch/nrf52/cpp_overrides/lfs_util.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
|
||||
; The Portduino based 'native' environment. Currently supported on Linux targets with real LoRa hardware (or simulated).
|
||||
[portduino_base]
|
||||
platform = https://github.com/meshtastic/platform-native.git#bcd02436cfca91f7d28ad0f7dab977c6aaa781af
|
||||
platform = https://github.com/meshtastic/platform-native.git#73bd1a21183ca8b00c4ea58bb21315df31a50dff
|
||||
framework = arduino
|
||||
|
||||
build_src_filter =
|
||||
|
@ -155,9 +155,11 @@ Logging:
|
||||
|
||||
Webserver:
|
||||
# Port: 443 # Port for Webserver & Webservices
|
||||
# RootPath: /usr/share/doc/meshtasticd/web # Root Dir of WebServer
|
||||
# RootPath: /usr/share/meshtasticd/web # Root Dir of WebServer
|
||||
|
||||
General:
|
||||
MaxNodes: 200
|
||||
MaxMessageQueue: 100
|
||||
ConfigDirectory: /etc/meshtasticd/config.d/
|
||||
ConfigDirectory: /etc/meshtasticd/config.d/
|
||||
# MACAddress: AA:BB:CC:DD:EE:FF
|
||||
# MACAddressSource: eth0
|
8
bin/config.d/OpenWRT_One_mikroBUS_sx1262.yaml
Normal file
8
bin/config.d/OpenWRT_One_mikroBUS_sx1262.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
Lora:
|
||||
Module: sx1262
|
||||
IRQ: 10
|
||||
Busy: 12
|
||||
# Reset: 2
|
||||
spidev: spidev2.0
|
||||
DIO2_AS_RF_SWITCH: true
|
||||
DIO3_TCXO_VOLTAGE: true
|
@ -425,11 +425,14 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
||||
|
||||
case CGRADSENS_ADDR:
|
||||
// Register 0x00 of the RadSens sensor contains is product identifier 0x7D
|
||||
// Undocumented, but some devices return a product identifier of 0x7A
|
||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
|
||||
if (registerValue == 0x7D) {
|
||||
if (registerValue == 0x7D || registerValue == 0x7A) {
|
||||
type = CGRADSENS;
|
||||
logFoundDevice("ClimateGuard RadSens", (uint8_t)addr.address);
|
||||
break;
|
||||
} else {
|
||||
LOG_DEBUG("Unexpected Device ID for RadSense: addr=0x%x id=0x%x", CGRADSENS_ADDR, registerValue);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1437,4 +1437,4 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co
|
||||
LOG_ERROR("A critical failure occurred, portduino is exiting");
|
||||
exit(2);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -245,4 +245,4 @@ void setupModules()
|
||||
// NOTE! This module must be added LAST because it likes to check for replies from other modules and avoid sending extra
|
||||
// acks
|
||||
routingModule = new RoutingModule();
|
||||
}
|
||||
}
|
||||
|
@ -5,22 +5,27 @@
|
||||
#include "sleep.h"
|
||||
#include "target_specific.h"
|
||||
|
||||
#include <Utility.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "PortduinoGlue.h"
|
||||
#include "api/ServerAPI.h"
|
||||
#include "linux/gpio/LinuxGPIOPin.h"
|
||||
#include "meshUtils.h"
|
||||
#include "yaml-cpp/yaml.h"
|
||||
#include <Utility.h>
|
||||
#include <assert.h>
|
||||
#include <bluetooth/bluetooth.h>
|
||||
#include <bluetooth/hci.h>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
std::map<configNames, int> settingsMap;
|
||||
std::map<configNames, std::string> settingsStrings;
|
||||
std::ofstream traceFile;
|
||||
char *configPath = nullptr;
|
||||
char *optionMac = nullptr;
|
||||
|
||||
// FIXME - move setBluetoothEnable into a HALPlatform class
|
||||
void setBluetoothEnable(bool enable)
|
||||
@ -49,6 +54,10 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
|
||||
case 'c':
|
||||
configPath = arg;
|
||||
break;
|
||||
case 'h':
|
||||
optionMac = arg;
|
||||
break;
|
||||
|
||||
case ARGP_KEY_ARG:
|
||||
return 0;
|
||||
default:
|
||||
@ -61,6 +70,7 @@ void portduinoCustomInit()
|
||||
{
|
||||
static struct argp_option options[] = {{"port", 'p', "PORT", 0, "The TCP port to use."},
|
||||
{"config", 'c', "CONFIG_PATH", 0, "Full path of the .yaml config file to use."},
|
||||
{"hwid", 'h', "HWID", 0, "The mac address to assign to this virtual machine"},
|
||||
{0}};
|
||||
static void *childArguments;
|
||||
static char doc[] = "Meshtastic native build.";
|
||||
@ -70,6 +80,49 @@ void portduinoCustomInit()
|
||||
portduinoAddArguments(child, childArguments);
|
||||
}
|
||||
|
||||
void getMacAddr(uint8_t *dmac)
|
||||
{
|
||||
// We should store this value, and short-circuit all this if it's already been set.
|
||||
if (optionMac != nullptr && strlen(optionMac) > 0) {
|
||||
if (strlen(optionMac) >= 12) {
|
||||
MAC_from_string(optionMac, dmac);
|
||||
} else {
|
||||
uint32_t hwId = sscanf(optionMac, "%u", &hwId);
|
||||
dmac[0] = 0x80;
|
||||
dmac[1] = 0;
|
||||
dmac[2] = hwId >> 24;
|
||||
dmac[3] = hwId >> 16;
|
||||
dmac[4] = hwId >> 8;
|
||||
dmac[5] = hwId & 0xff;
|
||||
}
|
||||
} else if (settingsStrings[mac_address].length() > 11) {
|
||||
MAC_from_string(settingsStrings[mac_address], dmac);
|
||||
exit;
|
||||
} else {
|
||||
|
||||
struct hci_dev_info di;
|
||||
di.dev_id = 0;
|
||||
bdaddr_t bdaddr;
|
||||
char addr[18];
|
||||
int btsock;
|
||||
btsock = socket(AF_BLUETOOTH, SOCK_RAW, 1);
|
||||
if (btsock < 0) { // If anything fails, just return with the default value
|
||||
return;
|
||||
}
|
||||
|
||||
if (ioctl(btsock, HCIGETDEVINFO, (void *)&di)) {
|
||||
return;
|
||||
}
|
||||
|
||||
dmac[0] = di.bdaddr.b[5];
|
||||
dmac[1] = di.bdaddr.b[4];
|
||||
dmac[2] = di.bdaddr.b[3];
|
||||
dmac[3] = di.bdaddr.b[2];
|
||||
dmac[4] = di.bdaddr.b[1];
|
||||
dmac[5] = di.bdaddr.b[0];
|
||||
}
|
||||
}
|
||||
|
||||
/** apps run under portduino can optionally define a portduinoSetup() to
|
||||
* use portduino specific init code (such as gpioBind) to setup portduino on their host machine,
|
||||
* before running 'arduino' code.
|
||||
@ -115,10 +168,20 @@ void portduinoSetup()
|
||||
std::cout << "Unable to use " << configPath << " as config file" << std::endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else if (access("config.yaml", R_OK) == 0 && loadConfig("config.yaml")) {
|
||||
std::cout << "Using local config.yaml as config file" << std::endl;
|
||||
} else if (access("/etc/meshtasticd/config.yaml", R_OK) == 0 && loadConfig("/etc/meshtasticd/config.yaml")) {
|
||||
std::cout << "Using /etc/meshtasticd/config.yaml as config file" << std::endl;
|
||||
} else if (access("config.yaml", R_OK) == 0) {
|
||||
if (loadConfig("config.yaml")) {
|
||||
std::cout << "Using local config.yaml as config file" << std::endl;
|
||||
} else {
|
||||
std::cout << "Unable to use local config.yaml as config file" << std::endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else if (access("/etc/meshtasticd/config.yaml", R_OK) == 0) {
|
||||
if (loadConfig("/etc/meshtasticd/config.yaml")) {
|
||||
std::cout << "Using /etc/meshtasticd/config.yaml as config file" << std::endl;
|
||||
} else {
|
||||
std::cout << "Unable to use /etc/meshtasticd/config.yaml as config file" << std::endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
std::cout << "No 'config.yaml' found, running simulated." << std::endl;
|
||||
settingsMap[maxnodes] = 200; // Default to 200 nodes
|
||||
@ -139,6 +202,14 @@ void portduinoSetup()
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t dmac[6] = {0};
|
||||
getMacAddr(dmac);
|
||||
if (dmac[0] == 0 && dmac[1] == 0 && dmac[2] == 0 && dmac[3] == 0 && dmac[4] == 0 && dmac[5] == 0) {
|
||||
std::cout << "*** Blank MAC Address not allowed!" << std::endl;
|
||||
std::cout << "Please set a MAC Address in config.yaml using either MACAddress or MACAddressSource." << std::endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
std::cout << "MAC Address: " << std::hex << +dmac[0] << +dmac[1] << +dmac[2] << +dmac[3] << +dmac[4] << +dmac[5] << std::endl;
|
||||
// Rather important to set this, if not running simulated.
|
||||
randomSeed(time(NULL));
|
||||
|
||||
@ -414,10 +485,27 @@ bool loadConfig(const char *configPath)
|
||||
settingsStrings[webserverrootpath] = (yamlConfig["Webserver"]["RootPath"]).as<std::string>("");
|
||||
}
|
||||
|
||||
settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as<int>(200);
|
||||
settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as<int>(100);
|
||||
settingsStrings[config_directory] = (yamlConfig["General"]["ConfigDirectory"]).as<std::string>("");
|
||||
if (yamlConfig["General"]) {
|
||||
settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as<int>(200);
|
||||
settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as<int>(100);
|
||||
settingsStrings[config_directory] = (yamlConfig["General"]["ConfigDirectory"]).as<std::string>("");
|
||||
if ((yamlConfig["General"]["MACAddress"]).as<std::string>("") != "" &&
|
||||
(yamlConfig["General"]["MACAddressSource"]).as<std::string>("") != "") {
|
||||
std::cout << "Cannot set both MACAddress and MACAddressSource!" << std::endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
settingsStrings[mac_address] = (yamlConfig["General"]["MACAddress"]).as<std::string>("");
|
||||
if ((yamlConfig["General"]["MACAddressSource"]).as<std::string>("") != "") {
|
||||
std::ifstream infile("/sys/class/net/" + (yamlConfig["General"]["MACAddressSource"]).as<std::string>("") +
|
||||
"/address");
|
||||
std::getline(infile, settingsStrings[mac_address]);
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/a/20326454
|
||||
settingsStrings[mac_address].erase(
|
||||
std::remove(settingsStrings[mac_address].begin(), settingsStrings[mac_address].end(), ':'),
|
||||
settingsStrings[mac_address].end());
|
||||
}
|
||||
} catch (YAML::Exception &e) {
|
||||
std::cout << "*** Exception " << e.what() << std::endl;
|
||||
return false;
|
||||
@ -430,3 +518,19 @@ static bool ends_with(std::string_view str, std::string_view suffix)
|
||||
{
|
||||
return str.size() >= suffix.size() && str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
|
||||
}
|
||||
|
||||
bool MAC_from_string(std::string mac_str, uint8_t *dmac)
|
||||
{
|
||||
mac_str.erase(std::remove(mac_str.begin(), mac_str.end(), ':'), mac_str.end());
|
||||
if (mac_str.length() == 12) {
|
||||
dmac[0] = std::stoi(settingsStrings[mac_address].substr(0, 2), nullptr, 16);
|
||||
dmac[1] = std::stoi(settingsStrings[mac_address].substr(2, 2), nullptr, 16);
|
||||
dmac[2] = std::stoi(settingsStrings[mac_address].substr(4, 2), nullptr, 16);
|
||||
dmac[3] = std::stoi(settingsStrings[mac_address].substr(6, 2), nullptr, 16);
|
||||
dmac[4] = std::stoi(settingsStrings[mac_address].substr(8, 2), nullptr, 16);
|
||||
dmac[5] = std::stoi(settingsStrings[mac_address].substr(10, 2), nullptr, 16);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,8 @@ enum configNames {
|
||||
maxtophone,
|
||||
maxnodes,
|
||||
ascii_logs,
|
||||
config_directory
|
||||
config_directory,
|
||||
mac_address
|
||||
};
|
||||
enum { no_screen, x11, st7789, st7735, st7735s, st7796, ili9341, ili9342, ili9486, ili9488, hx8357d };
|
||||
enum { no_touchscreen, xpt2046, stmpe610, gt911, ft5x06 };
|
||||
@ -72,3 +73,5 @@ extern std::ofstream traceFile;
|
||||
int initGPIOPin(int pinNum, std::string gpioChipname);
|
||||
bool loadConfig(const char *configPath);
|
||||
static bool ends_with(std::string_view str, std::string_view suffix);
|
||||
void getMacAddr(uint8_t *dmac);
|
||||
bool MAC_from_string(std::string mac_str, uint8_t *dmac);
|
@ -61,7 +61,6 @@ debug_tool = jlink
|
||||
[env:nrf52_promicro_diy_tcxo]
|
||||
extends = nrf52840_base
|
||||
board = promicro-nrf52840
|
||||
board_level = extra
|
||||
build_flags = ${nrf52840_base.build_flags}
|
||||
-I variants/diy/nrf52_promicro_diy_tcxo
|
||||
-D NRF52_PROMICRO_DIY
|
||||
@ -87,4 +86,4 @@ build_flags =
|
||||
-D BOARD_HAS_PSRAM
|
||||
-D ARDUINO_USB_MODE=0
|
||||
-D ARDUINO_USB_CDC_ON_BOOT=1
|
||||
-I variants/diy/t-energy-s3_e22
|
||||
-I variants/diy/t-energy-s3_e22
|
10
variants/heltec_capsule_sensor_v3/platformio.ini
Normal file
10
variants/heltec_capsule_sensor_v3/platformio.ini
Normal file
@ -0,0 +1,10 @@
|
||||
[env:heltec_capsule_sensor_v3]
|
||||
extends = esp32s3_base
|
||||
board = heltec_wifi_lora_32_V3
|
||||
board_check = true
|
||||
|
||||
build_flags =
|
||||
${esp32s3_base.build_flags} -I variants/heltec_capsule_sensor_v3
|
||||
-D HELTEC_CAPSULE_SENSOR_V3
|
||||
-D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output
|
53
variants/heltec_capsule_sensor_v3/variant.h
Normal file
53
variants/heltec_capsule_sensor_v3/variant.h
Normal file
@ -0,0 +1,53 @@
|
||||
#define LED_PIN 33
|
||||
#define LED_PIN2 34
|
||||
#define EXT_PWR_DETECT 35
|
||||
|
||||
#define BUTTON_PIN 18
|
||||
|
||||
#define BATTERY_PIN 7 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||
#define ADC_CHANNEL ADC1_GPIO7_CHANNEL
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider
|
||||
#define ADC_MULTIPLIER (4.9 * 1.045)
|
||||
#define ADC_CTRL 36 // active HIGH, powers the voltage divider. Only on 1.1
|
||||
#define ADC_CTRL_ENABLED HIGH
|
||||
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
#define GPS_RX_PIN 5
|
||||
#define GPS_TX_PIN 4
|
||||
#define PIN_GPS_RESET 3
|
||||
#define GPS_RESET_MODE LOW
|
||||
#define PIN_GPS_PPS 1
|
||||
#define PIN_GPS_EN 21
|
||||
#define GPS_EN_ACTIVE HIGH
|
||||
|
||||
#define USE_SX1262
|
||||
#define LORA_DIO0 -1 // a No connect on the SX1262 module
|
||||
#define LORA_RESET 12
|
||||
#define LORA_DIO1 14 // SX1262 IRQ
|
||||
#define LORA_DIO2 13 // SX1262 BUSY
|
||||
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
|
||||
|
||||
#define LORA_SCK 9
|
||||
#define LORA_MISO 11
|
||||
#define LORA_MOSI 10
|
||||
#define LORA_CS 8
|
||||
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
#define I2C_SDA 1
|
||||
#define I2C_SCL 2
|
||||
#define HAS_SCREEN 0
|
||||
#define SENSOR_POWER_CTRL_PIN 21
|
||||
#define SENSOR_POWER_ON 1
|
||||
|
||||
#define PERIPHERAL_WARMUP_MS 100
|
||||
#define SENSOR_GPS_CONFLICT
|
||||
|
||||
#define ESP32S3_WAKE_TYPE ESP_EXT1_WAKEUP_ANY_HIGH
|
11
variants/portduino-buildroot/platformio.ini
Normal file
11
variants/portduino-buildroot/platformio.ini
Normal file
@ -0,0 +1,11 @@
|
||||
[env:buildroot]
|
||||
extends = portduino_base
|
||||
; The pkg-config commands below optionally add link flags.
|
||||
; the || : is just a "or run the null command" to avoid returning an error code
|
||||
build_flags = ${portduino_base.build_flags} -O0 -I variants/portduino-buildroot
|
||||
-std=c++17
|
||||
!pkg-config --libs libulfius --silence-errors || :
|
||||
!pkg-config --libs openssl --silence-errors || :
|
||||
board = buildroot
|
||||
lib_deps = ${portduino_base.lib_deps}
|
||||
build_src_filter = ${portduino_base.build_src_filter}
|
5
variants/portduino-buildroot/variant.h
Normal file
5
variants/portduino-buildroot/variant.h
Normal file
@ -0,0 +1,5 @@
|
||||
#define HAS_SCREEN 1
|
||||
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
||||
#define HAS_GPS 1
|
||||
#define MAX_RX_TOPHONE settingsMap[maxtophone]
|
||||
#define MAX_NUM_NODES settingsMap[maxnodes]
|
@ -80,5 +80,7 @@ L76K GPS Module Information : https://www.seeedstudio.com/L76K-GNSS-Module-for-S
|
||||
|
||||
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_RXEN 38
|
||||
#define SX126X_TXEN RADIOLIB_NC
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
@ -8,10 +8,7 @@
|
||||
#define I2C_SDA 21 // I2C pins for this board
|
||||
#define I2C_SCL 22
|
||||
|
||||
#define LED_PIN 25 // If defined we will blink this LED
|
||||
#define BUTTON_PIN 12 // If defined, this will be used for user button presses,
|
||||
|
||||
#define BUTTON_NEED_PULLUP
|
||||
#define LED_PIN 25 // If defined we will blink this LED
|
||||
|
||||
#define USE_RF95
|
||||
#define LORA_DIO0 26 // a No connect on the SX1262 module
|
||||
|
@ -1,4 +1,4 @@
|
||||
[VERSION]
|
||||
major = 2
|
||||
minor = 5
|
||||
build = 16
|
||||
build = 17
|
||||
|
Loading…
Reference in New Issue
Block a user