Merge branch 'master' into ch341

This commit is contained in:
Jonathan Bennett 2024-12-04 19:45:24 -06:00 committed by GitHub
commit aa43e0bde2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
41 changed files with 350 additions and 229 deletions

View File

@ -57,11 +57,11 @@ jobs:
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
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
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/
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
chmod +x .debpkg/usr/sbin/meshtasticd
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
@ -82,4 +82,4 @@ jobs:
name: meshtasticd_${{ steps.version.outputs.version }}_amd64.deb
overwrite: true
path: |
./*.deb
./*.deb

View File

@ -57,11 +57,11 @@ jobs:
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
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
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/
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
chmod +x .debpkg/usr/sbin/meshtasticd
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
@ -82,4 +82,4 @@ jobs:
name: meshtasticd_${{ steps.version.outputs.version }}_arm64.deb
overwrite: true
path: |
./*.deb
./*.deb

View File

@ -57,11 +57,11 @@ jobs:
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
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
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/
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
chmod +x .debpkg/usr/sbin/meshtasticd
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
@ -82,4 +82,4 @@ jobs:
name: meshtasticd_${{ steps.version.outputs.version }}_armhf.deb
overwrite: true
path: |
./*.deb
./*.deb

View File

@ -30,7 +30,7 @@ lint:
- git-diff-check
- gitleaks@8.21.1
- clang-format@16.0.3
- prettier@3.3.3
#- prettier@3.3.3
ignore:
- linters: [ALL]
paths:
@ -46,4 +46,4 @@ actions:
enabled:
- trunk-fmt-pre-commit
- trunk-check-pre-push
- trunk-upgrade-available
- trunk-upgrade-available

View File

@ -1,8 +1,8 @@
; Common settings for rp2040 Processor based targets
[rp2040_base]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico 4.2.1
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico >=4.2.1
extends = arduino_base
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#996c3bfab9758f12c07aa20cc6d352e630c16987 ; 4.2.1 with fix for sporadic hangs
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#6024e9a7e82a72e38dd90f42029ba3748835eb2e ; 4.3.0 with fix MDNS
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m

View File

@ -1,8 +1,8 @@
; Common settings for rp2040 Processor based targets
[rp2350_base]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico 4.2.1
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico >=4.2.1
extends = arduino_base
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#96c3bfab9758f12c07aa20cc6d352e630c16987 ; 4.2.1 with fix for sporadic hangs
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#6024e9a7e82a72e38dd90f42029ba3748835eb2e ; 4.3.0 with fix MDNS
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m

View File

@ -24,7 +24,7 @@ def write_macros_to_json(macros, output_file):
def main():
header_file = 'userPrefs.h'
output_file = 'userPrefs.json'
output_file = 'userPrefs.jsonc'
# Uncomment all macros in the header file
with open(header_file, 'r') as file:
lines = file.readlines()

View File

@ -0,0 +1,16 @@
---
Lora:
## Ebyte E22-900M30S, E22-900M22S with no external RF switching setup
## Will work with any module without RF switching, and with TCXO
Module: sx1262
gpiochip: 1 # subtract 32 from the gpio numbers
DIO2_AS_RF_SWITCH: true
DIO3_TCXO_VOLTAGE: true
CS: 16 #pin6 / GPIO48 1C0
IRQ: 23 #pin17 / GPIO55 1C7
Busy: 22 #pin16 / GPIO54 1C6
Reset: 25 #pin13 / GPIO57 1D1
RXen: 24 #pin12 / GPIO56 1D0
#TXen: bridge to DIO2 on E22 module
spidev: spidev0.0
spiSpeed: 2000000

View File

@ -0,0 +1,16 @@
---
Lora:
## Ebyte E22-900MM22S with no external RF switching setup
## Will work with any module without RF switching and no TCXO
Module: sx1262
gpiochip: 1 # subtract 32 from the gpio numbers
DIO2_AS_RF_SWITCH: true
DIO3_TCXO_VOLTAGE: true
CS: 16 #pin6 / GPIO48 1C0
IRQ: 23 #pin17 / GPIO55 1C7
Busy: 22 #pin16 / GPIO54 1C6
Reset: 25 #pin13 / GPIO57 1D1
RXen: 24 #pin12 / GPIO56 1D0
#TXen: bridge to DIO2 on E22 module
spidev: spidev0.0
spiSpeed: 2000000

View File

@ -0,0 +1,14 @@
---
Lora:
## Heltec HT-RA62, Seeed WIO SX1262
## Will work with any module with automatic RF switching, and with TCXO
Module: sx1262
gpiochip: 1 # subtract 32 from the gpio numbers
DIO2_AS_RF_SWITCH: true
DIO3_TCXO_VOLTAGE: true
CS: 16 #pin6 (GPIO pin 48 1C0)
IRQ: 23 #pin17 (GPIO pin 55 1C7)
Reset: 25 #pin13 (GPIO pin 57 1D1)
Busy: 22 #pin16 (GPIO pin 54 1C6)
spidev: spidev0.0 #pins are (CS=6, CLK=7, MOSI=8, MISO=9)
spiSpeed: 2000000

View File

@ -0,0 +1,13 @@
---
Lora:
## Waveshare SX126X XXXM, AI Thinker RA-01SH
## Will work with any module with automatic RF switching, and with no TCXO
Module: sx1262
gpiochip: 1 # subtract 32 from the gpio numbers
DIO2_AS_RF_SWITCH: true
CS: 16 #pin6 (GPIO pin 48 1C0)
IRQ: 23 #pin17 (GPIO pin 55 1C7)
Reset: 25 #pin13 (GPIO pin 57 1D1)
Busy: 22 #pin16 (GPIO pin 54 1C6)
spidev: spidev0.0 #pins are (CS=6, CLK=7, MOSI=8, MISO=9)
spiSpeed: 2000000

View File

@ -3,6 +3,8 @@
# trunk-ignore-all(flake8/F821): For SConstruct imports
import sys
from os.path import join
import json
import re
from readprops import readProps
@ -90,11 +92,37 @@ prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
verObj = readProps(prefsLoc)
print("Using meshtastic platformio-custom.py, firmware version " + verObj["long"] + " on " + env.get("PIOENV"))
jsonLoc = env["PROJECT_DIR"] + "/userPrefs.jsonc"
with open(jsonLoc) as f:
jsonStr = re.sub("//.*","", f.read(), flags=re.MULTILINE)
userPrefs = json.loads(jsonStr)
pref_flags = []
# Pre-process the userPrefs
for pref in userPrefs:
if userPrefs[pref].startswith("{"):
pref_flags.append("-D" + pref + "=" + userPrefs[pref])
elif userPrefs[pref].replace(".", "").isdigit():
pref_flags.append("-D" + pref + "=" + userPrefs[pref])
elif userPrefs[pref] == "true" or userPrefs[pref] == "false":
pref_flags.append("-D" + pref + "=" + userPrefs[pref])
elif userPrefs[pref].startswith("meshtastic_"):
pref_flags.append("-D" + pref + "=" + userPrefs[pref])
# If the value is a string, we need to wrap it in quotes
else:
pref_flags.append("-D" + pref + "=" + env.StringifyMacro(userPrefs[pref]) + "")
# General options that are passed to the C and C++ compilers
projenv.Append(
CCFLAGS=[
flags = [
"-DAPP_VERSION=" + verObj["long"],
"-DAPP_VERSION_SHORT=" + verObj["short"],
"-DAPP_ENV=" + env.get("PIOENV"),
]
)
] + pref_flags
print ("Using flags:")
for flag in flags:
print(flag)
projenv.Append(
CCFLAGS=flags,
)

@ -1 +1 @@
Subproject commit 02e6576efaa2f691be9504b8c1c6261703f7a277
Subproject commit 00c9c9932ea50c14cdc44d497d2672a0031641ce

View File

@ -1,5 +1,5 @@
#include "ButtonThread.h"
#include "../userPrefs.h"
#include "configuration.h"
#if !MESHTASTIC_EXCLUDE_GPS
#include "GPS.h"

View File

@ -1,6 +1,5 @@
#pragma once
#include "../userPrefs.h"
#include "configuration.h"
#include "detect/ScanI2C.h"
@ -606,4 +605,4 @@ class Screen : public concurrency::OSThread
} // namespace graphics
#endif
#endif

View File

@ -1,4 +1,3 @@
#include "../userPrefs.h"
#include "configuration.h"
#if !MESHTASTIC_EXCLUDE_GPS
#include "GPS.h"
@ -83,7 +82,7 @@ NRF52Bluetooth *nrf52Bluetooth = nullptr;
#include "STM32WLE5JCInterface.h"
#endif
#if !HAS_RADIO && defined(ARCH_PORTDUINO)
#if defined(ARCH_PORTDUINO)
#include "platform/portduino/SimRadio.h"
#endif
@ -870,6 +869,51 @@ void setup()
LOG_INFO("SX1280 init success");
}
}
} else if (settingsMap[use_lr1110]) {
if (!rIf) {
LOG_DEBUG("Activate lr1110 radio on SPI port %s", settingsStrings[spidev].c_str());
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings);
rIf = new LR1110Interface((LockingArduinoHal *)RadioLibHAL, settingsMap[cs], settingsMap[irq], settingsMap[reset],
settingsMap[busy]);
if (!rIf->init()) {
LOG_WARN("No LR1110 radio");
delete rIf;
rIf = NULL;
exit(EXIT_FAILURE);
} else {
LOG_INFO("LR1110 init success");
}
}
} else if (settingsMap[use_lr1120]) {
if (!rIf) {
LOG_DEBUG("Activate lr1120 radio on SPI port %s", settingsStrings[spidev].c_str());
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings);
rIf = new LR1120Interface((LockingArduinoHal *)RadioLibHAL, settingsMap[cs], settingsMap[irq], settingsMap[reset],
settingsMap[busy]);
if (!rIf->init()) {
LOG_WARN("No LR1120 radio");
delete rIf;
rIf = NULL;
exit(EXIT_FAILURE);
} else {
LOG_INFO("LR1120 init success");
}
}
} else if (settingsMap[use_lr1121]) {
if (!rIf) {
LOG_DEBUG("Activate lr1121 radio on SPI port %s", settingsStrings[spidev].c_str());
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings);
rIf = new LR1121Interface((LockingArduinoHal *)RadioLibHAL, settingsMap[cs], settingsMap[irq], settingsMap[reset],
settingsMap[busy]);
if (!rIf->init()) {
LOG_WARN("No LR1121 radio");
delete rIf;
rIf = NULL;
exit(EXIT_FAILURE);
} else {
LOG_INFO("LR1121 init success");
}
}
} else if (settingsMap[use_sx1268]) {
if (!rIf) {
LOG_DEBUG("Activate sx1268 radio on SPI port %s", settingsStrings[spidev].c_str());
@ -908,7 +952,7 @@ void setup()
}
#endif
#if !HAS_RADIO && defined(ARCH_PORTDUINO)
#if defined(ARCH_PORTDUINO)
if (!rIf) {
rIf = new SimRadio;
if (!rIf->init()) {
@ -1230,4 +1274,4 @@ void loop()
mainDelay.delay(delayMsec);
}
}
#endif
#endif

View File

@ -1,5 +1,5 @@
#include "Channels.h"
#include "../userPrefs.h"
#include "CryptoEngine.h"
#include "Default.h"
#include "DisplayFormatters.h"

View File

@ -1,5 +1,5 @@
#include "Default.h"
#include "../userPrefs.h"
#include "meshUtils.h"
uint32_t Default::getConfiguredOrDefaultMs(uint32_t configuredInterval, uint32_t defaultInterval)

View File

@ -1,5 +1,5 @@
#include "FloodingRouter.h"
#include "../userPrefs.h"
#include "configuration.h"
#include "mesh-pb-constants.h"

View File

@ -166,27 +166,10 @@ NodeNum MeshService::getNodenumFromRequestId(uint32_t request_id)
*/
void MeshService::handleToRadio(meshtastic_MeshPacket &p)
{
#if defined(ARCH_PORTDUINO) && !HAS_RADIO
// Simulates device received a packet via the LoRa chip
if (p.decoded.portnum == meshtastic_PortNum_SIMULATOR_APP) {
// Simulator packet (=Compressed packet) is encapsulated in a MeshPacket, so need to unwrap first
meshtastic_Compressed scratch;
meshtastic_Compressed *decoded = NULL;
if (p.which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
memset(&scratch, 0, sizeof(scratch));
p.decoded.payload.size =
pb_decode_from_bytes(p.decoded.payload.bytes, p.decoded.payload.size, &meshtastic_Compressed_msg, &scratch);
if (p.decoded.payload.size) {
decoded = &scratch;
// Extract the original payload and replace
memcpy(&p.decoded.payload, &decoded->data, sizeof(decoded->data));
// Switch the port from PortNum_SIMULATOR_APP back to the original PortNum
p.decoded.portnum = decoded->portnum;
} else
LOG_ERROR("Error decoding proto for simulator message!");
}
// Let SimRadio receive as if it did via its LoRa chip
SimRadio::instance->startReceive(&p);
#if defined(ARCH_PORTDUINO)
if (SimRadio::instance && p.decoded.portnum == meshtastic_PortNum_SIMULATOR_APP) {
// Simulates device received a packet via the LoRa chip
SimRadio::instance->unpackAndReceive(p);
return;
}
#endif

View File

@ -10,7 +10,7 @@
#include "MeshTypes.h"
#include "Observer.h"
#include "PointerQueue.h"
#if defined(ARCH_PORTDUINO) && !HAS_RADIO
#if defined(ARCH_PORTDUINO)
#include "../platform/portduino/SimRadio.h"
#endif
#if defined(ARCH_ESP32) || defined(ARCH_PORTDUINO)
@ -165,4 +165,4 @@ class MeshService
friend class RoutingModule;
};
extern MeshService *service;
extern MeshService *service;

View File

@ -1,4 +1,3 @@
#include "../userPrefs.h"
#include "configuration.h"
#if !MESHTASTIC_EXCLUDE_GPS
#include "GPS.h"
@ -465,7 +464,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false)
#endif
#if defined(USERPREFS_CONFIG_GPS_MODE)
config.position.gps_mode = USERPREFS_CONFIG_GPS_MODE;
#elif !HAS_GPS || defined(T_DECK) || defined(TLORA_T3S3_EPAPER)
#elif !HAS_GPS || GPS_DEFAULT_NOT_PRESENT
config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT;
#elif !defined(GPS_RX_PIN)
if (config.position.rx_gpio == 0)
@ -1243,7 +1242,6 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde
return false;
}
LOG_DEBUG("old user %s/%s, channel=%d", info->user.long_name, info->user.short_name, info->channel);
#if !(MESHTASTIC_EXCLUDE_PKI)
if (p.public_key.size > 0) {
printBytes("Incoming Pubkey: ", p.public_key.bytes, 32);
@ -1267,7 +1265,8 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde
}
if (nodeId != getNodeNum())
info->channel = channelIndex; // Set channel we need to use to reach this node (but don't set our own channel)
LOG_DEBUG("Update changed=%d user %s/%s, channel=%d", changed, info->user.long_name, info->user.short_name, info->channel);
LOG_DEBUG("Update changed=%d user %s/%s, id=0x%08x, channel=%d", changed, info->user.long_name, info->user.short_name, nodeId,
info->channel);
info->has_user = true;
if (changed) {

View File

@ -613,13 +613,14 @@ bool PhoneAPI::handleToRadioPacket(meshtastic_MeshPacket &p)
{
printPacket("PACKET FROM PHONE", &p);
// For use with the simulator, we should not ignore duplicate packets
#if !(defined(ARCH_PORTDUINO) && !HAS_RADIO)
if (p.id > 0 && wasSeenRecently(p.id)) {
LOG_DEBUG("Ignore packet from phone, already seen recently");
return false;
}
#if defined(ARCH_PORTDUINO)
// For use with the simulator, we should not ignore duplicate packets from the phone
if (SimRadio::instance == nullptr)
#endif
if (p.id > 0 && wasSeenRecently(p.id)) {
LOG_DEBUG("Ignore packet from phone, already seen recently");
return false;
}
if (p.decoded.portnum == meshtastic_PortNum_TRACEROUTE_APP && lastPortNumToRadio[p.decoded.portnum] &&
Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], THIRTY_SECONDS_MS)) {
@ -656,4 +657,4 @@ int PhoneAPI::onNotify(uint32_t newValue)
}
return timeout ? -1 : 0; // If we timed out, MeshService should stop iterating through observers as we just removed one
}
}

View File

@ -284,8 +284,8 @@ uint32_t RadioInterface::getTxDelayMsecWeighted(float snr)
void printPacket(const char *prefix, const meshtastic_MeshPacket *p)
{
#ifdef DEBUG_PORT
std::string out = DEBUG_PORT.mt_sprintf("%s (id=0x%08x fr=0x%02x to=0x%02x, WantAck=%d, HopLim=%d Ch=0x%x", prefix, p->id,
p->from & 0xff, p->to & 0xff, p->want_ack, p->hop_limit, p->channel);
std::string out = DEBUG_PORT.mt_sprintf("%s (id=0x%08x fr=0x%08x to=0x%08x, WantAck=%d, HopLim=%d Ch=0x%x", prefix, p->id,
p->from, p->to, p->want_ack, p->hop_limit, p->channel);
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
auto &s = p->decoded;
@ -622,4 +622,4 @@ size_t RadioInterface::beginSending(meshtastic_MeshPacket *p)
sendingPacket = p;
return p->encrypted.size + sizeof(PacketHeader);
}
}

View File

@ -6,6 +6,7 @@
#include "NodeDB.h"
#include "RTC.h"
#include "configuration.h"
#include "detect/LoRaRadioType.h"
#include "main.h"
#include "mesh-pb-constants.h"
#include "meshUtils.h"
@ -20,7 +21,6 @@
#if ENABLE_JSON_LOGGING || ARCH_PORTDUINO
#include "serialization/MeshPacketSerializer.h"
#endif
#include "../userPrefs.h"
#define MAX_RX_FROMRADIO \
4 // max number of packets destined to our queue, we dispatch packets quickly so it doesn't need to be big
@ -492,6 +492,8 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p)
// is not in the local nodedb
// First, only PKC encrypt packets we are originating
if (isFromUs(p) &&
// Don't use PKC with simulator
radioType != SIM_RADIO &&
// Don't use PKC with Ham mode
!owner.is_licensed &&
// Don't use PKC if it's not explicitly requested and a non-primary channel is requested

View File

@ -215,6 +215,11 @@ typedef enum _meshtastic_HardwareModel {
/* WisMesh Tap
RAK-4631 w/ TFT in injection modled case */
meshtastic_HardwareModel_WISMESH_TAP = 84,
/* Similar to PORTDUINO but used by Routastic devices, this is not any
particular device and does not run Meshtastic's code but supports
the same frame format.
Runs on linux, see https://github.com/Jorropo/routastic */
meshtastic_HardwareModel_ROUTASTIC = 85,
/* ------------------------------------------------------------------------------------------------------------------------------------------
Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits.
------------------------------------------------------------------------------------------------------------------------------------------ */

View File

@ -62,11 +62,7 @@ static void onNetworkConnected()
LOG_INFO("Start WiFi network services");
// start mdns
if (
#ifdef ARCH_RP2040
!moduleConfig.mqtt.enabled && // MDNS is not supported when MQTT is enabled on ARCH_RP2040
#endif
!MDNS.begin("Meshtastic")) {
if (!MDNS.begin("Meshtastic")) {
LOG_ERROR("Error setting up MDNS responder!");
} else {
LOG_INFO("mDNS Host: Meshtastic.local");

View File

@ -18,7 +18,7 @@
#ifdef ARCH_PORTDUINO
#include "unistd.h"
#endif
#include "../userPrefs.h"
#include "Default.h"
#include "TypeConversions.h"
@ -1123,4 +1123,4 @@ void disableBluetooth()
nrf52Bluetooth->shutdown();
#endif
#endif
}
}

View File

@ -130,6 +130,14 @@ meshtastic_Telemetry DeviceTelemetryModule::getLocalStatsTelemetry()
telemetry.variant.local_stats.num_packets_rx_bad = RadioLibInterface::instance->rxBad;
telemetry.variant.local_stats.num_tx_relay = RadioLibInterface::instance->txRelay;
}
#ifdef ARCH_PORTDUINO
if (SimRadio::instance) {
telemetry.variant.local_stats.num_packets_tx = SimRadio::instance->txGood;
telemetry.variant.local_stats.num_packets_rx = SimRadio::instance->rxGood + SimRadio::instance->rxBad;
telemetry.variant.local_stats.num_packets_rx_bad = SimRadio::instance->rxBad;
telemetry.variant.local_stats.num_tx_relay = SimRadio::instance->txRelay;
}
#endif
if (router) {
telemetry.variant.local_stats.num_rx_dupe = router->rxDupe;
telemetry.variant.local_stats.num_tx_relay_canceled = router->txRelayCanceled;

View File

@ -272,6 +272,9 @@ bool loadConfig(const char *configPath)
settingsMap[use_sx1262] = false;
settingsMap[use_rf95] = false;
settingsMap[use_sx1280] = false;
settingsMap[use_lr1110] = false;
settingsMap[use_lr1120] = false;
settingsMap[use_lr1121] = false;
settingsMap[use_sx1268] = false;
if (yamlConfig["Lora"]["Module"] && yamlConfig["Lora"]["Module"].as<std::string>("") == "sx1262") {
@ -280,6 +283,12 @@ bool loadConfig(const char *configPath)
settingsMap[use_rf95] = true;
} else if (yamlConfig["Lora"]["Module"] && yamlConfig["Lora"]["Module"].as<std::string>("") == "sx1280") {
settingsMap[use_sx1280] = true;
} else if (yamlConfig["Lora"]["Module"] && yamlConfig["Lora"]["Module"].as<std::string>("") == "lr1110") {
settingsMap[use_lr1110] = true;
} else if (yamlConfig["Lora"]["Module"] && yamlConfig["Lora"]["Module"].as<std::string>("") == "lr1120") {
settingsMap[use_lr1120] = true;
} else if (yamlConfig["Lora"]["Module"] && yamlConfig["Lora"]["Module"].as<std::string>("") == "lr1121") {
settingsMap[use_lr1121] = true;
} else if (yamlConfig["Lora"]["Module"] && yamlConfig["Lora"]["Module"].as<std::string>("") == "sx1268") {
settingsMap[use_sx1268] = true;
}
@ -420,4 +429,4 @@ bool loadConfig(const char *configPath)
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;
}
}

View File

@ -16,6 +16,9 @@ enum configNames {
ch341Quirk,
use_rf95,
use_sx1280,
use_lr1110,
use_lr1120,
use_lr1121,
use_sx1268,
user,
gpiochip,
@ -67,4 +70,4 @@ extern std::map<configNames, std::string> settingsStrings;
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);
static bool ends_with(std::string_view str, std::string_view suffix);

View File

@ -73,6 +73,10 @@ void SimRadio::handleTransmitInterrupt()
// ignore the transmit interrupt
if (sendingPacket)
completeSending();
isReceiving = true;
if (receivingPacket) // This happens when we don't consider something a collision if we weren't sending long enough
handleReceiveInterrupt();
}
void SimRadio::completeSending()
@ -84,6 +88,8 @@ void SimRadio::completeSending()
if (p) {
txGood++;
if (!isFromUs(p))
txRelay++;
printPacket("Completed sending", p);
// We are done sending that packet, release it
@ -113,12 +119,12 @@ bool SimRadio::canSendImmediately()
bool SimRadio::isActivelyReceiving()
{
return false; // TODO check how this should be simulated
return receivingPacket != nullptr;
}
bool SimRadio::isChannelActive()
{
return false; // TODO ask simulator
return receivingPacket != nullptr;
}
/** Attempt to cancel a previously sent packet. Returns true if a packet was found we could cancel */
@ -142,10 +148,16 @@ void SimRadio::onNotify(uint32_t notification)
startTransmitTimer();
break;
case ISR_RX:
handleReceiveInterrupt();
// LOG_DEBUG("rx complete - starting timer");
startTransmitTimer();
break;
case TRANSMIT_DELAY_COMPLETED:
if (receivingPacket) { // This happens when we had a timer pending and we started receiving
handleReceiveInterrupt();
startTransmitTimer();
break;
}
LOG_DEBUG("delay done");
// If we are not currently in receive mode, then restart the random delay (this can happen if the main thread
@ -183,6 +195,7 @@ void SimRadio::onNotify(uint32_t notification)
void SimRadio::startSend(meshtastic_MeshPacket *txp)
{
printPacket("Start low level send", txp);
isReceiving = false;
size_t numbytes = beginSending(txp);
meshtastic_MeshPacket *p = packetPool.allocCopy(*txp);
perhapsDecode(p);
@ -201,15 +214,64 @@ void SimRadio::startSend(meshtastic_MeshPacket *txp)
service->sendQueueStatusToPhone(router->getQueueStatus(), 0, p->id);
service->sendToPhone(p); // Sending back to simulator
service->loop(); // Process the send immediately
}
// Simulates device received a packet via the LoRa chip
void SimRadio::unpackAndReceive(meshtastic_MeshPacket &p)
{
// Simulator packet (=Compressed packet) is encapsulated in a MeshPacket, so need to unwrap first
meshtastic_Compressed scratch;
meshtastic_Compressed *decoded = NULL;
if (p.which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
memset(&scratch, 0, sizeof(scratch));
p.decoded.payload.size =
pb_decode_from_bytes(p.decoded.payload.bytes, p.decoded.payload.size, &meshtastic_Compressed_msg, &scratch);
if (p.decoded.payload.size) {
decoded = &scratch;
// Extract the original payload and replace
memcpy(&p.decoded.payload, &decoded->data, sizeof(decoded->data));
// Switch the port from PortNum_SIMULATOR_APP back to the original PortNum
p.decoded.portnum = decoded->portnum;
} else
LOG_ERROR("Error decoding proto for simulator message!");
}
// Let SimRadio receive as if it did via its LoRa chip
startReceive(&p);
}
void SimRadio::startReceive(meshtastic_MeshPacket *p)
{
#ifdef USERPREFS_SIMRADIO_EMULATE_COLLISIONS
if (isActivelyReceiving()) {
LOG_WARN("Collision detected, dropping current and previous packet!");
rxBad++;
airTime->logAirtime(RX_ALL_LOG, getPacketTime(receivingPacket));
packetPool.release(receivingPacket);
receivingPacket = nullptr;
return;
} else if (sendingPacket) {
uint32_t airtimeLeft = tillRun(millis());
if (airtimeLeft <= 0) {
LOG_WARN("Transmitting packet was already done");
handleTransmitInterrupt(); // Finish sending first
} else if ((interval - airtimeLeft) > preambleTimeMsec) {
// Only if transmitting for longer than preamble there is a collision
// (channel should actually be detected as active otherwise)
LOG_WARN("Collision detected during transmission!");
return;
}
}
isReceiving = true;
size_t length = getPacketLength(p);
uint32_t xmitMsec = getPacketTime(length);
delay(xmitMsec); // Model the time it is busy receiving
handleReceiveInterrupt(p);
receivingPacket = packetPool.allocCopy(*p);
uint32_t airtimeMsec = getPacketTime(p);
notifyLater(airtimeMsec, ISR_RX, false); // Model the time it is busy receiving
#else
isReceiving = true;
receivingPacket = packetPool.allocCopy(*p);
handleReceiveInterrupt(); // Simulate receiving the packet immediately
startTransmitTimer();
#endif
}
meshtastic_QueueStatus SimRadio::getQueueStatus()
@ -223,28 +285,27 @@ meshtastic_QueueStatus SimRadio::getQueueStatus()
return qs;
}
void SimRadio::handleReceiveInterrupt(meshtastic_MeshPacket *p)
void SimRadio::handleReceiveInterrupt()
{
LOG_DEBUG("HANDLE RECEIVE INTERRUPT");
uint32_t xmitMsec;
if (receivingPacket == nullptr) {
return;
}
if (!isReceiving) {
LOG_DEBUG("*** WAS_ASSERT *** handleReceiveInterrupt called when not in receive mode");
return;
}
isReceiving = false;
LOG_DEBUG("HANDLE RECEIVE INTERRUPT");
rxGood++;
// read the number of actually received bytes
size_t length = getPacketLength(p);
xmitMsec = getPacketTime(length);
// LOG_DEBUG("Payload size %d vs length (includes header) %d", p->decoded.payload.size, length);
meshtastic_MeshPacket *mp = packetPool.allocCopy(*p); // keep a copy in packetPool
meshtastic_MeshPacket *mp = packetPool.allocCopy(*receivingPacket); // keep a copy in packetPool
packetPool.release(receivingPacket); // release the original
receivingPacket = nullptr;
printPacket("Lora RX", mp);
airTime->logAirtime(RX_LOG, xmitMsec);
airTime->logAirtime(RX_LOG, getPacketTime(mp));
deliverToReceiver(mp);
}
@ -265,4 +326,4 @@ int16_t SimRadio::readData(uint8_t *data, size_t len)
}
return state;
}
}

View File

@ -11,11 +11,6 @@ class SimRadio : public RadioInterface, protected concurrency::NotifiedWorkerThr
{
enum PendingISR { ISR_NONE = 0, ISR_RX, ISR_TX, TRANSMIT_DELAY_COMPLETED };
/**
* Debugging counts
*/
uint32_t rxBad = 0, rxGood = 0, txGood = 0;
MeshPacketQueue txQueue = MeshPacketQueue(MAX_TX_QUEUE);
public:
@ -47,9 +42,17 @@ class SimRadio : public RadioInterface, protected concurrency::NotifiedWorkerThr
meshtastic_QueueStatus getQueueStatus() override;
// Convert Compressed_msg to normal msg and receive it
void unpackAndReceive(meshtastic_MeshPacket &p);
/**
* Debugging counts
*/
uint32_t rxBad = 0, rxGood = 0, txGood = 0, txRelay = 0;
protected:
/// are _trying_ to receive a packet currently (note - we might just be waiting for one)
bool isReceiving = false;
bool isReceiving = true;
private:
void setTransmitDelay();
@ -61,7 +64,7 @@ class SimRadio : public RadioInterface, protected concurrency::NotifiedWorkerThr
void startTransmitTimerSNR(float snr);
void handleTransmitInterrupt();
void handleReceiveInterrupt(meshtastic_MeshPacket *p);
void handleReceiveInterrupt();
void onNotify(uint32_t notification);
@ -73,6 +76,8 @@ class SimRadio : public RadioInterface, protected concurrency::NotifiedWorkerThr
int16_t readData(uint8_t *str, size_t len);
meshtastic_MeshPacket *receivingPacket = nullptr; // The packet we are currently receiving
protected:
/** Could we send right now (i.e. either not actively receiving or transmitting)? */
virtual bool canSendImmediately();

View File

@ -11,6 +11,9 @@
#ifndef HAS_WIFI
#define HAS_WIFI 1
#endif
#ifndef HAS_RADIO
#define HAS_RADIO 1
#endif
#ifndef HAS_RTC
#define HAS_RTC 1
#endif

View File

@ -1,107 +0,0 @@
#ifndef _USERPREFS_
#define _USERPREFS_
// Slipstream values:
#define USERPREFS_TZ_STRING "tzplaceholder "
// Uncomment and modify to set device defaults
// #define USERPREFS_EVENT_MODE 1
// #define USERPREFS_CONFIG_LORA_REGION meshtastic_Config_LoRaConfig_RegionCode_US
// #define USERPREFS_LORACONFIG_MODEM_PRESET meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST
// #define USERPREFS_LORACONFIG_CHANNEL_NUM 31
// #define USERPREFS_CONFIG_LORA_IGNORE_MQTT true
// #define USERPREFS_CONFIG_GPS_MODE meshtastic_Config_PositionConfig_GpsMode_ENABLED
// #define USERPREFS_CHANNELS_TO_WRITE 3
/*
#define USERPREFS_CHANNEL_0_PSK \
{ \
0x38, 0x4b, 0xbc, 0xc0, 0x1d, 0xc0, 0x22, 0xd1, 0x81, 0xbf, 0x36, 0xb8, 0x61, 0x21, 0xe1, 0xfb, 0x96, 0xb7, 0x2e, 0x55, \
0xbf, 0x74, 0x22, 0x7e, 0x9d, 0x6a, 0xfb, 0x48, 0xd6, 0x4c, 0xb1, 0xa1 \
}
*/
// #define USERPREFS_CHANNEL_0_NAME "DEFCONnect"
// #define USERPREFS_CHANNEL_0_PRECISION 14
// #define USERPREFS_CHANNEL_0_UPLINK_ENABLED true
// #define USERPREFS_CHANNEL_0_DOWNLINK_ENABLED true
/*
#define USERPREFS_CHANNEL_1_PSK \
{ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \
}
*/
// #define USERPREFS_CHANNEL_1_NAME "REPLACEME"
// #define USERPREFS_CHANNEL_1_PRECISION 14
// #define USERPREFS_CHANNEL_1_UPLINK_ENABLED true
// #define USERPREFS_CHANNEL_1_DOWNLINK_ENABLED true
/*
#define USERPREFS_CHANNEL_2_PSK \
{ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \
}
*/
// #define USERPREFS_CHANNEL_2_NAME "REPLACEME"
// #define USERPREFS_CHANNEL_2_PRECISION 14
// #define USERPREFS_CHANNEL_2_UPLINK_ENABLED true
// #define USERPREFS_CHANNEL_2_DOWNLINK_ENABLED true
// #define USERPREFS_CONFIG_OWNER_LONG_NAME "My Long Name"
// #define USERPREFS_CONFIG_OWNER_SHORT_NAME "MLN"
// #define USERPREFS_SPLASH_TITLE "DEFCONtastic"
// #define icon_width 34
// #define icon_height 29
// #define USERPREFS_HAS_SPLASH
/*
static unsigned char icon_bits[] = {
0x00, 0xC0, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0x00, 0x00, 0x00,
0x9E, 0xE7, 0x00, 0x00, 0x00, 0x0E, 0xC7, 0x01, 0x00, 0x1C, 0x0F, 0xC7, 0x01, 0x00, 0x1C, 0xDF, 0xE7, 0x63, 0x00, 0x1C, 0xFF,
0xBF, 0xE1, 0x00, 0x3C, 0xF3, 0xBF, 0xE3, 0x00, 0x7F, 0xF7, 0xBF, 0xF1, 0x00, 0xFF, 0xF7, 0xBF, 0xF9, 0x03, 0xFF, 0xE7, 0x9F,
0xFF, 0x03, 0xC0, 0xCF, 0xEF, 0xDF, 0x03, 0x00, 0xDF, 0xE3, 0x8F, 0x00, 0x00, 0x7C, 0xFB, 0x03, 0x00, 0x00, 0xF8, 0xFF, 0x00,
0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0x00, 0x78, 0x3F, 0x00, 0x00, 0x00, 0xFC, 0xFC, 0x00, 0x00,
0x98, 0x3F, 0xF0, 0x23, 0x00, 0xFC, 0x0F, 0xE0, 0x7F, 0x00, 0xFC, 0x03, 0x80, 0xFF, 0x01, 0xFC, 0x00, 0x00, 0x3E, 0x00, 0x70,
0x00, 0x00, 0x1C, 0x00, 0x70, 0x00, 0x00, 0x1C, 0x00, 0x70, 0x00, 0x00, 0x1C, 0x00, 0x70, 0x00, 0x00, 0x1C, 0x00};
*/
/*
* PKI Admin keys.
* If a Admin key is set with '{};'
* then it will be ignored, a PKI key must have a size of 32 byte.
*/
/*
#define USERPREFS_USE_ADMIN_KEY_0 \
{ \
0xcd, 0xc0, 0xb4, 0x3c, 0x53, 0x24, 0xdf, 0x13, 0xca, 0x5a, 0xa6, 0x0c, 0x0d, 0xec, 0x85, 0x5a, 0x4c, 0xf6, 0x1a, 0x96, \
0x04, 0x1a, 0x3e, 0xfc, 0xbb, 0x8e, 0x33, 0x71, 0xe5, 0xfc, 0xff, 0x3c \
};
*/
// #define USERPREFS_USE_ADMIN_KEY_1 {};
// #define USERPREFS_USE_ADMIN_KEY_2 {};
/*
* USERPREF_FIXED_GPS_LAT and USERPREF_FIXED_GPS_LON must be set, USERPREF_FIXED_GPS_ALT is optional
*
* Fixed GPS is Eiffel Tower, Paris, France
*/
// #define USERPREFS_FIXED_GPS
// #define USERPREFS_FIXED_GPS_LAT 48.85873920
// #define USERPREFS_FIXED_GPS_LON 2.294508368
// #define USERPREFS_FIXED_GPS_ALT 0
/*
* Set Fixed Bluetooth paring code
*/
// #define USERPREFS_FIXED_BLUETOOTH 121212
/*
* Will overwrite BUTTON_PIN if set
*/
// #define USERPREFS_BUTTON_PIN 36
#endif

View File

@ -1,16 +0,0 @@
{
"USERPREFS_CHANNEL_0_NAME": "\"DEFCONnect\"",
"USERPREFS_CHANNEL_0_PRECISION": "14",
"USERPREFS_CHANNEL_0_PSK": "{ 0x38, 0x4b, 0xbc, 0xc0, 0x1d, 0xc0, 0x22, 0xd1, 0x81, 0xbf, 0x36, 0xb8, 0x61, 0x21, 0xe1, 0xfb, 0x96, 0xb7, 0x2e, 0x55, 0xbf, 0x74, 0x22, 0x7e, 0x9d, 0x6a, 0xfb, 0x48, 0xd6, 0x4c, 0xb1, 0xa1 }",
"USERPREFS_CONFIG_LORA_IGNORE_MQTT": "true",
"USERPREFS_CONFIG_LORA_REGION": "meshtastic_Config_LoRaConfig_RegionCode_US",
"USERPREFS_CONFIG_OWNER_LONG_NAME": "\"My Long Name\"",
"USERPREFS_CONFIG_OWNER_SHORT_NAME": "\"MLN\"",
"USERPREFS_EVENT_MODE": "1",
"USERPREFS_HAS_SPLASH": "",
"USERPREFS_LORACONFIG_CHANNEL_NUM": "31",
"USERPREFS_LORACONFIG_MODEM_PRESET": "meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST",
"USERPREFS_SPLASH_TITLE": "\"DEFCONtastic\"",
"USERPREFS_TZ_STRING": "\"tzplaceholder \"",
"USERPREFS_USE_ADMIN_KEY": "1"
}

37
userPrefs.jsonc Normal file
View File

@ -0,0 +1,37 @@
{
// "USERPREFS_BUTTON_PIN": "36",
// "USERPREFS_CHANNELS_TO_WRITE": "3",
// "USERPREFS_CHANNEL_0_DOWNLINK_ENABLED": "true",
// "USERPREFS_CHANNEL_0_NAME": "DEFCONnect",
// "USERPREFS_CHANNEL_0_PRECISION": "14",
// "USERPREFS_CHANNEL_0_PSK": "{ 0x38, 0x4b, 0xbc, 0xc0, 0x1d, 0xc0, 0x22, 0xd1, 0x81, 0xbf, 0x36, 0xb8, 0x61, 0x21, 0xe1, 0xfb, 0x96, 0xb7, 0x2e, 0x55, 0xbf, 0x74, 0x22, 0x7e, 0x9d, 0x6a, 0xfb, 0x48, 0xd6, 0x4c, 0xb1, 0xa1 }",
// "USERPREFS_CHANNEL_0_UPLINK_ENABLED": "true",
// "USERPREFS_CHANNEL_1_DOWNLINK_ENABLED": "true",
// "USERPREFS_CHANNEL_1_NAME": "REPLACEME",
// "USERPREFS_CHANNEL_1_PRECISION": "14",
// "USERPREFS_CHANNEL_1_PSK": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }",
// "USERPREFS_CHANNEL_1_UPLINK_ENABLED": "true",
// "USERPREFS_CHANNEL_2_DOWNLINK_ENABLED": "true",
// "USERPREFS_CHANNEL_2_NAME": "REPLACEME",
// "USERPREFS_CHANNEL_2_PRECISION": "14",
// "USERPREFS_CHANNEL_2_PSK": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }",
// "USERPREFS_CHANNEL_2_UPLINK_ENABLED": "true",
// "USERPREFS_CONFIG_GPS_MODE": "meshtastic_Config_PositionConfig_GpsMode_ENABLED",
// "USERPREFS_CONFIG_LORA_IGNORE_MQTT": "true",
// "USERPREFS_CONFIG_LORA_REGION": "meshtastic_Config_LoRaConfig_RegionCode_US",
// "USERPREFS_CONFIG_OWNER_LONG_NAME": "My Long Name",
// "USERPREFS_CONFIG_OWNER_SHORT_NAME": "MLN",
// "USERPREFS_EVENT_MODE": "1",
// "USERPREFS_FIXED_BLUETOOTH": "121212",
// "USERPREFS_FIXED_GPS": "",
// "USERPREFS_FIXED_GPS_ALT": "0",
// "USERPREFS_FIXED_GPS_LAT": "48.85873920",
// "USERPREFS_FIXED_GPS_LON": "2.294508368",
// "USERPREFS_LORACONFIG_CHANNEL_NUM": "31",
// "USERPREFS_LORACONFIG_MODEM_PRESET": "meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST",
// "USERPREFS_SPLASH_TITLE": "DEFCONtastic",
"USERPREFS_TZ_STRING": "tzplaceholder "
// "USERPREFS_USE_ADMIN_KEY_0": "{ 0xcd, 0xc0, 0xb4, 0x3c, 0x53, 0x24, 0xdf, 0x13, 0xca, 0x5a, 0xa6, 0x0c, 0x0d, 0xec, 0x85, 0x5a, 0x4c, 0xf6, 0x1a, 0x96, 0x04, 0x1a, 0x3e, 0xfc, 0xbb, 0x8e, 0x33, 0x71, 0xe5, 0xfc, 0xff, 0x3c }",
// "USERPREFS_USE_ADMIN_KEY_1": "{}",
// "USERPREFS_USE_ADMIN_KEY_2": "{}"
}

View File

@ -40,6 +40,7 @@
// // Buzzer
// #define PIN_BUZZER 19
#define GPS_DEFAULT_NOT_PRESENT 1
#define GPS_RX_PIN 20
#define GPS_TX_PIN 19
#define HAS_GPS 1

View File

@ -41,7 +41,7 @@ L76K GPS Module Information : https://www.seeedstudio.com/L76K-GNSS-Module-for-S
L76K Expansion Board can not directly used, L76K Reset Pin needs to override or physically remove it,
otherwise it will conflict with the SPI pins
*/
// #define GPS_L76K
#define GPS_L76K
#ifdef GPS_L76K
#define GPS_RX_PIN 44
#define GPS_TX_PIN 43
@ -81,4 +81,4 @@ 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_DIO3_TCXO_VOLTAGE 1.8
#endif
#endif

View File

@ -29,7 +29,7 @@
#define BUTTON_PIN 0
// #define BUTTON_NEED_PULLUP
#define GPS_DEFAULT_NOT_PRESENT 1
#define GPS_RX_PIN 44
#define GPS_TX_PIN 43

View File

@ -19,6 +19,7 @@
#define I2C_SCL SCL
// external qwiic connector
#define GPS_DEFAULT_NOT_PRESENT 1
#define GPS_RX_PIN 44
#define GPS_TX_PIN 43