mirror of
https://github.com/meshtastic/firmware.git
synced 2025-07-30 02:15:41 +00:00
Merge branch 'master' into 2264-feature-check-for-low-heap-before-adding-to-nodedb-was-reboot-loop-heap-too-low
This commit is contained in:
commit
a284439d7e
@ -35,7 +35,7 @@ lib_deps =
|
||||
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||
h2zero/NimBLE-Arduino@^1.4.0
|
||||
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
||||
caveman99/ESP32 Codec2@^1.0.1
|
||||
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||
|
||||
lib_ignore =
|
||||
segger_rtt
|
||||
|
@ -34,8 +34,7 @@ lib_deps =
|
||||
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||
h2zero/NimBLE-Arduino@^1.4.0
|
||||
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
||||
caveman99/ESP32 Codec2@^1.0.1
|
||||
|
||||
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||
lib_ignore =
|
||||
segger_rtt
|
||||
ESP32 BLE Arduino
|
||||
|
@ -35,7 +35,7 @@ lib_deps =
|
||||
${environmental_base.lib_deps}
|
||||
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
||||
caveman99/ESP32 Codec2@^1.0.1
|
||||
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||
|
||||
lib_ignore =
|
||||
segger_rtt
|
||||
|
@ -35,7 +35,7 @@ lib_deps =
|
||||
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||
h2zero/NimBLE-Arduino@^1.4.0
|
||||
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
||||
caveman99/ESP32 Codec2@^1.0.1
|
||||
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||
|
||||
lib_ignore =
|
||||
segger_rtt
|
||||
|
38
bin/generate_ci_matrix.py
Executable file
38
bin/generate_ci_matrix.py
Executable file
@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""Generate the CI matrix"""
|
||||
|
||||
import configparser
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
rootdir = "variants/"
|
||||
|
||||
options = sys.argv[1:]
|
||||
|
||||
outlist = []
|
||||
|
||||
if len(options) < 1:
|
||||
print(json.dumps(outlist))
|
||||
exit()
|
||||
|
||||
for subdir, dirs, files in os.walk(rootdir):
|
||||
for file in files:
|
||||
if file == "platformio.ini":
|
||||
config = configparser.ConfigParser()
|
||||
config.read(subdir + "/" + file)
|
||||
for c in config.sections():
|
||||
if c.startswith("env:"):
|
||||
section = config[c].name[4:]
|
||||
if "extends" in config[config[c].name]:
|
||||
if config[config[c].name]["extends"] == options[0] + "_base":
|
||||
if "board_level" in config[config[c].name]:
|
||||
if (
|
||||
config[config[c].name]["board_level"] == "extra"
|
||||
) & ("extra" in options):
|
||||
outlist.append(section)
|
||||
else:
|
||||
outlist.append(section)
|
||||
|
||||
print(json.dumps(outlist))
|
@ -1 +1 @@
|
||||
Subproject commit 5f00ad5691ae7d8a03fd92437b81e9a424e3483f
|
||||
Subproject commit ee6f408bb3c27b8ca820477cbb3a84ac6c8b0ffc
|
@ -123,14 +123,10 @@ class ButtonThread : public concurrency::OSThread
|
||||
static void userButtonPressedLong()
|
||||
{
|
||||
// LOG_DEBUG("Long press!\n");
|
||||
// If user button is held down for 5 seconds, shutdown the device.
|
||||
if ((millis() - longPressTime > 5 * 1000) && (longPressTime > 0)) {
|
||||
#ifdef HAS_PMU
|
||||
if (pmu_found == true) {
|
||||
setLed(false);
|
||||
power->shutdown();
|
||||
}
|
||||
#elif defined(ARCH_NRF52) || defined(ARCH_ESP32)
|
||||
screen->adjustBrightness();
|
||||
// If user button is held down for 10 seconds, shutdown the device.
|
||||
if ((millis() - longPressTime > 10000) && (longPressTime > 0)) {
|
||||
#if defined(ARCH_NRF52) || defined(ARCH_ESP32)
|
||||
// Do actual shutdown when button released, otherwise the button release
|
||||
// may wake the board immediatedly.
|
||||
if ((!shutdown_on_long_stop) && (millis() > 30 * 1000)) {
|
||||
|
@ -277,12 +277,11 @@ void Power::shutdown()
|
||||
LOG_INFO("Shutting down\n");
|
||||
|
||||
#ifdef HAS_PMU
|
||||
if (PMU) {
|
||||
if (pmu_found == true) {
|
||||
PMU->setChargingLedMode(XPOWERS_CHG_LED_OFF);
|
||||
PMU->shutdown();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ARCH_NRF52) || defined(ARCH_ESP32)
|
||||
#elif defined(ARCH_NRF52) || defined(ARCH_ESP32)
|
||||
#ifdef PIN_LED1
|
||||
ledOff(PIN_LED1);
|
||||
#endif
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include "CryptoEngine.h"
|
||||
#include "configuration.h"
|
||||
|
||||
concurrency::Lock *cryptLock;
|
||||
|
||||
void CryptoEngine::setKey(const CryptoKey &k)
|
||||
{
|
||||
LOG_DEBUG("Using AES%d key!\n", k.length * 8);
|
||||
|
@ -1,7 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "concurrency/LockGuard.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
extern concurrency::Lock *cryptLock;
|
||||
|
||||
struct CryptoKey {
|
||||
uint8_t bytes[32];
|
||||
|
||||
|
@ -689,11 +689,11 @@ void NodeDB::updateTelemetry(uint32_t nodeId, const meshtastic_Telemetry &t, RxS
|
||||
|
||||
/** Update user info for this node based on received user data
|
||||
*/
|
||||
void NodeDB::updateUser(uint32_t nodeId, const meshtastic_User &p)
|
||||
bool NodeDB::updateUser(uint32_t nodeId, const meshtastic_User &p)
|
||||
{
|
||||
meshtastic_NodeInfo *info = getOrCreateNode(nodeId);
|
||||
if (!info) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
LOG_DEBUG("old user %s/%s/%s\n", info->user.id, info->user.long_name, info->user.short_name);
|
||||
@ -713,6 +713,8 @@ void NodeDB::updateUser(uint32_t nodeId, const meshtastic_User &p)
|
||||
// We just changed something important about the user, store our DB
|
||||
saveToDisk(SEGMENT_DEVICESTATE);
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
/// given a subpacket sniffed from the network, update our DB state
|
||||
|
@ -86,7 +86,7 @@ class NodeDB
|
||||
|
||||
/** Update user info for this node based on received user data
|
||||
*/
|
||||
void updateUser(uint32_t nodeId, const meshtastic_User &p);
|
||||
bool updateUser(uint32_t nodeId, const meshtastic_User &p);
|
||||
|
||||
/// @return our node number
|
||||
NodeNum getNodeNum() { return myNodeInfo.my_node_num; }
|
||||
|
@ -55,6 +55,10 @@ Router::Router() : concurrency::OSThread("Router"), fromRadioQueue(MAX_RX_FROMRA
|
||||
LOG_DEBUG("Size of MeshPacket %d\n", sizeof(MeshPacket)); */
|
||||
|
||||
fromRadioQueue.setReader(this);
|
||||
|
||||
// init Lockguard for crypt operations
|
||||
assert(!cryptLock);
|
||||
cryptLock = new concurrency::Lock();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -305,6 +309,8 @@ void Router::sniffReceived(const meshtastic_MeshPacket *p, const meshtastic_Rout
|
||||
|
||||
bool perhapsDecode(meshtastic_MeshPacket *p)
|
||||
{
|
||||
concurrency::LockGuard g(cryptLock);
|
||||
|
||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER &&
|
||||
config.device.rebroadcast_mode == meshtastic_Config_DeviceConfig_RebroadcastMode_ALL_SKIP_DECODING)
|
||||
return false;
|
||||
@ -371,6 +377,8 @@ bool perhapsDecode(meshtastic_MeshPacket *p)
|
||||
*/
|
||||
meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p)
|
||||
{
|
||||
concurrency::LockGuard g(cryptLock);
|
||||
|
||||
// If the packet is not yet encrypted, do so now
|
||||
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
|
||||
size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_Data_msg, &p->decoded);
|
||||
|
12
src/mesh/generated/meshtastic/clientonly.pb.c
Normal file
12
src/mesh/generated/meshtastic/clientonly.pb.c
Normal file
@ -0,0 +1,12 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "meshtastic/clientonly.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
PB_BIND(meshtastic_DeviceProfile, meshtastic_DeviceProfile, 2)
|
||||
|
||||
|
||||
|
73
src/mesh/generated/meshtastic/clientonly.pb.h
Normal file
73
src/mesh/generated/meshtastic/clientonly.pb.h
Normal file
@ -0,0 +1,73 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_MESHTASTIC_MESHTASTIC_CLIENTONLY_PB_H_INCLUDED
|
||||
#define PB_MESHTASTIC_MESHTASTIC_CLIENTONLY_PB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include "meshtastic/localonly.pb.h"
|
||||
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
/* This abstraction is used to contain any configuration for provisioning a node on any client.
|
||||
It is useful for importing and exporting configurations. */
|
||||
typedef struct _meshtastic_DeviceProfile {
|
||||
/* Long name for the node */
|
||||
bool has_long_name;
|
||||
char long_name[40];
|
||||
/* Short name of the node */
|
||||
bool has_short_name;
|
||||
char short_name[5];
|
||||
/* The url of the channels from our node */
|
||||
pb_callback_t channel_url;
|
||||
/* The Config of the node */
|
||||
bool has_config;
|
||||
meshtastic_LocalConfig config;
|
||||
/* The ModuleConfig of the node */
|
||||
bool has_module_config;
|
||||
meshtastic_LocalModuleConfig module_config;
|
||||
} meshtastic_DeviceProfile;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define meshtastic_DeviceProfile_init_default {false, "", false, "", {{NULL}, NULL}, false, meshtastic_LocalConfig_init_default, false, meshtastic_LocalModuleConfig_init_default}
|
||||
#define meshtastic_DeviceProfile_init_zero {false, "", false, "", {{NULL}, NULL}, false, meshtastic_LocalConfig_init_zero, false, meshtastic_LocalModuleConfig_init_zero}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define meshtastic_DeviceProfile_long_name_tag 1
|
||||
#define meshtastic_DeviceProfile_short_name_tag 2
|
||||
#define meshtastic_DeviceProfile_channel_url_tag 3
|
||||
#define meshtastic_DeviceProfile_config_tag 4
|
||||
#define meshtastic_DeviceProfile_module_config_tag 5
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define meshtastic_DeviceProfile_FIELDLIST(X, a) \
|
||||
X(a, STATIC, OPTIONAL, STRING, long_name, 1) \
|
||||
X(a, STATIC, OPTIONAL, STRING, short_name, 2) \
|
||||
X(a, CALLBACK, OPTIONAL, STRING, channel_url, 3) \
|
||||
X(a, STATIC, OPTIONAL, MESSAGE, config, 4) \
|
||||
X(a, STATIC, OPTIONAL, MESSAGE, module_config, 5)
|
||||
#define meshtastic_DeviceProfile_CALLBACK pb_default_field_callback
|
||||
#define meshtastic_DeviceProfile_DEFAULT NULL
|
||||
#define meshtastic_DeviceProfile_config_MSGTYPE meshtastic_LocalConfig
|
||||
#define meshtastic_DeviceProfile_module_config_MSGTYPE meshtastic_LocalModuleConfig
|
||||
|
||||
extern const pb_msgdesc_t meshtastic_DeviceProfile_msg;
|
||||
|
||||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
||||
#define meshtastic_DeviceProfile_fields &meshtastic_DeviceProfile_msg
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
/* meshtastic_DeviceProfile_size depends on runtime parameters */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
@ -12,7 +12,7 @@ bool NodeInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes
|
||||
{
|
||||
auto p = *pptr;
|
||||
|
||||
nodeDB.updateUser(getFrom(&mp), p);
|
||||
bool hasChanged = nodeDB.updateUser(getFrom(&mp), p);
|
||||
|
||||
bool wasBroadcast = mp.to == NODENUM_BROADCAST;
|
||||
|
||||
@ -23,6 +23,10 @@ bool NodeInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes
|
||||
screen->print(lcd.c_str());
|
||||
}
|
||||
|
||||
// if user has changed while packet was not for us, inform phone
|
||||
if (hasChanged && !wasBroadcast && mp.to != nodeDB.getNodeNum())
|
||||
service.sendToPhone(packetPool.allocCopy(mp));
|
||||
|
||||
// LOG_DEBUG("did handleReceived\n");
|
||||
return false; // Let others look at this message also if they want
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ void esp32Loop()
|
||||
// radio.radioIf.canSleep();
|
||||
}
|
||||
|
||||
void cpuDeepSleep(uint64_t msecToWake)
|
||||
void cpuDeepSleep(uint32_t msecToWake)
|
||||
{
|
||||
/*
|
||||
Some ESP32 IOs have internal pullups or pulldowns, which are enabled by default.
|
||||
|
@ -155,7 +155,7 @@ void nrf52Setup()
|
||||
nRFCrypto.end();
|
||||
}
|
||||
|
||||
void cpuDeepSleep(uint64_t msecToWake)
|
||||
void cpuDeepSleep(uint32_t msecToWake)
|
||||
{
|
||||
// FIXME, configure RTC or button press to wake us
|
||||
// FIXME, power down SPI, I2C, RAMs
|
||||
|
@ -16,7 +16,7 @@ void setBluetoothEnable(bool on)
|
||||
// not needed
|
||||
}
|
||||
|
||||
void cpuDeepSleep(uint64_t msecs)
|
||||
void cpuDeepSleep(uint32_t msecs)
|
||||
{
|
||||
notImplemented("cpuDeepSleep");
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ void setBluetoothEnable(bool on)
|
||||
// not needed
|
||||
}
|
||||
|
||||
void cpuDeepSleep(uint64_t msecs)
|
||||
void cpuDeepSleep(uint32_t msecs)
|
||||
{
|
||||
// not needed
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ void getMacAddr(uint8_t *dmac)
|
||||
dmac[i] = i;
|
||||
}
|
||||
|
||||
void cpuDeepSleep(uint64_t msecToWake) {}
|
||||
void cpuDeepSleep(uint32_t msecToWake) {}
|
||||
|
||||
/* pacify libc_nano */
|
||||
extern "C" {
|
||||
|
@ -19,6 +19,10 @@
|
||||
esp_sleep_source_t wakeCause; // the reason we booted this time
|
||||
#endif
|
||||
|
||||
#ifndef INCLUDE_vTaskSuspend
|
||||
#define INCLUDE_vTaskSuspend 0
|
||||
#endif
|
||||
|
||||
#ifdef HAS_PMU
|
||||
#include "XPowersLibInterface.hpp"
|
||||
extern XPowersLibInterface *PMU;
|
||||
@ -201,9 +205,13 @@ void doGPSpowersave(bool on)
|
||||
#endif
|
||||
}
|
||||
|
||||
void doDeepSleep(uint64_t msecToWake)
|
||||
void doDeepSleep(uint32_t msecToWake)
|
||||
{
|
||||
LOG_INFO("Entering deep sleep for %lu seconds\n", msecToWake / 1000);
|
||||
if (INCLUDE_vTaskSuspend && (msecToWake == portMAX_DELAY)) {
|
||||
LOG_INFO("Entering deep sleep forever\n");
|
||||
} else {
|
||||
LOG_INFO("Entering deep sleep for %u seconds\n", msecToWake / 1000);
|
||||
}
|
||||
|
||||
// not using wifi yet, but once we are this is needed to shutoff the radio hw
|
||||
// esp_wifi_stop();
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "Observer.h"
|
||||
#include "configuration.h"
|
||||
|
||||
void doDeepSleep(uint64_t msecToWake), cpuDeepSleep(uint64_t msecToWake);
|
||||
void doDeepSleep(uint32_t msecToWake), cpuDeepSleep(uint32_t msecToWake);
|
||||
|
||||
#ifdef ARCH_ESP32
|
||||
#include "esp_sleep.h"
|
||||
|
@ -7,7 +7,7 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_eink -
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MakePython_nRF52840_eink>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
caveman99/ESP32 Codec2@^1.0.1
|
||||
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||
zinggjm/GxEPD2@^1.4.9
|
||||
debug_tool = jlink
|
||||
upload_port = /dev/ttyACM4
|
||||
|
@ -6,5 +6,5 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_oled -
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MakePython_nRF52840_oled>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
caveman99/ESP32 Codec2@^1.0.1
|
||||
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||
debug_tool = jlink
|
||||
|
@ -12,7 +12,6 @@ platform_packages =
|
||||
tool-esptoolpy@^1.40500.0
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
caveman99/ESP32 Codec2@^1.0.1
|
||||
zinggjm/GxEPD2@^1.5.1
|
||||
adafruit/Adafruit NeoPixel@^1.10.7
|
||||
build_unflags = -DARDUINO_USB_MODE=1
|
||||
|
@ -12,7 +12,6 @@ platform_packages =
|
||||
tool-esptoolpy@^1.40500.0
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
caveman99/ESP32 Codec2@^1.0.1
|
||||
adafruit/Adafruit NeoPixel@^1.10.7
|
||||
build_unflags = -DARDUINO_USB_MODE=1
|
||||
build_flags =
|
||||
|
@ -2,9 +2,6 @@
|
||||
extends = esp32s3_base
|
||||
board = tlora-t3s3-v1
|
||||
upload_protocol = esp-builtin
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
caveman99/ESP32 Codec2@^1.0.1
|
||||
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D TLORA_T3S3_V1 -I variants/tlora_t3s3_v1
|
@ -1,9 +1,6 @@
|
||||
[env:tlora-v2-1-1.8]
|
||||
extends = esp32_base
|
||||
board = ttgo-lora32-v21
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
caveman99/ESP32 Codec2@^1.0.1
|
||||
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D TLORA_V2_1_18 -I variants/tlora_v2_1_18
|
@ -1,4 +1,4 @@
|
||||
[VERSION]
|
||||
major = 2
|
||||
minor = 1
|
||||
build = 8
|
||||
build = 9
|
||||
|
Loading…
Reference in New Issue
Block a user