mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-18 01:11:42 +10:00
logging: audit log strings for terseness, reclaiming ~6.8 KB of string data (#11374)
* logging: strip redundant punctuation, level prefixes, and 'successfully' from log strings The logger already appends a newline and prints the level tag, so trailing '.', '!', '...', literal \n, and 'Error:'/'Warning:' prefixes inside format strings are wasted flash bytes. Same for 'successfully' (the affirmative form already implies it). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * logging: tighten verbose log strings in modules, radio, platform, and system code Rewrite wordy log messages to terser equivalents - drop filler words (articles, 'attempting', 'due to', 'please'), use 'Can't X'/'X failed' phrasing, and abbreviate where the codebase already does (config, init, msg, BT). Format specifiers and argument lists are unchanged; distinctive greppable tokens are preserved. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * logging: tighten verbose log strings in telemetry sensors and GPS Same terseness pass: drop filler, 'Can't X'/'X failed' phrasing, common abbreviations (temp, msg). Specifiers, arguments, and sensor-name prefixes unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * logging: tighten verbose log strings in mesh core Same terseness pass over NodeDB, Router, MeshService, PhoneAPI, RadioInterface, NextHopRouter, and PacketHistory: 'X failed'/'Can't X' phrasing, imperative verbs, dropped filler. Specifiers and arguments unchanged; duplicate literals kept identical to preserve linker string dedup. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * logging: 'Unable to/Could not/Cannot' -> "Can't" in log strings Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * logging: clang-format rewrap after string shortening Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * logging: restore boot-logo trailing newline and progress-dot strings The terseness pass over-trimmed: the Meshtastic ASCII boot logo kept its blank line via a trailing \n, and three bare "." progress ticks were reduced to empty strings. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * Update src/mesh/wifi/WiFiAPClient.cpp Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * logging: address review feedback on the terseness audit - Node/packet IDs use the repo's 0x%08x convention in NextHopRouter, NodeDB, AdminModule and CannedMessageModule. The sibling log in each if/else pair is converted too, so a pair isn't split across two formats. next_hop stays 0x%x - it's the last-byte relay hint, not a NodeNum. - RTC: the read-path and set-path "not found" warnings were byte-identical, so the linker deduped them and the log couldn't say which one fired. Split into "RTC read:" / "RTC set:". (The four sites live in mutually exclusive #ifdef branches, so the RTC family was never ambiguous.) - SCD4X getAmbientPressure()/setAmbientPressure() logged "altitude", and SCD30 getASC() logged "Can't send command" for a read. Both now name the operation they actually perform. - LOG_ERROR already carries the level: ". Error: %u" -> ", rc=%u" (matching the existing rc=%d house style) and "Error executing X()" -> "X() failed". - Typos and wording: "OTA partiton. (Reason" -> "OTA partition (reason", "CST3530 not response ~" -> "CST3530 no response", "Packet received with to: of 0" -> "to=0", HostMetrics "Error decoding" -> "Can't decode", and the dangling ": " on the NextHopRouter retransmission line. Printf specifier sequences are byte-identical on all 37 touched lines apart from the 6 deliberate %x/%u -> %08x node-ID widenings, all on uint32_t args. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
co-authored by
Claude Opus 5
coderabbitai[bot]
Ben Meadors
parent
5692518306
commit
cd716fe384
@@ -336,7 +336,7 @@ bool CryptoEngine::setDHPublicKey(uint8_t *pubKey)
|
||||
// Calculate the shared secret with the specified node's public key and our private key
|
||||
// This includes an internal weak key check, which among other things looks for an all 0 public key and shared key.
|
||||
if (!Curve25519::dh2(shared_key, local_priv)) {
|
||||
LOG_WARN("Curve25519DH step 2 failed!");
|
||||
LOG_WARN("Curve25519DH step 2 failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -373,7 +373,7 @@ concurrency::Lock *cryptLock;
|
||||
|
||||
void CryptoEngine::setKey(const CryptoKey &k)
|
||||
{
|
||||
LOG_DEBUG("Use AES%d key!", k.length * 8);
|
||||
LOG_DEBUG("Use AES%d key", k.length * 8);
|
||||
key = k;
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ void CryptoEngine::encryptPacket(uint32_t fromNode, uint64_t packetId, size_t nu
|
||||
if (numBytes <= MAX_BLOCKSIZE) {
|
||||
encryptAESCtr(key, nonce, numBytes, bytes);
|
||||
} else {
|
||||
LOG_ERROR("Packet too large for crypto engine: %d. noop encryption!", numBytes);
|
||||
LOG_ERROR("Packet too large for crypto engine: %d. noop encryption", numBytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,7 +486,7 @@ bool SensecapIndicator::handle_packet(size_t payload_len)
|
||||
LOG_WARN("Request 0x%08x nacked by the co-processor", expected_id);
|
||||
request_nacked = true;
|
||||
} else if (message.id == 0) {
|
||||
LOG_WARN("Co-processor could not decode a frame");
|
||||
LOG_WARN("Co-processor can't decode a frame");
|
||||
}
|
||||
return true;
|
||||
case meshtastic_InterdeviceMessage_sd_info_tag:
|
||||
|
||||
@@ -104,11 +104,11 @@ template <typename T> bool LR11x0Interface<T>::init()
|
||||
|
||||
// DIO3 is free to be used as an IRQ only while no TCXO Vref is driven on it
|
||||
if (tcxoVoltage > 0)
|
||||
LOG_DEBUG("LR11x0 TCXO Vref %f V on DIO3 (DIO3 unavailable as an IRQ)", tcxoVoltage);
|
||||
LOG_DEBUG("LR11x0 TCXO Vref %f V on DIO3 (DIO3 unavailable as IRQ)", tcxoVoltage);
|
||||
else
|
||||
LOG_DEBUG("LR11x0 no TCXO Vref, XTAL only (DIO3 free as an IRQ)");
|
||||
LOG_DEBUG("LR11x0 no TCXO Vref, XTAL only (DIO3 free as IRQ)");
|
||||
#if defined(TCXO_OPTIONAL)
|
||||
LOG_DEBUG("TCXO_OPTIONAL: oscillator type unknown, probing XTAL first and using any TCXO Vref only as fallback");
|
||||
LOG_DEBUG("TCXO_OPTIONAL: osc type unknown, probe XTAL first, TCXO Vref as fallback");
|
||||
#endif
|
||||
|
||||
RadioLibInterface::init();
|
||||
@@ -156,7 +156,7 @@ template <typename T> bool LR11x0Interface<T>::init()
|
||||
#if defined(TCXO_OPTIONAL)
|
||||
// 2. XTAL failed with the chip present, so fall back to the TCXO if the variant configured one
|
||||
if (res != RADIOLIB_ERR_NONE && res != RADIOLIB_ERR_CHIP_NOT_FOUND && tcxoVoltage > 0) {
|
||||
LOG_WARN("LR11x0 XTAL init failed (err %d), retrying with TCXO Vref %f V", res, tcxoVoltage);
|
||||
LOG_WARN("LR11x0 XTAL init failed (err %d), retry with TCXO Vref %f V", res, tcxoVoltage);
|
||||
attemptVoltage = tcxoVoltage;
|
||||
res = tryBegin(2, attemptVoltage);
|
||||
if (res == RADIOLIB_ERR_NONE)
|
||||
@@ -167,7 +167,7 @@ template <typename T> bool LR11x0Interface<T>::init()
|
||||
// 3. Some units need extra settling time, so give whichever oscillator we settled on one retry.
|
||||
// After a step 2 fallback that is a second TCXO attempt, which is where settling actually matters.
|
||||
if (lr11x0SpiFailed(res)) {
|
||||
LOG_WARN("LR11x0 init failed with %d (SPI command failure), retrying after delay...", res);
|
||||
LOG_WARN("LR11x0 init failed with %d (SPI cmd failure), retry after delay", res);
|
||||
delay(100);
|
||||
res = tryBegin(3, attemptVoltage);
|
||||
}
|
||||
@@ -179,9 +179,9 @@ template <typename T> bool LR11x0Interface<T>::init()
|
||||
#ifdef LR11X0_UPDATE_FIRMWARE_TO
|
||||
// An interrupted update leaves the radio sitting in bootloader mode, where begin() fails. Retry the
|
||||
// flash from here rather than giving up, otherwise the device could never recover on its own.
|
||||
LOG_WARN("LR11x0 did not start; attempting firmware recovery in case an update was interrupted");
|
||||
LOG_WARN("LR11x0 did not start; firmware recovery in case update was interrupted");
|
||||
if (lora.updateFirmware(lr11xx_firmware_image, LR11XX_FIRMWARE_IMAGE_SIZE, true) == RADIOLIB_ERR_NONE) {
|
||||
LOG_INFO("LR1110 firmware recovery succeeded, re-initializing radio");
|
||||
LOG_INFO("LR1110 firmware recovery OK, re-init radio");
|
||||
res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage);
|
||||
}
|
||||
#endif
|
||||
@@ -202,8 +202,8 @@ template <typename T> bool LR11x0Interface<T>::init()
|
||||
// One-shot transceiver firmware update, opt-in per variant. Only runs when the part is an LR1110 running
|
||||
// older firmware than the baked-in image, so once it has succeeded it is a no-op on subsequent boots.
|
||||
if (transceiverDevice == RADIOLIB_LR11X0_DEVICE_LR1110 && transceiverFw != 0 && transceiverFw < LR11X0_UPDATE_FIRMWARE_TO) {
|
||||
LOG_WARN("LR1110 transceiver FW %d.%d is older than %d.%d - updating now. DO NOT POWER OFF: this "
|
||||
"erases and rewrites the radio's own flash.",
|
||||
LOG_WARN("LR1110 transceiver FW %d.%d older than %d.%d - updating. DO NOT POWER OFF: "
|
||||
"rewrites radio's own flash",
|
||||
transceiverFw >> 8, transceiverFw & 0xFF, LR11X0_UPDATE_FIRMWARE_TO >> 8, LR11X0_UPDATE_FIRMWARE_TO & 0xFF);
|
||||
|
||||
int upd = lora.updateFirmware(lr11xx_firmware_image, LR11XX_FIRMWARE_IMAGE_SIZE, true);
|
||||
@@ -214,7 +214,7 @@ template <typename T> bool LR11x0Interface<T>::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
LOG_INFO("LR1110 firmware update complete, re-initializing radio");
|
||||
LOG_INFO("LR1110 firmware update complete, re-init radio");
|
||||
res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage);
|
||||
if (res != RADIOLIB_ERR_NONE) {
|
||||
LOG_ERROR("LR11x0 re-init after firmware update failed %s%d", radioLibErr, res);
|
||||
@@ -259,7 +259,7 @@ template <typename T> bool LR11x0Interface<T>::init()
|
||||
LOG_INFO("Set RX gain to boosted mode; result: %d", res);
|
||||
} else {
|
||||
res = lora.setRxBoostedGainMode(false);
|
||||
LOG_INFO("Set RX gain to power saving mode (boosted mode off); result: %d", res);
|
||||
LOG_INFO("Set RX gain to power saving mode; result: %d", res);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ template <typename T> void LR11x0Interface<T>::setStandby()
|
||||
int err = lora.standby();
|
||||
|
||||
if (err != RADIOLIB_ERR_NONE) {
|
||||
LOG_DEBUG("LR11x0 standby failed with error %d", err);
|
||||
LOG_DEBUG("LR11x0 standby failed, err %d", err);
|
||||
}
|
||||
|
||||
assert(err == RADIOLIB_ERR_NONE);
|
||||
|
||||
@@ -69,17 +69,17 @@ template <typename T> bool LR20x0Interface<T>::init()
|
||||
// FIXME: correct logic to default to not using TCXO if no voltage is specified for LR20x0_DIO3_TCXO_VOLTAGE
|
||||
#elif defined(LR2021_DIO3_TCXO_VOLTAGE)
|
||||
float tcxoVoltage = LR2021_DIO3_TCXO_VOLTAGE;
|
||||
LOG_DEBUG("LR2021_DIO3_TCXO_VOLTAGE defined, using DIO3 as TCXO reference voltage at %f V", LR2021_DIO3_TCXO_VOLTAGE);
|
||||
LOG_DEBUG("LR2021_DIO3_TCXO_VOLTAGE defined, DIO3 as TCXO Vref %f V", LR2021_DIO3_TCXO_VOLTAGE);
|
||||
// (DIO3 is not free to be used as an IRQ)
|
||||
#elif defined(TCXO_OPTIONAL)
|
||||
float tcxoVoltage = 1.6f; // TCXO_OPTIONAL: try default 1.6 V first, fall back to XTAL on failure
|
||||
LOG_DEBUG("TCXO_OPTIONAL: no LR2021_DIO3_TCXO_VOLTAGE defined, trying default TCXO Vref 1.6 V first");
|
||||
LOG_DEBUG("TCXO_OPTIONAL: no LR2021_DIO3_TCXO_VOLTAGE, try default TCXO Vref 1.6 V first");
|
||||
#else
|
||||
float tcxoVoltage =
|
||||
0; // "TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip." per
|
||||
// https://github.com/jgromes/RadioLib/blob/690a050ebb46e6097c5d00c371e961c1caa3b52e/src/modules/LR11x0/LR11x0.h#L471C26-L471C104
|
||||
// (DIO3 is free to be used as an IRQ)
|
||||
LOG_DEBUG("LR2021_DIO3_TCXO_VOLTAGE not defined, not using DIO3 as TCXO reference voltage");
|
||||
LOG_DEBUG("LR2021_DIO3_TCXO_VOLTAGE not defined, DIO3 not used as TCXO Vref");
|
||||
#endif
|
||||
|
||||
RadioLibInterface::init();
|
||||
@@ -119,7 +119,7 @@ template <typename T> bool LR20x0Interface<T>::init()
|
||||
|
||||
// Retry if we get SPI command failed - some units need extra TCXO stabilization time
|
||||
if (res == RADIOLIB_ERR_SPI_CMD_FAILED) {
|
||||
LOG_WARN("LR20x0 init failed with %d (SPI_CMD_FAILED), retrying after delay...", res);
|
||||
LOG_WARN("LR20x0 init failed with %d (SPI_CMD_FAILED), retry after delay", res);
|
||||
delay(100);
|
||||
res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ template <typename T> bool LR20x0Interface<T>::init()
|
||||
#if defined(TCXO_OPTIONAL)
|
||||
// If init failed for any reason other than chip not found, retry without TCXO (XTAL mode)
|
||||
if (res != RADIOLIB_ERR_NONE && res != RADIOLIB_ERR_CHIP_NOT_FOUND && tcxoVoltage > 0) {
|
||||
LOG_WARN("LR20x0 init failed with TCXO Vref %f V (err %d), retrying without TCXO", tcxoVoltage, res);
|
||||
LOG_WARN("LR20x0 init failed with TCXO Vref %f V (err %d), retry without TCXO", tcxoVoltage, res);
|
||||
tcxoVoltage = 0;
|
||||
res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage);
|
||||
if (res == RADIOLIB_ERR_NONE)
|
||||
@@ -166,7 +166,7 @@ template <typename T> bool LR20x0Interface<T>::init()
|
||||
LOG_INFO("Set RX gain to boosted mode; result: %d", res);
|
||||
} else {
|
||||
res = lora.setRxBoostedGainMode(false);
|
||||
LOG_INFO("Set RX gain to power saving mode (boosted mode off); result: %d", res);
|
||||
LOG_INFO("Set RX gain to power saving mode; result: %d", res);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ template <typename T> bool LR20x0Interface<T>::reconfigure()
|
||||
|
||||
int res = lora.begin(freq, bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage);
|
||||
if (res == RADIOLIB_ERR_SPI_CMD_FAILED) {
|
||||
LOG_WARN("LR20x0 band-hop begin SPI_CMD_FAILED, retrying...");
|
||||
LOG_WARN("LR20x0 band-hop begin SPI_CMD_FAILED, retrying");
|
||||
delay(100);
|
||||
res = lora.begin(freq, bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage);
|
||||
}
|
||||
@@ -335,7 +335,7 @@ template <typename T> void LR20x0Interface<T>::setStandby()
|
||||
int err = lora.standby();
|
||||
|
||||
if (err != RADIOLIB_ERR_NONE) {
|
||||
LOG_DEBUG("LR20x0 standby failed with error %d", err);
|
||||
LOG_DEBUG("LR20x0 standby failed, err %d", err);
|
||||
}
|
||||
|
||||
assert(err == RADIOLIB_ERR_NONE);
|
||||
|
||||
@@ -115,7 +115,7 @@ template <class T> class MemoryDynamic : public Allocator<T>
|
||||
{
|
||||
T *p = (T *)malloc(sizeof(T));
|
||||
if (!p) {
|
||||
LOG_WARN("malloc(%u) failed, heap exhausted!", (unsigned)sizeof(T));
|
||||
LOG_WARN("malloc(%u) failed, heap exhausted", (unsigned)sizeof(T));
|
||||
return nullptr;
|
||||
}
|
||||
this->auditAdd((int32_t)sizeof(T));
|
||||
@@ -156,7 +156,7 @@ template <class T, int MaxSize> class MemoryPool : public Allocator<T>
|
||||
this->auditAdd(-(int32_t)sizeof(T));
|
||||
LOG_HEAP("Released static pool item %d at 0x%x", index, p);
|
||||
} else {
|
||||
LOG_WARN("Pointer 0x%x not from our pool!", p);
|
||||
LOG_WARN("Pointer 0x%x not from our pool", p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ template <class T, int MaxSize> class MemoryPool : public Allocator<T>
|
||||
}
|
||||
|
||||
// No free slots available - return nullptr instead of asserting
|
||||
LOG_WARN("No free slots available in static memory pool!");
|
||||
LOG_WARN("No free slots available in static memory pool");
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -170,7 +170,7 @@ void MeshModule::callModules(meshtastic_MeshPacket &mp, RxSource src)
|
||||
pi.sendResponse(mp);
|
||||
LOG_INFO("Asked module '%s' to send a response", pi.name);
|
||||
} else {
|
||||
LOG_DEBUG("Module '%s' cannot respond on portnum=%d", pi.name, mp.decoded.portnum);
|
||||
LOG_DEBUG("Module '%s' can't respond on portnum=%d", pi.name, mp.decoded.portnum);
|
||||
}
|
||||
ignoreRequest = ignoreRequest || pi.ignoreRequest; // If at least one module asks it, we may ignore a request
|
||||
} else {
|
||||
|
||||
+21
-22
@@ -95,7 +95,7 @@ int MeshService::handleFromRadio(const meshtastic_MeshPacket *mp)
|
||||
meshtastic_Config_DeviceConfig_Role_CLIENT_BASE);
|
||||
if (mp->which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
|
||||
mp->decoded.portnum == meshtastic_PortNum_TELEMETRY_APP && mp->decoded.request_id > 0) {
|
||||
LOG_DEBUG("Received telemetry response. Skip sending our NodeInfo");
|
||||
LOG_DEBUG("Got telemetry response. Skip our NodeInfo");
|
||||
// ignore our request for its NodeInfo
|
||||
} else if (mp->which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
|
||||
!nodeInfoLiteHasUser(nodeDB->getMeshNode(mp->from)) && nodeInfoModule && !isPreferredRebroadcaster &&
|
||||
@@ -103,13 +103,13 @@ int MeshService::handleFromRadio(const meshtastic_MeshPacket *mp)
|
||||
if (airTime->isTxAllowedChannelUtil(true)) {
|
||||
const int8_t hopsUsed = getHopsAway(*mp, config.lora.hop_limit);
|
||||
if (hopsUsed > (int32_t)(config.lora.hop_limit + 2)) {
|
||||
LOG_DEBUG("Skip send NodeInfo: %d hops away is too far away", hopsUsed);
|
||||
LOG_DEBUG("Skip send NodeInfo: %d hops too far", hopsUsed);
|
||||
} else {
|
||||
LOG_INFO("Heard new node on ch. %d, send NodeInfo and ask for response", mp->channel);
|
||||
LOG_INFO("Heard new node on ch. %d, send NodeInfo, ask response", mp->channel);
|
||||
nodeInfoModule->sendOurNodeInfo(mp->from, true, mp->channel);
|
||||
}
|
||||
} else {
|
||||
LOG_DEBUG("Skip sending NodeInfo > 25%% ch. util");
|
||||
LOG_DEBUG("Skip NodeInfo > 25%% ch. util");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ void MeshService::reconcilePendingRxTimes()
|
||||
p->has_rx_time = true;
|
||||
}
|
||||
if (!toPhoneQueue.enqueue(p, 0)) { // mirrors sendToPhone()'s degrade-on-failure path
|
||||
LOG_CRIT("Failed to requeue a packet into toPhoneQueue!");
|
||||
LOG_CRIT("Requeue to toPhoneQueue failed");
|
||||
releaseToPool(p);
|
||||
fromNum++; // notify observers so the phone can resync
|
||||
}
|
||||
@@ -232,14 +232,14 @@ void MeshService::injectAsReceived(meshtastic_MeshPacket &p)
|
||||
p.decoded.portnum = scratch.portnum;
|
||||
}
|
||||
} else {
|
||||
LOG_ERROR("inject: could not decode Compressed envelope, dropping");
|
||||
LOG_ERROR("inject: can't decode Compressed envelope, drop");
|
||||
return;
|
||||
}
|
||||
}
|
||||
// The real RX path (RadioLibInterface::handleReceiveInterrupt) drops sender==0; mirror it so injection
|
||||
// behaves identically to an over-the-air frame.
|
||||
if (p.from == 0) {
|
||||
LOG_WARN("inject: dropping frame with from==0 (matches real LoRa RX)");
|
||||
LOG_WARN("inject: drop frame with from==0 (matches real LoRa RX)");
|
||||
return;
|
||||
}
|
||||
meshtastic_MeshPacket *mp = packetPool.allocCopy(p);
|
||||
@@ -341,7 +341,7 @@ ErrorCode MeshService::sendQueueStatusToPhone(const meshtastic_QueueStatus &qs,
|
||||
copied->mesh_packet_id = mesh_packet_id;
|
||||
|
||||
if (toPhoneQueueStatusQueue.numFree() == 0) {
|
||||
LOG_INFO("tophone queue status queue is full, discard oldest");
|
||||
LOG_INFO("tophone queue status queue full, discard oldest");
|
||||
meshtastic_QueueStatus *d = toPhoneQueueStatusQueue.dequeuePtr(0);
|
||||
if (d)
|
||||
releaseQueueStatusToPool(d);
|
||||
@@ -421,9 +421,8 @@ bool MeshService::trySendPosition(NodeNum dest, bool wantReplies)
|
||||
if (!found) {
|
||||
// No channel with position enabled: fall back to sending nodeinfo, as before.
|
||||
if (nodeInfoModule) {
|
||||
LOG_INFO(
|
||||
"No channel with position enabled; sending nodeinfo instead to 0x%08x, wantReplies=%d, channel=%d",
|
||||
dest, wantReplies, node->channel);
|
||||
LOG_INFO("No position-enabled channel; send nodeinfo instead to 0x%08x, wantReplies=%d, channel=%d", dest,
|
||||
wantReplies, node->channel);
|
||||
nodeInfoModule->sendOurNodeInfo(dest, wantReplies, node->channel);
|
||||
}
|
||||
return false;
|
||||
@@ -470,7 +469,7 @@ void MeshService::sendToPhone(meshtastic_MeshPacket *p)
|
||||
// Withhold decoded nested payloads a strict phone decoder would reject; still-encrypted packets
|
||||
// pass through (the phone may hold the key).
|
||||
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag && !phonePayloadIsDecodable(p->decoded)) {
|
||||
LOG_WARN("Dropping undecodable portnum=%d payload from phone delivery (from=0x%08x)", p->decoded.portnum, p->from);
|
||||
LOG_WARN("Drop undecodable portnum=%d payload from phone delivery (from=0x%08x)", p->decoded.portnum, p->from);
|
||||
releaseToPool(p);
|
||||
fromNum++; // notify observers so the phone can resync
|
||||
return;
|
||||
@@ -490,12 +489,12 @@ void MeshService::sendToPhone(meshtastic_MeshPacket *p)
|
||||
if (toPhoneQueue.numFree() == 0) {
|
||||
if (p->decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP ||
|
||||
p->decoded.portnum == meshtastic_PortNum_RANGE_TEST_APP) {
|
||||
LOG_WARN("ToPhone queue is full, discard oldest");
|
||||
LOG_WARN("ToPhone queue full, discard oldest");
|
||||
meshtastic_MeshPacket *d = toPhoneQueue.dequeuePtr(0);
|
||||
if (d)
|
||||
releaseToPool(d);
|
||||
} else {
|
||||
LOG_WARN("ToPhone queue is full, drop packet");
|
||||
LOG_WARN("ToPhone queue full, drop packet");
|
||||
releaseToPool(p);
|
||||
fromNum++; // Make sure to notify observers in case they are reconnected so they can get the packets
|
||||
return;
|
||||
@@ -503,7 +502,7 @@ void MeshService::sendToPhone(meshtastic_MeshPacket *p)
|
||||
}
|
||||
|
||||
if (toPhoneQueue.enqueue(p, 0) == false) {
|
||||
LOG_CRIT("Failed to queue a packet into toPhoneQueue!");
|
||||
LOG_CRIT("Queue to toPhoneQueue failed");
|
||||
releaseToPool(p);
|
||||
fromNum++; // notify observers so phone can resync
|
||||
return;
|
||||
@@ -513,16 +512,16 @@ void MeshService::sendToPhone(meshtastic_MeshPacket *p)
|
||||
|
||||
void MeshService::sendMqttMessageToClientProxy(meshtastic_MqttClientProxyMessage *m)
|
||||
{
|
||||
LOG_DEBUG("Send mqtt message on topic '%s' to client for proxy", m->topic);
|
||||
LOG_DEBUG("Send mqtt msg on topic '%s' to proxy client", m->topic);
|
||||
if (toPhoneMqttProxyQueue.numFree() == 0) {
|
||||
LOG_WARN("MqttClientProxyMessagePool queue is full, discard oldest");
|
||||
LOG_WARN("MqttClientProxyMessagePool queue full, discard oldest");
|
||||
meshtastic_MqttClientProxyMessage *d = toPhoneMqttProxyQueue.dequeuePtr(0);
|
||||
if (d)
|
||||
releaseMqttClientProxyMessageToPool(d);
|
||||
}
|
||||
|
||||
if (toPhoneMqttProxyQueue.enqueue(m, 0) == false) {
|
||||
LOG_CRIT("Failed to queue a packet into toPhoneMqttProxyQueue!");
|
||||
LOG_CRIT("Queue to toPhoneMqttProxyQueue failed");
|
||||
releaseMqttClientProxyMessageToPool(m);
|
||||
return;
|
||||
}
|
||||
@@ -532,7 +531,7 @@ void MeshService::sendMqttMessageToClientProxy(meshtastic_MqttClientProxyMessage
|
||||
void MeshService::sendRoutingErrorResponse(meshtastic_Routing_Error error, const meshtastic_MeshPacket *mp)
|
||||
{
|
||||
if (!mp) {
|
||||
LOG_WARN("Cannot send routing error response: null packet");
|
||||
LOG_WARN("Can't send routing error response: null packet");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -540,7 +539,7 @@ void MeshService::sendRoutingErrorResponse(meshtastic_Routing_Error error, const
|
||||
if (routingModule) {
|
||||
routingModule->sendAckNak(error, mp->from, mp->id, mp->channel);
|
||||
} else {
|
||||
LOG_ERROR("Cannot send routing error response: no routing module");
|
||||
LOG_ERROR("Can't send routing error response: no routing module");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,14 +547,14 @@ void MeshService::sendClientNotification(meshtastic_ClientNotification *n)
|
||||
{
|
||||
LOG_DEBUG("Send client notification to phone");
|
||||
if (toPhoneClientNotificationQueue.numFree() == 0) {
|
||||
LOG_WARN("ClientNotification queue is full, discard oldest");
|
||||
LOG_WARN("ClientNotification queue full, discard oldest");
|
||||
meshtastic_ClientNotification *d = toPhoneClientNotificationQueue.dequeuePtr(0);
|
||||
if (d)
|
||||
releaseClientNotificationToPool(d);
|
||||
}
|
||||
|
||||
if (toPhoneClientNotificationQueue.enqueue(n, 0) == false) {
|
||||
LOG_CRIT("Failed to queue a notification into toPhoneClientNotificationQueue!");
|
||||
LOG_CRIT("Queue to toPhoneClientNotificationQueue failed");
|
||||
releaseClientNotificationToPool(n);
|
||||
return;
|
||||
}
|
||||
|
||||
+12
-12
@@ -67,7 +67,7 @@ ErrorCode NextHopRouter::send(meshtastic_MeshPacket *p)
|
||||
wasSeenRecently(p); // FIXME, move this to a sniffSent method
|
||||
|
||||
p->next_hop = getNextHop(p->to, p->relay_node).value_or(NO_NEXT_HOP_PREFERENCE); // set the next hop
|
||||
LOG_DEBUG("Setting next hop for packet with dest %x to %x", p->to, p->next_hop);
|
||||
LOG_DEBUG("Set next hop for dest 0x%08x to 0x%x", p->to, p->next_hop);
|
||||
|
||||
// If it's from us, ReliableRouter already handles retransmissions if want_ack is set. If a next hop is set and hop limit is
|
||||
// not 0 or want_ack is set, start retransmissions
|
||||
@@ -157,7 +157,7 @@ void NextHopRouter::sniffReceived(const meshtastic_MeshPacket *p, const meshtast
|
||||
// -> store nothing and keep flooding (safe).
|
||||
if (nodeDB->resolveUniqueLastByte(p->relay_node, /*requireDirectNeighbor=*/false)) {
|
||||
if (origTx && origTx->next_hop != p->relay_node) { // Not already set
|
||||
LOG_INFO("Update next hop of 0x%08x to 0x%x based on ACK/reply (was relayer %d we were sole %d)", p->from,
|
||||
LOG_INFO("Update next hop of 0x%08x to 0x%x from ACK/reply (was relayer %d we were sole %d)", p->from,
|
||||
p->relay_node, wasAlreadyRelayer, weWereSoleRelayer);
|
||||
origTx->next_hop = p->relay_node;
|
||||
}
|
||||
@@ -214,17 +214,17 @@ bool NextHopRouter::perhapsRebroadcast(const meshtastic_MeshPacket *p)
|
||||
meshtastic_MeshPacket *tosend = packetPool.allocCopy(*p); // keep a copy because we will be sending it
|
||||
if (!tosend)
|
||||
return true;
|
||||
LOG_INFO("Rebroadcast received message coming from %x", p->relay_node);
|
||||
LOG_INFO("Rebroadcast msg from %x", p->relay_node);
|
||||
|
||||
// If exhausting hops, force hop_limit = 0 regardless of other logic
|
||||
if (exhaustHops) {
|
||||
tosend->hop_limit = 0;
|
||||
LOG_INFO("Traffic management: exhausting hops for 0x%08x, setting hop_limit=0", getFrom(p));
|
||||
LOG_INFO("Traffic management: exhaust hops for 0x%08x, hop_limit=0", getFrom(p));
|
||||
} else if (shouldDecrementHopLimit(p)) {
|
||||
// Use shared logic to determine if hop_limit should be decremented
|
||||
tosend->hop_limit--; // bump down the hop count
|
||||
} else {
|
||||
LOG_INFO("favorite-ROUTER/CLIENT_BASE-to-ROUTER/CLIENT_BASE rebroadcast: preserving hop_limit");
|
||||
LOG_INFO("favorite-ROUTER/CLIENT_BASE-to-ROUTER/CLIENT_BASE rebroadcast: keep hop_limit");
|
||||
}
|
||||
#if USERPREFS_EVENT_MODE
|
||||
capEventRelayHops(tosend);
|
||||
@@ -266,7 +266,7 @@ std::optional<uint8_t> NextHopRouter::getNextHop(NodeNum to, uint8_t relay_node)
|
||||
// TraceRouteModule) with no matching record is left authoritative.
|
||||
const RouteHealth *h = findRouteHealth(to);
|
||||
if (h && h->lastNextHop == node->next_hop && isRouteStale(*h, millis())) {
|
||||
LOG_INFO("Next hop 0x%x for 0x%08x is stale (age/fails); flood and clear", node->next_hop, to);
|
||||
LOG_INFO("Next hop 0x%x for 0x%08x stale (age/fails); flood and clear", node->next_hop, to);
|
||||
node->next_hop = NO_NEXT_HOP_PREFERENCE; // clear persisted route
|
||||
clearRouteHealth(to); // clear RAM health
|
||||
return std::nullopt;
|
||||
@@ -298,7 +298,7 @@ std::optional<uint8_t> NextHopRouter::getNextHop(NodeNum to, uint8_t relay_node)
|
||||
if (hint && hint != relay_node) {
|
||||
const RouteHealth *h = findRouteHealth(to);
|
||||
if (h && h->lastNextHop == hint && isRouteStale(*h, millis())) {
|
||||
LOG_INFO("TMM next hop 0x%x for 0x%08x is stale (age/fails); flood and clear", hint, to);
|
||||
LOG_INFO("TMM next hop 0x%x for 0x%08x stale (age/fails); flood and clear", hint, to);
|
||||
trafficManagementModule->clearNextHop(to); // clear overflow route (setNextHop won't store 0)
|
||||
clearRouteHealth(to); // clear RAM health
|
||||
return std::nullopt;
|
||||
@@ -409,15 +409,15 @@ int32_t NextHopRouter::doRetransmissions()
|
||||
if (p.nextTxMsec <= now) {
|
||||
if (p.numRetransmissions == 0) {
|
||||
if (isFromUs(p.packet)) {
|
||||
LOG_DEBUG("Reliable send failed, returning a nak for fr=0x%08x,to=0x%08x,id=0x%08x", p.packet->from,
|
||||
p.packet->to, p.packet->id);
|
||||
LOG_DEBUG("Reliable send failed, return nak fr=0x%08x,to=0x%08x,id=0x%08x", p.packet->from, p.packet->to,
|
||||
p.packet->id);
|
||||
sendAckNak(meshtastic_Routing_Error_MAX_RETRANSMIT, getFrom(p.packet), p.packet->id, p.packet->channel);
|
||||
}
|
||||
// Note: we don't stop retransmission here, instead the Nak packet gets processed in sniffReceived
|
||||
stopRetransmission(it->first);
|
||||
stillValid = false; // just deleted it
|
||||
} else {
|
||||
LOG_DEBUG("Sending retransmission fr=0x%08x,to=0x%08x,id=0x%08x, tries left=%d", p.packet->from, p.packet->to,
|
||||
LOG_DEBUG("Send retransmission fr=0x%08x,to=0x%08x,id=0x%08x, tries left=%d", p.packet->from, p.packet->to,
|
||||
p.packet->id, p.numRetransmissions);
|
||||
|
||||
if (!isBroadcast(p.packet->to)) {
|
||||
@@ -430,7 +430,7 @@ int32_t NextHopRouter::doRetransmissions()
|
||||
// Also reset it in the nodeDB
|
||||
meshtastic_NodeInfoLite *sentTo = nodeDB->getMeshNode(p.packet->to);
|
||||
if (sentTo) {
|
||||
LOG_INFO("Resetting next hop for packet with dest 0x%08x", p.packet->to);
|
||||
LOG_INFO("Reset next hop for dest 0x%08x", p.packet->to);
|
||||
sentTo->next_hop = NO_NEXT_HOP_PREFERENCE;
|
||||
}
|
||||
#if HAS_TRAFFIC_MANAGEMENT
|
||||
@@ -503,7 +503,7 @@ void NextHopRouter::setNextTx(PendingPacket *pending)
|
||||
assert(iface);
|
||||
auto d = iface->getRetransmissionMsec(pending->packet);
|
||||
pending->nextTxMsec = millis() + d;
|
||||
LOG_DEBUG("Setting next retransmission in %u msecs: ", d);
|
||||
LOG_DEBUG("Next retransmission in %u msecs", d);
|
||||
printPacket("", pending->packet);
|
||||
setReceivedMessage(); // Run ASAP, so we can figure out our correct sleep time
|
||||
}
|
||||
|
||||
+75
-76
@@ -486,12 +486,12 @@ NodeDB::NodeDB()
|
||||
preferences.begin("meshtastic", false);
|
||||
myNodeInfo.reboot_count = preferences.getUInt("rebootCounter", 0);
|
||||
preferences.end();
|
||||
LOG_DEBUG("Number of Device Reboots: %d", myNodeInfo.reboot_count);
|
||||
LOG_DEBUG("Device reboots: %d", myNodeInfo.reboot_count);
|
||||
#endif
|
||||
|
||||
// UA_868 is obsolete; migrate to EU_868 before resetRadioConfig() below validates the region.
|
||||
if (config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_UA_868) {
|
||||
LOG_INFO("UA_868 region is obsolete, migrating saved config to EU_868");
|
||||
LOG_INFO("UA_868 obsolete, migrating config to EU_868");
|
||||
config.lora.region = meshtastic_Config_LoRaConfig_RegionCode_EU_868;
|
||||
}
|
||||
|
||||
@@ -504,7 +504,7 @@ NodeDB::NodeDB()
|
||||
// If we are setup to broadcast on any default channel slot (with default frequency slot semantics),
|
||||
// ensure that the telemetry intervals are coerced to the role-aware minimum value.
|
||||
if (channels.hasDefaultChannel()) {
|
||||
LOG_DEBUG("Coerce telemetry to role-aware minimum on defaults");
|
||||
LOG_DEBUG("Coerce telemetry to role-aware min on defaults");
|
||||
moduleConfig.telemetry.device_update_interval = Default::getConfiguredOrMinimumValue(
|
||||
moduleConfig.telemetry.device_update_interval, min_default_telemetry_interval_secs);
|
||||
moduleConfig.telemetry.environment_update_interval = Default::getConfiguredOrMinimumValue(
|
||||
@@ -527,7 +527,7 @@ NodeDB::NodeDB()
|
||||
}
|
||||
}
|
||||
if (positionUsesDefaultChannel) {
|
||||
LOG_DEBUG("Coerce position broadcasts to role-aware minimum and smart broadcast min of 5 minutes on defaults");
|
||||
LOG_DEBUG("Coerce position broadcasts to role-aware min and smart broadcast min of 5 min on defaults");
|
||||
config.position.position_broadcast_secs =
|
||||
Default::getConfiguredOrMinimumValue(config.position.position_broadcast_secs, min_default_broadcast_interval_secs);
|
||||
config.position.broadcast_smart_minimum_interval_secs = Default::getConfiguredOrMinimumValue(
|
||||
@@ -738,7 +738,7 @@ void NodeDB::resetRadioConfig(bool is_fresh_install)
|
||||
}
|
||||
|
||||
if (channelFile.channels_count != MAX_NUM_CHANNELS) {
|
||||
LOG_INFO("Set default channel and radio preferences!");
|
||||
LOG_INFO("Set default channel and radio prefs");
|
||||
|
||||
channels.initDefaults();
|
||||
// Defaults ship the public PSK, so strip it again before onConfigChanged() publishes hashes;
|
||||
@@ -755,14 +755,14 @@ void NodeDB::resetRadioConfig(bool is_fresh_install)
|
||||
|
||||
bool NodeDB::factoryReset(bool eraseBleBonds)
|
||||
{
|
||||
LOG_INFO("Perform factory reset!");
|
||||
LOG_INFO("Factory reset");
|
||||
// first, remove the "/prefs" (this removes most prefs)
|
||||
spiLock->lock();
|
||||
rmDir("/prefs"); // this uses spilock internally...
|
||||
|
||||
#ifdef FSCom
|
||||
if (FSCom.exists("/static/rangetest.csv") && !FSCom.remove("/static/rangetest.csv")) {
|
||||
LOG_ERROR("Could not remove rangetest.csv file");
|
||||
LOG_ERROR("Can't remove rangetest.csv");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -806,7 +806,7 @@ bool NodeDB::factoryReset(bool eraseBleBonds)
|
||||
#endif
|
||||
|
||||
#ifdef ARCH_NRF52
|
||||
LOG_INFO("Clear bluetooth bonds!");
|
||||
LOG_INFO("Clear bluetooth bonds");
|
||||
bond_print_list(BLE_GAP_ROLE_PERIPH);
|
||||
bond_print_list(BLE_GAP_ROLE_CENTRAL);
|
||||
Bluefruit.Periph.clearBonds();
|
||||
@@ -884,7 +884,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false)
|
||||
// Restrict ROUTER*, LOST AND FOUND roles for security reasons
|
||||
if (IS_ONE_OF(USERPREFS_CONFIG_DEVICE_ROLE, meshtastic_Config_DeviceConfig_Role_ROUTER,
|
||||
meshtastic_Config_DeviceConfig_Role_ROUTER_LATE, meshtastic_Config_DeviceConfig_Role_LOST_AND_FOUND)) {
|
||||
LOG_WARN("ROUTER roles are restricted, falling back to CLIENT role");
|
||||
LOG_WARN("ROUTER roles restricted, fall back to CLIENT");
|
||||
config.device.role = meshtastic_Config_DeviceConfig_Role_CLIENT;
|
||||
} else {
|
||||
config.device.role = USERPREFS_CONFIG_DEVICE_ROLE;
|
||||
@@ -1627,7 +1627,7 @@ void NodeDB::resetNodes(bool keepFavorites)
|
||||
NodeNum ourNum = getNodeNum();
|
||||
numMeshNodes = 1;
|
||||
if (keepFavorites) {
|
||||
LOG_INFO("Clearing node database - preserving favorites");
|
||||
LOG_INFO("Clear node database, keep favorites");
|
||||
// Compact favorites into contiguous low slots: zeroing in place leaves one above
|
||||
// numMeshNodes, invisible to every `i < numMeshNodes` scan yet still serialized to flash.
|
||||
for (size_t i = 1; i < meshNodes->size(); i++) {
|
||||
@@ -1642,7 +1642,7 @@ void NodeDB::resetNodes(bool keepFavorites)
|
||||
}
|
||||
std::fill(nodeDatabase.nodes.begin() + numMeshNodes, nodeDatabase.nodes.end(), meshtastic_NodeInfoLite());
|
||||
} else {
|
||||
LOG_INFO("Clearing node database - removing favorites");
|
||||
LOG_INFO("Clear node database, remove favorites");
|
||||
for (size_t i = 1; i < meshNodes->size(); i++) {
|
||||
const NodeNum gone = meshNodes->at(i).num;
|
||||
if (gone)
|
||||
@@ -1698,7 +1698,7 @@ void NodeDB::removeNodeByNum(NodeNum nodeNum)
|
||||
trafficManagementModule->purgeNode(nodeNum);
|
||||
#endif
|
||||
|
||||
LOG_DEBUG("NodeDB::removeNodeByNum purged %d entries. Save changes", removed);
|
||||
LOG_DEBUG("NodeDB::removeNodeByNum purged %d entries, saving", removed);
|
||||
saveNodeDatabaseToDisk();
|
||||
}
|
||||
|
||||
@@ -2040,7 +2040,7 @@ void NodeDB::pickNewNodeNum()
|
||||
(nodeNum == NODENUM_BROADCAST || nodeNum < NUM_RESERVED)) {
|
||||
NodeNum candidate = random(NUM_RESERVED, LONG_MAX); // try a new random choice
|
||||
if (found)
|
||||
LOG_WARN("NOTE! Our desired nodenum 0x%08x is invalid or in use, picking 0x%08x", nodeNum, candidate);
|
||||
LOG_WARN("NOTE! Desired nodenum 0x%08x invalid or in use, picking 0x%08x", nodeNum, candidate);
|
||||
nodeNum = candidate;
|
||||
}
|
||||
LOG_DEBUG("Use nodenum 0x%08x ", nodeNum);
|
||||
@@ -2072,11 +2072,11 @@ LoadFileResult NodeDB::loadProto(const char *filename, size_t protoSize, size_t
|
||||
if (fields != &meshtastic_NodeDatabase_msg)
|
||||
memset(dest_struct, 0, objSize);
|
||||
if (!pb_decode(&stream, fields, dest_struct)) {
|
||||
LOG_ERROR("Error: can't decode protobuf %s", PB_GET_ERROR(&stream));
|
||||
LOG_ERROR("Can't decode protobuf %s", PB_GET_ERROR(&stream));
|
||||
state = LoadFileResult::DECODE_FAILED;
|
||||
storageCorruptThisLoad = true;
|
||||
} else {
|
||||
LOG_INFO("Loaded encrypted %s successfully", filename);
|
||||
LOG_INFO("Loaded encrypted %s", filename);
|
||||
state = LoadFileResult::LOAD_SUCCESS;
|
||||
}
|
||||
} else {
|
||||
@@ -2100,18 +2100,18 @@ LoadFileResult NodeDB::loadProto(const char *filename, size_t protoSize, size_t
|
||||
fields != &meshtastic_NodeDatabase_Legacy_msg) // both NodeDatabase descriptors contain std::vector members
|
||||
memset(dest_struct, 0, objSize);
|
||||
if (!pb_decode(&stream, fields, dest_struct)) {
|
||||
LOG_ERROR("Error: can't decode protobuf %s", PB_GET_ERROR(&stream));
|
||||
LOG_ERROR("Can't decode protobuf %s", PB_GET_ERROR(&stream));
|
||||
state = LoadFileResult::DECODE_FAILED;
|
||||
} else {
|
||||
LOG_INFO("Loaded %s successfully", filename);
|
||||
LOG_INFO("Loaded %s", filename);
|
||||
state = LoadFileResult::LOAD_SUCCESS;
|
||||
}
|
||||
f.close();
|
||||
} else {
|
||||
LOG_ERROR("Could not open / read %s", filename);
|
||||
LOG_ERROR("Can't open/read %s", filename);
|
||||
}
|
||||
#else
|
||||
LOG_ERROR("ERROR: Filesystem not implemented");
|
||||
LOG_ERROR("Filesystem not implemented");
|
||||
state = LoadFileResult::NO_FILESYSTEM;
|
||||
#endif
|
||||
return state;
|
||||
@@ -2250,7 +2250,7 @@ void NodeDB::loadFromDisk()
|
||||
spiLock->lock();
|
||||
for (const char *filename : eventProfileFiles) {
|
||||
if (FSCom.exists(filename) && !FSCom.remove(filename))
|
||||
LOG_WARN("Unable to remove stale event profile file %s", filename);
|
||||
LOG_WARN("Can't remove stale event profile file %s", filename);
|
||||
}
|
||||
spiLock->unlock();
|
||||
#endif
|
||||
@@ -2268,7 +2268,7 @@ void NodeDB::loadFromDisk()
|
||||
const size_t usedBytes = fsUsedBytes();
|
||||
eventProfileStorageUnavailable = !hasEventProfileStorageSpace(totalBytes, usedBytes);
|
||||
if (eventProfileStorageUnavailable) {
|
||||
LOG_ERROR("Event profile requires %u bytes free; only %u bytes available. Profile changes will not persist.",
|
||||
LOG_ERROR("Event profile needs %u bytes free; only %u available. Changes won't persist",
|
||||
static_cast<unsigned>(EVENT_PROFILE_STORAGE_RESERVATION_BYTES),
|
||||
static_cast<unsigned>(totalBytes >= usedBytes ? totalBytes - usedBytes : 0));
|
||||
}
|
||||
@@ -2292,7 +2292,7 @@ void NodeDB::loadFromDisk()
|
||||
#if defined(FACTORY_INSTALL) && !defined(ARCH_PORTDUINO)
|
||||
spiLock->lock();
|
||||
if (!FSCom.exists("/prefs/" xstr(BUILD_EPOCH))) {
|
||||
LOG_WARN("Factory Install Reset!");
|
||||
LOG_WARN("Factory Install Reset");
|
||||
rmDir("/prefs");
|
||||
FSCom.mkdir("/prefs");
|
||||
File f2 = FSCom.open("/prefs/" xstr(BUILD_EPOCH), FILE_O_WRITE);
|
||||
@@ -2306,11 +2306,11 @@ void NodeDB::loadFromDisk()
|
||||
spiLock->lock();
|
||||
if (FSCom.exists(legacyPrefFileName)) {
|
||||
spiLock->unlock();
|
||||
LOG_WARN("Legacy prefs version found, factory resetting");
|
||||
LOG_WARN("Legacy prefs version, factory reset");
|
||||
if (loadProto(configFileName, meshtastic_LocalConfig_size, sizeof(meshtastic_LocalConfig), &meshtastic_LocalConfig_msg,
|
||||
&config) == LoadFileResult::LOAD_SUCCESS &&
|
||||
config.has_security && config.security.private_key.size > 0) {
|
||||
LOG_DEBUG("Saving backup of security config and keys");
|
||||
LOG_DEBUG("Backup security config and keys");
|
||||
backupSecurity = config.security;
|
||||
}
|
||||
spiLock->lock();
|
||||
@@ -2331,7 +2331,7 @@ void NodeDB::loadFromDisk()
|
||||
// Encrypted storage is locked. Install defaults and wait for the
|
||||
// passphrase over BLE/serial; PhoneAPI::handleLockdownAuthInline
|
||||
// calls reloadFromDisk() once the storage is unlocked.
|
||||
LOG_WARN("NodeDB: Encrypted storage locked, using default config until unlocked");
|
||||
LOG_WARN("NodeDB: Encrypted storage locked, default config until unlocked");
|
||||
installDefaultNodeDatabase();
|
||||
installDefaultDeviceState();
|
||||
installDefaultConfig();
|
||||
@@ -2442,7 +2442,7 @@ void NodeDB::loadFromDisk()
|
||||
// Attempt recovery of owner fields from our own NodeDB entry if available.
|
||||
const meshtastic_NodeInfoLite *us = getMeshNode(getNodeNum());
|
||||
if (nodeInfoLiteHasUser(us)) {
|
||||
LOG_WARN("Restoring owner fields (long_name/short_name/is_licensed/is_unmessagable) from NodeDB for our node 0x%08x",
|
||||
LOG_WARN("Restore owner fields (long_name/short_name/is_licensed/is_unmessagable) from NodeDB for node 0x%08x",
|
||||
us->num);
|
||||
// owner.long_name (40) is wider than the lite source (25); bound by the source
|
||||
memcpy(owner.long_name, us->long_name, sizeof(us->long_name));
|
||||
@@ -2457,7 +2457,7 @@ void NodeDB::loadFromDisk()
|
||||
saveToDisk(SEGMENT_DEVICESTATE);
|
||||
}
|
||||
} else {
|
||||
LOG_INFO("Loaded saved devicestate version %d", devicestate.version);
|
||||
LOG_INFO("Loaded saved devicestate v%d", devicestate.version);
|
||||
}
|
||||
|
||||
// Devicestate saved by firmware that allowed 39-byte names gets clamped on
|
||||
@@ -2483,7 +2483,7 @@ void NodeDB::loadFromDisk()
|
||||
config.lora = eventLora;
|
||||
state = LoadFileResult::LOAD_SUCCESS;
|
||||
initializedEventConfig = true;
|
||||
LOG_INFO("Initialized event config without modifying %s", STANDARD_CONFIG_FILE_NAME);
|
||||
LOG_INFO("Init event config without modifying %s", STANDARD_CONFIG_FILE_NAME);
|
||||
} else {
|
||||
// Keep the event load outcome because loadProto() clears config before decoding.
|
||||
// A normal decode failure must not create a replacement identity.
|
||||
@@ -2497,7 +2497,7 @@ void NodeDB::loadFromDisk()
|
||||
// our NodeNum (== crc32(public_key)) and orphan us on the mesh. configDecodeFailed freezes identity and
|
||||
// skips persisting (see ctor), so a transient failure self-heals on the next clean boot. A genuinely
|
||||
// absent config returns OTHER_FAILURE, so this never fires on first boot. Boot degraded + radio-silent.
|
||||
LOG_ERROR("Config decode failed - freezing identity, booting degraded (radio silent until restored)");
|
||||
LOG_ERROR("Config decode failed - freeze identity, boot degraded (radio silent until restored)");
|
||||
configDecodeFailed = true;
|
||||
installDefaultConfig(true);
|
||||
config.lora.region = meshtastic_Config_LoRaConfig_RegionCode_UNSET;
|
||||
@@ -2510,7 +2510,7 @@ void NodeDB::loadFromDisk()
|
||||
LOG_WARN("config %d is old, discard", config.version);
|
||||
installDefaultConfig(true);
|
||||
} else {
|
||||
LOG_INFO("Loaded saved config version %d", config.version);
|
||||
LOG_INFO("Loaded saved config v%d", config.version);
|
||||
}
|
||||
configLoadComplete = true;
|
||||
|
||||
@@ -2558,12 +2558,12 @@ void NodeDB::loadFromDisk()
|
||||
// This is the first durable event-profile write. A failed write is
|
||||
// safe: normal files remain untouched and the next event boot retries.
|
||||
if (!saveToDisk(SEGMENT_CONFIG))
|
||||
LOG_ERROR("Unable to persist initial event config");
|
||||
LOG_ERROR("Can't persist initial event config");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (backupSecurity.private_key.size > 0) {
|
||||
LOG_DEBUG("Restoring backup of security config");
|
||||
LOG_DEBUG("Restore security config backup");
|
||||
config.security = backupSecurity;
|
||||
saveToDisk(SEGMENT_CONFIG);
|
||||
}
|
||||
@@ -2582,7 +2582,7 @@ void NodeDB::loadFromDisk()
|
||||
}
|
||||
if (sum == 0) {
|
||||
numAdminKeys += 1;
|
||||
LOG_INFO("Admin 0 key zero. Loading hard coded key from user preferences.");
|
||||
LOG_INFO("Admin 0 key zero. Load hard coded key from user prefs");
|
||||
memcpy(config.security.admin_key[0].bytes, userprefs_admin_key_0, 32);
|
||||
config.security.admin_key[0].size = 32;
|
||||
}
|
||||
@@ -2595,7 +2595,7 @@ void NodeDB::loadFromDisk()
|
||||
}
|
||||
if (sum == 0) {
|
||||
numAdminKeys += 1;
|
||||
LOG_INFO("Admin 1 key zero. Loading hard coded key from user preferences.");
|
||||
LOG_INFO("Admin 1 key zero. Load hard coded key from user prefs");
|
||||
memcpy(config.security.admin_key[1].bytes, userprefs_admin_key_1, 32);
|
||||
config.security.admin_key[1].size = 32;
|
||||
}
|
||||
@@ -2608,14 +2608,14 @@ void NodeDB::loadFromDisk()
|
||||
}
|
||||
if (sum == 0) {
|
||||
numAdminKeys += 1;
|
||||
LOG_INFO("Admin 2 key zero. Loading hard coded key from user preferences.");
|
||||
LOG_INFO("Admin 2 key zero. Load hard coded key from user prefs");
|
||||
memcpy(config.security.admin_key[2].bytes, userprefs_admin_key_2, 32);
|
||||
config.security.admin_key[2].size = 32;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (numAdminKeys > 0) {
|
||||
LOG_INFO("Saving %d hard coded admin keys.", numAdminKeys);
|
||||
LOG_INFO("Saving %d hard coded admin keys", numAdminKeys);
|
||||
config.security.admin_key_count = numAdminKeys;
|
||||
saveToDisk(SEGMENT_CONFIG);
|
||||
}
|
||||
@@ -2629,7 +2629,7 @@ void NodeDB::loadFromDisk()
|
||||
LOG_WARN("moduleConfig %d is old, discard", moduleConfig.version);
|
||||
installDefaultModuleConfig();
|
||||
} else {
|
||||
LOG_INFO("Loaded saved moduleConfig version %d", moduleConfig.version);
|
||||
LOG_INFO("Loaded saved moduleConfig v%d", moduleConfig.version);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2652,7 +2652,7 @@ void NodeDB::loadFromDisk()
|
||||
LOG_WARN("channelFile %d is old, discard", channelFile.version);
|
||||
installDefaultChannels();
|
||||
} else {
|
||||
LOG_INFO("Loaded saved channelFile version %d", channelFile.version);
|
||||
LOG_INFO("Loaded saved channelFile v%d", channelFile.version);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2704,7 +2704,7 @@ void NodeDB::loadFromDisk()
|
||||
if (activeBackupExists && !EncryptedStorage::isEncrypted(backupFileName)) {
|
||||
LOG_INFO("Migrating %s to encrypted storage", backupFileName);
|
||||
if (!EncryptedStorage::migrateFile(backupFileName)) {
|
||||
LOG_ERROR("Unable to migrate %s to encrypted storage", backupFileName);
|
||||
LOG_ERROR("Can't migrate %s to encrypted storage", backupFileName);
|
||||
storageCorruptThisLoad = true;
|
||||
}
|
||||
}
|
||||
@@ -2723,7 +2723,7 @@ void NodeDB::loadFromDisk()
|
||||
if (exists && !EncryptedStorage::isEncrypted(fn)) {
|
||||
LOG_INFO("Migrating inactive radio profile %s to encrypted storage", fn);
|
||||
if (!EncryptedStorage::migrateFile(fn)) {
|
||||
LOG_ERROR("Unable to migrate %s to encrypted storage", fn);
|
||||
LOG_ERROR("Can't migrate %s to encrypted storage", fn);
|
||||
storageCorruptThisLoad = true;
|
||||
}
|
||||
}
|
||||
@@ -2735,7 +2735,7 @@ void NodeDB::loadFromDisk()
|
||||
|
||||
// 2.4.X - configuration migration to update new default intervals
|
||||
if (moduleConfig.version < 23) {
|
||||
LOG_DEBUG("ModuleConfig version %d is stale, upgrading to new default intervals", moduleConfig.version);
|
||||
LOG_DEBUG("ModuleConfig v%d stale, upgrade to new default intervals", moduleConfig.version);
|
||||
moduleConfig.version = DEVICESTATE_CUR_VER;
|
||||
if (moduleConfig.telemetry.device_update_interval == 900)
|
||||
moduleConfig.telemetry.device_update_interval = 0;
|
||||
@@ -2829,7 +2829,7 @@ bool NodeDB::reloadFromDisk()
|
||||
loadFromDisk();
|
||||
|
||||
if (storageCorruptThisLoad) {
|
||||
LOG_ERROR("NodeDB: storage decrypt/decode failed during reload - surfacing as corrupt");
|
||||
LOG_ERROR("NodeDB: reload decrypt/decode failed - treat as corrupt");
|
||||
// Leave the radio sleeping. Caller will lock storage and emit
|
||||
// a LOCKED(storage_corrupt) status; we must not reconfigure
|
||||
// the chip with the locked-default placeholder values still
|
||||
@@ -2874,7 +2874,7 @@ bool NodeDB::disableLockdownToPlaintext()
|
||||
moduleConfigFileName, deviceStateFileName, nodeDatabaseFileName};
|
||||
for (const char *fn : filesToCheck) {
|
||||
if (!EncryptedStorage::migrateFileToPlaintext(fn)) {
|
||||
LOG_ERROR("NodeDB: failed to revert %s to plaintext; aborting disable (device stays in lockdown)", fn);
|
||||
LOG_ERROR("NodeDB: revert %s to plaintext failed; abort disable (stays in lockdown)", fn);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2903,7 +2903,7 @@ bool NodeDB::saveProto(const char *filename, size_t protoSize, const pb_msgdesc_
|
||||
// do not try to save anything if power level is not safe. In many cases flash will be lock-protected
|
||||
// and all writes will fail anyway. Device should be sleeping at this point anyway.
|
||||
if (!powerHAL_isPowerLevelSafe()) {
|
||||
LOG_ERROR("Error: trying to saveProto() on unsafe device power level.");
|
||||
LOG_ERROR("saveProto() on unsafe device power level");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2925,7 +2925,7 @@ bool NodeDB::saveProto(const char *filename, size_t protoSize, const pb_msgdesc_
|
||||
|
||||
pb_ostream_t stream = pb_ostream_from_buffer(pbBuf.get(), protoSize);
|
||||
if (!pb_encode(&stream, fields, dest_struct)) {
|
||||
LOG_ERROR("Error: can't encode protobuf %s", PB_GET_ERROR(&stream));
|
||||
LOG_ERROR("Can't encode protobuf %s", PB_GET_ERROR(&stream));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2933,7 +2933,7 @@ bool NodeDB::saveProto(const char *filename, size_t protoSize, const pb_msgdesc_
|
||||
bool ok = EncryptedStorage::encryptAndWrite(filename, pbBuf.get(), encodedSize, fullAtomic);
|
||||
|
||||
if (!ok) {
|
||||
LOG_ERROR("EncryptedStorage: Failed to encrypt and write %s", filename);
|
||||
LOG_ERROR("EncryptedStorage: encrypt+write %s failed", filename);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
@@ -2947,7 +2947,7 @@ bool NodeDB::saveProto(const char *filename, size_t protoSize, const pb_msgdesc_
|
||||
pb_ostream_t stream = {&writecb, static_cast<Print *>(&f), protoSize};
|
||||
|
||||
if (!pb_encode(&stream, fields, dest_struct)) {
|
||||
LOG_ERROR("Error: can't encode protobuf %s", PB_GET_ERROR(&stream));
|
||||
LOG_ERROR("Can't encode protobuf %s", PB_GET_ERROR(&stream));
|
||||
} else {
|
||||
okay = true;
|
||||
}
|
||||
@@ -2955,10 +2955,10 @@ bool NodeDB::saveProto(const char *filename, size_t protoSize, const pb_msgdesc_
|
||||
bool writeSucceeded = f.close();
|
||||
|
||||
if (!okay || !writeSucceeded) {
|
||||
LOG_ERROR("Can't write prefs!");
|
||||
LOG_ERROR("Can't write prefs");
|
||||
}
|
||||
#else
|
||||
LOG_ERROR("ERROR: Filesystem not implemented");
|
||||
LOG_ERROR("Filesystem not implemented");
|
||||
#endif
|
||||
return okay;
|
||||
}
|
||||
@@ -2969,7 +2969,7 @@ bool NodeDB::saveChannelsToDisk()
|
||||
// do not try to save anything if power level is not safe. In many cases flash will be lock-protected
|
||||
// and all writes will fail anyway.
|
||||
if (!powerHAL_isPowerLevelSafe()) {
|
||||
LOG_ERROR("Error: trying to saveChannelsToDisk() on unsafe device power level.");
|
||||
LOG_ERROR("saveChannelsToDisk() on unsafe device power level");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2988,7 +2988,7 @@ bool NodeDB::saveDeviceStateToDisk()
|
||||
// do not try to save anything if power level is not safe. In many cases flash will be lock-protected
|
||||
// and all writes will fail anyway. Device should be sleeping at this point anyway.
|
||||
if (!powerHAL_isPowerLevelSafe()) {
|
||||
LOG_ERROR("Error: trying to saveDeviceStateToDisk() on unsafe device power level.");
|
||||
LOG_ERROR("saveDeviceStateToDisk() on unsafe device power level");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3016,7 +3016,7 @@ bool NodeDB::saveNodeDatabaseToDisk()
|
||||
// do not try to save anything if power level is not safe. In many cases flash will be lock-protected
|
||||
// and all writes will fail anyway. Device should be sleeping at this point anyway.
|
||||
if (!powerHAL_isPowerLevelSafe()) {
|
||||
LOG_ERROR("Error: trying to saveNodeDatabaseToDisk() on unsafe device power level.");
|
||||
LOG_ERROR("saveNodeDatabaseToDisk() on unsafe device power level");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3024,7 +3024,7 @@ bool NodeDB::saveNodeDatabaseToDisk()
|
||||
// would propagate through saveToDisk() and trigger fsFormat() mid-transfer.
|
||||
#ifdef FSCom
|
||||
if (xModem.isBusy()) {
|
||||
LOG_DEBUG("Deferring NodeDB save: xmodem transfer in progress");
|
||||
LOG_DEBUG("Defer NodeDB save: xmodem in progress");
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@@ -3125,7 +3125,7 @@ bool NodeDB::saveToDiskNoRetry(int saveWhat)
|
||||
// do not try to save anything if power level is not safe. In many cases flash will be lock-protected
|
||||
// and all writes will fail anyway. Device should be sleeping at this point anyway.
|
||||
if (!powerHAL_isPowerLevelSafe()) {
|
||||
LOG_ERROR("Error: trying to saveToDiskNoRetry() on unsafe device power level.");
|
||||
LOG_ERROR("saveToDiskNoRetry() on unsafe device power level");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3155,11 +3155,11 @@ bool NodeDB::saveToDiskNoRetry(int saveWhat)
|
||||
#if USERPREFS_EVENT_MODE
|
||||
if (eventProfileStorageUnavailable) {
|
||||
if (saveWhat & SEGMENT_CONFIG) {
|
||||
LOG_WARN("Skipping event config write: insufficient profile storage at boot");
|
||||
LOG_WARN("Skip event config write: insufficient profile storage at boot");
|
||||
saveWhat &= ~SEGMENT_CONFIG;
|
||||
}
|
||||
if (saveWhat & SEGMENT_CHANNELS) {
|
||||
LOG_WARN("Skipping event channel write: insufficient profile storage at boot");
|
||||
LOG_WARN("Skip event channel write: insufficient profile storage at boot");
|
||||
saveWhat &= ~SEGMENT_CHANNELS;
|
||||
}
|
||||
}
|
||||
@@ -3223,14 +3223,14 @@ bool NodeDB::saveToDisk(int saveWhat)
|
||||
// do not try to save anything if power level is not safe. In many cases flash will be lock-protected
|
||||
// and all writes will fail anyway. Device should be sleeping at this point anyway.
|
||||
if (!powerHAL_isPowerLevelSafe()) {
|
||||
LOG_ERROR("Error: trying to saveToDisk() on unsafe device power level.");
|
||||
LOG_ERROR("saveToDisk() on unsafe device power level");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool success = saveToDiskNoRetry(saveWhat);
|
||||
|
||||
if (!success) {
|
||||
LOG_ERROR("Failed to save to disk, retrying");
|
||||
LOG_ERROR("Save to disk failed, retry");
|
||||
spiLock->lock();
|
||||
fsFormat();
|
||||
spiLock->unlock();
|
||||
@@ -3536,7 +3536,7 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde
|
||||
// Only a signed update may change the identity of a proven signer; our own record is exempt.
|
||||
// Checked before getOrCreateMeshNode so a refusal cannot evict; isKnownXeddsaSigner covers the warm tier.
|
||||
if (nodeId != getNodeNum() && isKnownXeddsaSigner(nodeId) && !xeddsaSigned) {
|
||||
LOG_WARN("Refusing unsigned identity update for node 0x%08x that previously signed", nodeId);
|
||||
LOG_WARN("Refuse unsigned identity update for 0x%08x that previously signed", nodeId);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3577,12 +3577,12 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde
|
||||
if (info->public_key.size == 32) { // if we have a key for this user already, don't overwrite with a new one
|
||||
// if the key doesn't match, don't update nodeDB at all.
|
||||
if (p.public_key.size != 32 || (memcmp(p.public_key.bytes, info->public_key.bytes, 32) != 0)) {
|
||||
LOG_WARN("Public Key mismatch, dropping NodeInfo");
|
||||
LOG_WARN("Public Key mismatch, drop NodeInfo");
|
||||
return false;
|
||||
}
|
||||
LOG_INFO("Public Key set for node, not updating!");
|
||||
LOG_INFO("Public Key set, not updating");
|
||||
} else if (p.public_key.size == 32) {
|
||||
LOG_INFO("Update Node Pubkey!");
|
||||
LOG_INFO("Update Node Pubkey");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3617,7 +3617,7 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde
|
||||
saveToDisk(SEGMENT_NODEDATABASE);
|
||||
lastNodeDbSave = millis();
|
||||
} else {
|
||||
LOG_DEBUG("Defer NodeDB saveToDisk for now");
|
||||
LOG_DEBUG("Defer NodeDB saveToDisk");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3851,7 +3851,7 @@ void NodeDB::sortMeshDB()
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG_INFO("Sort took %u milliseconds", millis() - lastSort);
|
||||
LOG_INFO("Sort took %u ms", millis() - lastSort);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4091,8 +4091,7 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n)
|
||||
|
||||
if (!lite) {
|
||||
if (isFull()) {
|
||||
LOG_INFO("Node database full with %i nodes and %u bytes free. Erasing oldest entry", numMeshNodes,
|
||||
memGet.getFreeHeap());
|
||||
LOG_INFO("Node database full: %i nodes, %u bytes free. Erase oldest", numMeshNodes, memGet.getFreeHeap());
|
||||
// look for oldest node and erase it
|
||||
uint32_t oldest = UINT32_MAX;
|
||||
uint32_t oldestBoring = UINT32_MAX;
|
||||
@@ -4187,7 +4186,7 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
LOG_INFO("Adding node to database with %i nodes and %u bytes free!", numMeshNodes, memGet.getFreeHeap());
|
||||
LOG_INFO("Add node to database: %i nodes, %u bytes free", numMeshNodes, memGet.getFreeHeap());
|
||||
}
|
||||
|
||||
return lite;
|
||||
@@ -4264,14 +4263,14 @@ bool NodeDB::generateCryptoKeyPair(const uint8_t *privateKey)
|
||||
if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) {
|
||||
keygenSuccess = true;
|
||||
} else {
|
||||
LOG_ERROR("Failed to generate public key from provided private key");
|
||||
LOG_ERROR("Can't generate public key from private key");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Try to regenerate public key from existing private key if it's valid and not low entropy
|
||||
else if (config.security.private_key.size == 32 && !keyIsLowEntropy) {
|
||||
config.security.public_key.size = 32;
|
||||
LOG_DEBUG("Regenerate PKI public key from existing private key");
|
||||
LOG_DEBUG("Regenerate PKI public key from private key");
|
||||
if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) {
|
||||
keygenSuccess = true;
|
||||
}
|
||||
@@ -4331,7 +4330,7 @@ bool NodeDB::createNewIdentity()
|
||||
// still streamed to clients, and made any DM/admin aimed at it fail forever with PKI_SEND_FAIL_PUBLIC_KEY.
|
||||
// removeNodeByNum() drops the lite entry, its satellite stores, and the warm-tier copy.
|
||||
if (getMeshNode(oldNodeNum) != NULL) {
|
||||
LOG_DEBUG("Old node num %u is now %u, removing stale identity", oldNodeNum, newNodeNum);
|
||||
LOG_DEBUG("Old node num 0x%08x now 0x%08x, remove stale identity", oldNodeNum, newNodeNum);
|
||||
removeNodeByNum(oldNodeNum);
|
||||
} else {
|
||||
// Lite entry already absent: drop any orphaned satellite-store entries directly.
|
||||
@@ -4377,7 +4376,7 @@ bool NodeDB::backupPreferences(meshtastic_AdminMessage_BackupLocation location)
|
||||
if (success) {
|
||||
LOG_INFO("Saved backup preferences");
|
||||
} else {
|
||||
LOG_ERROR("Failed to save backup preferences to file");
|
||||
LOG_ERROR("Save backup prefs to file failed");
|
||||
}
|
||||
} else if (location == meshtastic_AdminMessage_BackupLocation_SD) {
|
||||
// TODO: After more mainline SD card support
|
||||
@@ -4394,7 +4393,7 @@ bool NodeDB::restorePreferences(meshtastic_AdminMessage_BackupLocation location,
|
||||
spiLock->lock();
|
||||
if (!FSCom.exists(backupFileName)) {
|
||||
spiLock->unlock();
|
||||
LOG_WARN("Could not restore. No backup file found");
|
||||
LOG_WARN("Can't restore, no backup file");
|
||||
return false;
|
||||
} else {
|
||||
spiLock->unlock();
|
||||
@@ -4429,12 +4428,12 @@ bool NodeDB::restorePreferences(meshtastic_AdminMessage_BackupLocation location,
|
||||
|
||||
success = saveToDisk(restoreWhat);
|
||||
if (success) {
|
||||
LOG_INFO("Restored preferences from backup");
|
||||
LOG_INFO("Restored prefs from backup");
|
||||
} else {
|
||||
LOG_ERROR("Failed to save restored preferences to flash");
|
||||
LOG_ERROR("Save restored prefs to flash failed");
|
||||
}
|
||||
} else {
|
||||
LOG_ERROR("Failed to restore preferences from backup file");
|
||||
LOG_ERROR("Restore prefs from backup failed");
|
||||
}
|
||||
} else if (location == meshtastic_AdminMessage_BackupLocation_SD) {
|
||||
// TODO: After more mainline SD card support
|
||||
@@ -4458,7 +4457,7 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co
|
||||
|
||||
// Currently portuino is mostly used for simulation. Make sure the user notices something really bad happened
|
||||
#ifdef ARCH_PORTDUINO
|
||||
LOG_ERROR("A critical failure occurred");
|
||||
LOG_ERROR("Critical failure");
|
||||
// TODO: Determine if other critical errors should also cause an immediate exit
|
||||
if (code == meshtastic_CriticalErrorCode_FLASH_CORRUPTION_RECOVERABLE ||
|
||||
code == meshtastic_CriticalErrorCode_FLASH_CORRUPTION_UNRECOVERABLE)
|
||||
|
||||
+12
-13
@@ -64,13 +64,13 @@ bool PacketHistory::wasSeenRecently(const meshtastic_MeshPacket *p, bool withUpd
|
||||
bool *wasUpgraded)
|
||||
{
|
||||
if (!initOk()) {
|
||||
LOG_ERROR("Packet History - Was Seen Recently: NOT INITIALIZED!");
|
||||
LOG_ERROR("Packet History - Was Seen Recently: NOT INITIALIZED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (p->id == 0) {
|
||||
#if VERBOSE_PACKET_HISTORY
|
||||
LOG_DEBUG("Packet History - Was Seen Recently: ID is 0, not a floodable message");
|
||||
LOG_DEBUG("Packet History - Was Seen Recently: ID 0, not floodable");
|
||||
#endif
|
||||
return false; // Not a floodable message ID, so we don't care
|
||||
}
|
||||
@@ -107,8 +107,8 @@ bool PacketHistory::wasSeenRecently(const meshtastic_MeshPacket *p, bool withUpd
|
||||
|
||||
// Check for hop_limit upgrade scenario
|
||||
if (seenRecently && wasUpgraded && getHighestHopLimit(*found) < p->hop_limit) {
|
||||
LOG_DEBUG("Packet History - Hop limit upgrade: packet 0x%08x from hop_limit=%d to hop_limit=%d", p->id,
|
||||
getHighestHopLimit(*found), p->hop_limit);
|
||||
LOG_DEBUG("Packet History - Hop limit upgrade: packet 0x%08x hop_limit=%d -> %d", p->id, getHighestHopLimit(*found),
|
||||
p->hop_limit);
|
||||
*wasUpgraded = true;
|
||||
} else if (wasUpgraded) {
|
||||
*wasUpgraded = false; // Initialize to false if not an upgrade
|
||||
@@ -234,7 +234,7 @@ void PacketHistory::hashInsert(NodeNum sender, PacketId id, uint16_t slotIdx)
|
||||
}
|
||||
bucket = (bucket + 1) & hashMask;
|
||||
}
|
||||
LOG_ERROR("Packet History - hashInsert: table full or corrupted, rebuilding");
|
||||
LOG_ERROR("Packet History - hashInsert: table full or corrupt, rebuild");
|
||||
hashRebuild();
|
||||
}
|
||||
|
||||
@@ -357,8 +357,7 @@ void PacketHistory::insert(const PacketRecord &r)
|
||||
it = (base + recentPacketsCapacity);
|
||||
} else {
|
||||
if (it->rxTimeMsec == 0) {
|
||||
LOG_WARN("Packet History - insert: Found packet s=0x%08x id=0x%08x with rxTimeMsec = 0, slot %d/%d. Should never "
|
||||
"happen!",
|
||||
LOG_WARN("Packet History - insert: Found s=0x%08x id=0x%08x rxTimeMsec = 0, slot %d/%d. Should never happen",
|
||||
it->sender, it->id, it - base, recentPacketsCapacity);
|
||||
}
|
||||
if ((now_millis - it->rxTimeMsec) > OldtrxTimeMsec) { // 49.7 days rollover friendly
|
||||
@@ -373,7 +372,7 @@ void PacketHistory::insert(const PacketRecord &r)
|
||||
}
|
||||
|
||||
if (tu == NULL) {
|
||||
LOG_ERROR("Packet History - insert: No free slot, no matched packet, no oldest to reuse. Something leaked."); // mx
|
||||
LOG_ERROR("Packet History - insert: No free/matched/oldest slot. Something leaked"); // mx
|
||||
// assert(false); // This should never happen, we should always have at least one packet to clear
|
||||
return; // Return early if we can't update the history
|
||||
}
|
||||
@@ -399,7 +398,7 @@ void PacketHistory::insert(const PacketRecord &r)
|
||||
} else {
|
||||
// debug only
|
||||
#if VERBOSE_PACKET_HISTORY
|
||||
LOG_WARN("Packet History - insert: Reusing slot aged %.3fs < %ds with MATCHED PACKET - this is normal",
|
||||
LOG_WARN("Packet History - insert: Reusing slot aged %.3fs < %ds with MATCHED PACKET - normal",
|
||||
OldtrxTimeMsec / 1000., RECENT_WARN_AGE / 1000);
|
||||
#endif
|
||||
}
|
||||
@@ -424,7 +423,7 @@ void PacketHistory::insert(const PacketRecord &r)
|
||||
|
||||
if (r.rxTimeMsec == 0) {
|
||||
#if VERBOSE_PACKET_HISTORY
|
||||
LOG_WARN("Packet History - insert: I will not store packet with rxTimeMsec = 0.");
|
||||
LOG_WARN("Packet History - insert: Won't store packet with rxTimeMsec = 0");
|
||||
#endif
|
||||
return; // Return early if we can't update the history
|
||||
}
|
||||
@@ -457,7 +456,7 @@ void PacketHistory::insert(const PacketRecord &r)
|
||||
bool PacketHistory::wasRelayer(const uint8_t relayer, const uint32_t id, const NodeNum sender, bool *wasSole)
|
||||
{
|
||||
if (!initOk()) {
|
||||
LOG_ERROR("PacketHistory - wasRelayer: NOT INITIALIZED!");
|
||||
LOG_ERROR("PacketHistory - wasRelayer: NOT INITIALIZED");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -527,7 +526,7 @@ void PacketHistory::checkRelayers(uint8_t relayer1, uint8_t relayer2, uint32_t i
|
||||
*r2WasSole = false;
|
||||
|
||||
if (!initOk()) {
|
||||
LOG_ERROR("PacketHistory - checkRelayers: NOT INITIALIZED!");
|
||||
LOG_ERROR("PacketHistory - checkRelayers: NOT INITIALIZED");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -545,7 +544,7 @@ void PacketHistory::checkRelayers(uint8_t relayer1, uint8_t relayer2, uint32_t i
|
||||
void PacketHistory::removeRelayer(const uint8_t relayer, const uint32_t id, const NodeNum sender)
|
||||
{
|
||||
if (!initOk()) {
|
||||
LOG_ERROR("Packet History - remove Relayer: NOT INITIALIZED!");
|
||||
LOG_ERROR("Packet History - remove Relayer: NOT INITIALIZED");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+16
-17
@@ -216,11 +216,11 @@ static PhoneAuthSlot *findOrAllocSlot_LH(PhoneAPI *p)
|
||||
if (!s.authorized) {
|
||||
s.who = p;
|
||||
s.epoch = 0;
|
||||
LOG_WARN("Lockdown: auth slot table full, evicted stale unauthorized slot for new PhoneAPI %p", p);
|
||||
LOG_WARN("Lockdown: auth slots full, evicted stale unauthorized slot for new PhoneAPI %p", p);
|
||||
return &s;
|
||||
}
|
||||
}
|
||||
LOG_WARN("Lockdown: auth slot table full of authorized sessions, refusing new PhoneAPI %p (fail-closed)", p);
|
||||
LOG_WARN("Lockdown: auth slots full of authorized sessions, refuse new PhoneAPI %p (fail-closed)", p);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ void PhoneAPI::handleStartConfig()
|
||||
if (config_nonce == SPECIAL_NONCE_ONLY_NODES) {
|
||||
// If client only wants node info, jump directly to sending nodes
|
||||
state = STATE_SEND_OWN_NODEINFO;
|
||||
LOG_INFO("Client only wants node info, skipping other config");
|
||||
LOG_INFO("Client only wants node info, skip other config");
|
||||
} else {
|
||||
state = STATE_SEND_MY_INFO;
|
||||
}
|
||||
@@ -457,7 +457,7 @@ bool PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength)
|
||||
ourNum != 0 && toRadioScratch.packet.which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
|
||||
toRadioScratch.packet.decoded.portnum == meshtastic_PortNum_ADMIN_APP && toRadioScratch.packet.to == ourNum;
|
||||
if (!isLocalAdmin) {
|
||||
LOG_INFO("Lockdown: Dropping non-admin ToRadio packet from unauthorized client");
|
||||
LOG_INFO("Lockdown: Drop non-admin ToRadio packet from unauthorized client");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -475,7 +475,7 @@ bool PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength)
|
||||
case meshtastic_ToRadio_xmodemPacket_tag:
|
||||
#ifdef MESHTASTIC_PHONEAPI_ACCESS_CONTROL
|
||||
if (!getAdminAuthorized()) {
|
||||
LOG_INFO("Lockdown: Dropping xmodem packet from unauthorized client");
|
||||
LOG_INFO("Lockdown: Drop xmodem packet from unauthorized client");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
@@ -488,15 +488,14 @@ bool PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength)
|
||||
case meshtastic_ToRadio_mqttClientProxyMessage_tag:
|
||||
LOG_DEBUG("Got MqttClientProxy message");
|
||||
if (state != STATE_SEND_PACKETS) {
|
||||
LOG_WARN("Ignore MqttClientProxy message while completing config handshake");
|
||||
LOG_WARN("Ignore MqttClientProxy msg during config handshake");
|
||||
break;
|
||||
}
|
||||
if (mqtt && moduleConfig.mqtt.proxy_to_client_enabled && moduleConfig.mqtt.enabled &&
|
||||
(channels.anyMqttEnabled() || moduleConfig.mqtt.map_reporting_enabled)) {
|
||||
mqtt->onClientProxyReceive(toRadioScratch.mqttClientProxyMessage);
|
||||
} else {
|
||||
LOG_WARN("MqttClientProxy received but proxy is not enabled, no channels have up/downlink, or map reporting "
|
||||
"not enabled");
|
||||
LOG_WARN("MqttClientProxy received but proxy disabled, no up/downlink channels, or map reporting off");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
@@ -511,7 +510,7 @@ bool PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength)
|
||||
// a queue-status reply.
|
||||
if (toRadioScratch.heartbeat.nonce == 1) {
|
||||
if (nodeInfoModule) {
|
||||
LOG_INFO("Broadcasting nodeinfo ping (serial)");
|
||||
LOG_INFO("Broadcast nodeinfo ping (serial)");
|
||||
nodeInfoModule->sendOurNodeInfo(NODENUM_BROADCAST, true, 0, true);
|
||||
}
|
||||
} else {
|
||||
@@ -524,7 +523,7 @@ bool PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
LOG_ERROR("Error: ignore malformed toradio");
|
||||
LOG_ERROR("Ignore malformed toradio");
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -1804,7 +1803,7 @@ bool PhoneAPI::handleToRadioPacket(meshtastic_MeshPacket &p)
|
||||
return true;
|
||||
}
|
||||
case LocalAdminGate::DropUnauthorized:
|
||||
LOG_WARN("Lockdown: dropping admin payload variant=%d from unauthorized connection", admin.which_payload_variant);
|
||||
LOG_WARN("Lockdown: drop admin payload variant=%d from unauthorized connection", admin.which_payload_variant);
|
||||
return false;
|
||||
case LocalAdminGate::NotAdmin:
|
||||
case LocalAdminGate::AuthorizedPassThrough:
|
||||
@@ -1818,7 +1817,7 @@ bool PhoneAPI::handleToRadioPacket(meshtastic_MeshPacket &p)
|
||||
if (SimRadio::instance == nullptr)
|
||||
#endif
|
||||
if (p.id > 0 && wasSeenRecently(p.id)) {
|
||||
LOG_DEBUG("Ignore packet from phone, already seen recently");
|
||||
LOG_DEBUG("Ignore phone packet, seen recently");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1878,7 +1877,7 @@ int PhoneAPI::onNotify(uint32_t newValue)
|
||||
// doesn't call this from idle)
|
||||
|
||||
if (state == STATE_SEND_PACKETS) {
|
||||
LOG_INFO("Tell client we have new packets %u", newValue);
|
||||
LOG_INFO("Tell client new packets %u", newValue);
|
||||
onNowHasData(newValue);
|
||||
} else {
|
||||
LOG_DEBUG("Client not yet interested in packets (state=%d)", state);
|
||||
@@ -2049,7 +2048,7 @@ bool PhoneAPI::handleLockdownAuthInline(const meshtastic_LockdownAuth &la)
|
||||
zeroPassphrase();
|
||||
return true;
|
||||
}
|
||||
LOG_INFO("Lockdown: LOCK NOW command received from authorized connection");
|
||||
LOG_INFO("Lockdown: LOCK NOW from authorized connection");
|
||||
EncryptedStorage::lockNow();
|
||||
revokeAllAuth();
|
||||
queueLockdownStatus(meshtastic_LockdownStatus_State_LOCKED, "", 0, 0, 0);
|
||||
@@ -2073,7 +2072,7 @@ bool PhoneAPI::handleLockdownAuthInline(const meshtastic_LockdownAuth &la)
|
||||
}
|
||||
if (!EncryptedStorage::isLockdownActive()) {
|
||||
// Already off - nothing to do; report DISABLED so the client UI settles.
|
||||
LOG_INFO("Lockdown: disable requested but lockdown is not active");
|
||||
LOG_INFO("Lockdown: disable requested but not active");
|
||||
queueLockdownStatus(meshtastic_LockdownStatus_State_DISABLED, "", 0, 0, 0);
|
||||
zeroPassphrase();
|
||||
return true;
|
||||
@@ -2156,7 +2155,7 @@ bool PhoneAPI::handleLockdownAuthInline(const meshtastic_LockdownAuth &la)
|
||||
slot->pendingUnlockAfterReload = true;
|
||||
}
|
||||
lockdownReloadPending = true;
|
||||
LOG_INFO("Lockdown: storage unlocked, awaiting reload before client visibility");
|
||||
LOG_INFO("Lockdown: storage unlocked, await reload before client visibility");
|
||||
}
|
||||
} else {
|
||||
LOG_INFO("Lockdown: passphrase re-verify for admin authorization");
|
||||
@@ -2166,7 +2165,7 @@ bool PhoneAPI::handleLockdownAuthInline(const meshtastic_LockdownAuth &la)
|
||||
// Storage was already unlocked - no reload needed. Authorize
|
||||
// and surface UNLOCKED to the client immediately.
|
||||
setAdminAuthorized(true);
|
||||
LOG_INFO("Lockdown: passphrase verified, this connection authorized");
|
||||
LOG_INFO("Lockdown: passphrase verified, connection authorized");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ template <class T> class ProtobufModule : protected SinglePortModule
|
||||
LOG_INFO("Received %s from=0x%08x, id=0x%08x, portnum=%d, payloadlen=%d", name, mp.from, mp.id, p.portnum,
|
||||
p.payload.size);
|
||||
} else {
|
||||
LOG_ERROR("Error decoding proto module!");
|
||||
LOG_ERROR("Error decoding proto module");
|
||||
// if we can't decode it, nobody can process it!
|
||||
return ProcessMessage::STOP;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ template <class T> class ProtobufModule : protected SinglePortModule
|
||||
if (pb_decode_from_bytes(p.payload.bytes, p.payload.size, fields, &scratch)) {
|
||||
decoded = &scratch;
|
||||
} else {
|
||||
LOG_ERROR("Error decoding proto module!");
|
||||
LOG_ERROR("Error decoding proto module");
|
||||
// if we can't decode it, nobody can process it!
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -318,14 +318,14 @@ bool RF95Interface::isChannelActive()
|
||||
result = lora->scanChannel();
|
||||
|
||||
if (result == RADIOLIB_PREAMBLE_DETECTED) {
|
||||
// LOG_DEBUG("Channel is busy!");
|
||||
// LOG_DEBUG("Channel is busy");
|
||||
return true;
|
||||
}
|
||||
if (result != RADIOLIB_CHANNEL_FREE)
|
||||
LOG_ERROR("RF95 isChannelActive %s%d", radioLibErr, result);
|
||||
assert(result != RADIOLIB_ERR_WRONG_MODEM);
|
||||
|
||||
// LOG_DEBUG("Channel is free!");
|
||||
// LOG_DEBUG("Channel is free");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+10
-11
@@ -692,7 +692,7 @@ void getRegionPresetMap(meshtastic_LoRaRegionPresetMap &map)
|
||||
// log once and stop. An incomplete map means clients won't constrain the
|
||||
// omitted regions, so this must be discoverable rather than silent.
|
||||
if (map.region_groups_count >= maxRegions) {
|
||||
LOG_ERROR("Region preset map full at %u regions; remaining regions omitted", (unsigned)maxRegions);
|
||||
LOG_ERROR("Region preset map full at %u regions; rest omitted", (unsigned)maxRegions);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -832,11 +832,11 @@ uint32_t RadioInterface::getTxDelayMsecWeighted(meshtastic_MeshPacket *p)
|
||||
// LOG_DEBUG("rx_snr of %f so setting CWsize to:%d", snr, CWsize);
|
||||
if (shouldRebroadcastEarlyLikeRouter(p)) {
|
||||
delay = random(0, 2 * CWsize) * slotTimeMsec;
|
||||
LOG_DEBUG("rx_snr found in packet. Router: setting tx delay:%d", delay);
|
||||
LOG_DEBUG("rx_snr in packet. Router: tx delay:%d", delay);
|
||||
} else {
|
||||
// offset the maximum delay for routers: (2 * CWmax * slotTimeMsec)
|
||||
delay = (2 * CWmax * slotTimeMsec) + random(0, pow_of_2(CWsize)) * slotTimeMsec;
|
||||
LOG_DEBUG("rx_snr found in packet. Setting tx delay:%d", delay);
|
||||
LOG_DEBUG("rx_snr in packet. Tx delay:%d", delay);
|
||||
}
|
||||
|
||||
return delay;
|
||||
@@ -1108,7 +1108,7 @@ bool RadioInterface::checkOrClampConfigLora(meshtastic_Config_LoRaConfig &loraCo
|
||||
// Validation must still fail so callers route into the clamp, but quietly:
|
||||
// the clamp will accept this config by swapping regions, so don't record a
|
||||
// critical error or alarm the user over a change that is about to succeed.
|
||||
LOG_INFO("Preset %s implies region swap %s to %s, deferring to clamp", presetName, newRegion->name,
|
||||
LOG_INFO("Preset %s implies region swap %s to %s, defer to clamp", presetName, newRegion->name,
|
||||
swapRegion->name);
|
||||
return false;
|
||||
}
|
||||
@@ -1263,7 +1263,7 @@ void RadioInterface::applyModemConfig()
|
||||
// If custom CR is being used already, check if the new preset is higher
|
||||
if (loraConfig.coding_rate >= 5 && loraConfig.coding_rate <= 8 && loraConfig.coding_rate < newcr) {
|
||||
cr = newcr;
|
||||
LOG_INFO("Default Coding Rate is higher than custom setting, using %u", cr);
|
||||
LOG_INFO("Default Coding Rate above custom setting, use %u", cr);
|
||||
}
|
||||
// If the custom CR is higher than the preset, use it
|
||||
else if (loraConfig.coding_rate >= 5 && loraConfig.coding_rate <= 8 && loraConfig.coding_rate > newcr) {
|
||||
@@ -1276,8 +1276,7 @@ void RadioInterface::applyModemConfig()
|
||||
} else { // if not using preset, then just use the custom settings
|
||||
if (validateConfigLora(loraConfig)) {
|
||||
} else {
|
||||
LOG_WARN("Invalid LoRa config settings, cannot apply requested modem config - falling back to %s defaults",
|
||||
newRegion->name);
|
||||
LOG_WARN("Invalid LoRa config, can't apply modem config - fall back to %s defaults", newRegion->name);
|
||||
clampConfigLora(loraConfig);
|
||||
}
|
||||
// Clamp at the source so numFreqSlots below can never be 0 (a bandwidth-0 config may already be persisted)
|
||||
@@ -1370,9 +1369,9 @@ void RadioInterface::applyModemConfig()
|
||||
newRegion->freqEnd - newRegion->freqStart);
|
||||
LOG_INFO("numFreqSlots: %u x %.3fkHz", numFreqSlots, bw);
|
||||
if (newRegion->overrideSlot > 0) {
|
||||
LOG_INFO("Using region explicit override slot: %d", newRegion->overrideSlot);
|
||||
LOG_INFO("Region explicit override slot: %d", newRegion->overrideSlot);
|
||||
} else if (newRegion->overrideSlot == OVERRIDE_SLOT_PRESET_HASH) {
|
||||
LOG_INFO("Using region preset name hash for slot selection");
|
||||
LOG_INFO("Use region preset name hash for slot");
|
||||
}
|
||||
LOG_INFO("channel_num: %d", channel_num + 1);
|
||||
LOG_INFO("frequency: %f", getFreq());
|
||||
@@ -1410,7 +1409,7 @@ void RadioInterface::limitPower(int8_t loraMaxPower)
|
||||
maxPower = myRegion->powerLimit;
|
||||
|
||||
if ((power > maxPower) && !devicestate.owner.is_licensed) {
|
||||
LOG_INFO("Lower transmit power because of regulatory limits");
|
||||
LOG_INFO("Lower Tx power: regulatory limits");
|
||||
power = maxPower;
|
||||
}
|
||||
|
||||
@@ -1477,7 +1476,7 @@ size_t RadioInterface::beginSending(meshtastic_MeshPacket *p)
|
||||
radioBuffer.header.next_hop = p->next_hop;
|
||||
radioBuffer.header.relay_node = p->relay_node;
|
||||
if (p->hop_limit > HOP_MAX) {
|
||||
LOG_WARN("hop limit %d is too high, setting to %d", p->hop_limit, HOP_RELIABLE);
|
||||
LOG_WARN("hop limit %d too high, set to %d", p->hop_limit, HOP_RELIABLE);
|
||||
p->hop_limit = HOP_RELIABLE;
|
||||
}
|
||||
radioBuffer.header.flags =
|
||||
|
||||
@@ -107,7 +107,7 @@ bool RadioLibInterface::canSendImmediately()
|
||||
// If we've been trying to send the same packet more than one minute and we haven't gotten a
|
||||
// TX IRQ from the radio, the radio is probably broken.
|
||||
if (busyTx && !Throttle::isWithinTimespanMs(lastTxStart, 60000)) {
|
||||
LOG_ERROR("Hardware Failure! busyTx for more than 60s");
|
||||
LOG_ERROR("Hardware Failure! busyTx >60s");
|
||||
RECORD_CRITICALERROR(meshtastic_CriticalErrorCode_TRANSMIT_FAILED);
|
||||
// reboot in 5 seconds when this condition occurs.
|
||||
rebootAtMsec = lastTxStart + 65000;
|
||||
@@ -339,7 +339,7 @@ void RadioLibInterface::resetNoiseFloor()
|
||||
currentSampleIndex = 0;
|
||||
isNoiseFloorBufferFull = false;
|
||||
currentNoiseFloor = NOISE_FLOOR_DEFAULT;
|
||||
LOG_INFO("Noise floor reset - rolling window collection will restart");
|
||||
LOG_INFO("Noise floor reset - rolling window will restart");
|
||||
}
|
||||
|
||||
bool RadioLibInterface::randomBytes(uint8_t *buffer, size_t length)
|
||||
@@ -445,7 +445,7 @@ void RadioLibInterface::onNotify(uint32_t notification)
|
||||
// The beacon's target radio config is invalid (bad preset/region, or an
|
||||
// unlicensed node keying up on a ham-only region). Drop the packet - never
|
||||
// transmit it on the current (home) config - and move on to the next queued packet.
|
||||
LOG_DEBUG("Beacon: invalid TX radio config, dropping packet 0x%08x", txp->id);
|
||||
LOG_DEBUG("Beacon: invalid TX radio config, drop packet 0x%08x", txp->id);
|
||||
meshtastic_MeshPacket *bad = txQueue.dequeue();
|
||||
MeshBeaconModule::clearTargetRadioSettings(bad);
|
||||
packetPool.release(bad);
|
||||
@@ -468,7 +468,7 @@ void RadioLibInterface::onNotify(uint32_t notification)
|
||||
txp = txQueue.dequeue();
|
||||
assert(txp);
|
||||
startSend(txp);
|
||||
LOG_DEBUG("%d packets remain in the TX queue", txQueue.getMaxLen() - txQueue.getFree());
|
||||
LOG_DEBUG("%d packets in TX queue", txQueue.getMaxLen() - txQueue.getFree());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -539,7 +539,7 @@ void RadioLibInterface::clampToLateRebroadcastWindow(NodeNum from, PacketId id)
|
||||
p->tx_after = millis() + getTxDelayMsecWeightedWorst(p->rx_snr);
|
||||
bool dropped = false;
|
||||
if (txQueue.enqueue(p, &dropped)) {
|
||||
LOG_DEBUG("Move existing queued packet to the late rebroadcast window %dms from now", p->tx_after - millis());
|
||||
LOG_DEBUG("Move queued packet to late rebroadcast window %dms from now", p->tx_after - millis());
|
||||
} else {
|
||||
packetPool.release(p);
|
||||
}
|
||||
@@ -557,7 +557,7 @@ bool RadioLibInterface::removePendingTXPacket(NodeNum from, PacketId id, uint32_
|
||||
{
|
||||
meshtastic_MeshPacket *p = txQueue.remove(from, id, true, true, hop_limit_lt);
|
||||
if (p) {
|
||||
LOG_DEBUG("Dropping pending-TX packet 0x%08x with hop limit %d", p->id, p->hop_limit);
|
||||
LOG_DEBUG("Drop pending-TX packet 0x%08x, hop limit %d", p->id, p->hop_limit);
|
||||
packetPool.release(p);
|
||||
return true;
|
||||
}
|
||||
@@ -607,7 +607,7 @@ void RadioLibInterface::handleReceiveInterrupt()
|
||||
// when this is called, we should be in receive mode - if we are not, just jump out instead of bombing. Possible Race
|
||||
// Condition?
|
||||
if (!isReceiving) {
|
||||
LOG_ERROR("handleReceiveInterrupt called when not in rx mode, which shouldn't happen");
|
||||
LOG_ERROR("handleReceiveInterrupt called while not in rx mode");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -634,7 +634,7 @@ void RadioLibInterface::handleReceiveInterrupt()
|
||||
#endif
|
||||
if (state != RADIOLIB_ERR_NONE) {
|
||||
// Log PacketHeader similar to RadioInterface::printPacket so we can try to match RX errors to other packets in the logs.
|
||||
LOG_ERROR("Ignore received packet due to error=%d (maybe id=0x%08x fr=0x%08x to=0x%08x flags=0x%02x rxSNR=%g rxRSSI=%i "
|
||||
LOG_ERROR("Ignore rx packet, error=%d (maybe id=0x%08x fr=0x%08x to=0x%08x flags=0x%02x rxSNR=%g rxRSSI=%i "
|
||||
"nextHop=0x%x relay=0x%x)",
|
||||
state, radioBuffer.header.id, radioBuffer.header.from, radioBuffer.header.to, radioBuffer.header.flags,
|
||||
iface->getSNR(), lround(iface->getRSSI()), radioBuffer.header.next_hop, radioBuffer.header.relay_node);
|
||||
@@ -759,7 +759,7 @@ bool RadioLibInterface::startSend(meshtastic_MeshPacket *txp)
|
||||
/* NOTE: Minimize the actions before startTransmit() to keep the time between
|
||||
channel scan and actual transmit as low as possible to avoid collisions. */
|
||||
if (disabled || !config.lora.tx_enabled) {
|
||||
LOG_WARN("Drop Tx packet because LoRa Tx disabled");
|
||||
LOG_WARN("Drop Tx packet: LoRa Tx disabled");
|
||||
#if !MESHTASTIC_EXCLUDE_BEACON
|
||||
// This packet may have already triggered a beacon radio switch in TRANSMIT_DELAY_COMPLETED;
|
||||
// since it never reaches completeSending() here, restore the radio so it isn't left on the
|
||||
|
||||
+34
-36
@@ -202,7 +202,7 @@ bool Router::shouldDecrementHopLimit(const meshtastic_MeshPacket *p)
|
||||
if (node && nodeInfoLiteIsFavorite(node) && nodeInfoLiteHasUser(node) &&
|
||||
IS_ONE_OF(node->role, meshtastic_Config_DeviceConfig_Role_ROUTER, meshtastic_Config_DeviceConfig_Role_ROUTER_LATE,
|
||||
meshtastic_Config_DeviceConfig_Role_CLIENT_BASE)) {
|
||||
LOG_DEBUG("Identified unique favorite relay router 0x%08x from last byte 0x%x", resolved, p->relay_node);
|
||||
LOG_DEBUG("Unique favorite relay router 0x%08x from last byte 0x%x", resolved, p->relay_node);
|
||||
return false; // Don't decrement hop_limit
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ int32_t Router::runOnce()
|
||||
perhapsHandleReceived(mp);
|
||||
}
|
||||
|
||||
// LOG_DEBUG("Sleep forever!");
|
||||
// LOG_DEBUG("Sleep forever");
|
||||
return INT32_MAX; // Wait a long time - until we get woken for the message queue
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ meshtastic_QueueStatus Router::getQueueStatus()
|
||||
ErrorCode Router::sendLocal(meshtastic_MeshPacket *p, RxSource src)
|
||||
{
|
||||
if (p->to == 0) {
|
||||
LOG_ERROR("Packet received with to: of 0!");
|
||||
LOG_ERROR("Packet received with to=0");
|
||||
}
|
||||
// No need to deliver externally if the destination is the local node
|
||||
if (isToUs(p)) {
|
||||
@@ -385,7 +385,7 @@ ErrorCode Router::sendLocal(meshtastic_MeshPacket *p, RxSource src)
|
||||
ErrorCode Router::send(meshtastic_MeshPacket *p)
|
||||
{
|
||||
if (isToUs(p)) {
|
||||
LOG_ERROR("BUG! send() called with packet destined for local node!");
|
||||
LOG_ERROR("BUG! send() with packet for local node");
|
||||
packetPool.release(p);
|
||||
return meshtastic_Routing_Error_BAD_REQUEST;
|
||||
} // should have already been handled by sendLocal
|
||||
@@ -397,7 +397,7 @@ ErrorCode Router::send(meshtastic_MeshPacket *p)
|
||||
if (hourlyTxPercent > effectiveDutyCycle) {
|
||||
uint8_t silentMinutes = airTime->getSilentMinutes(hourlyTxPercent, effectiveDutyCycle);
|
||||
|
||||
LOG_WARN("Duty cycle limit exceeded. Aborting send for now, you can send again in %d mins", silentMinutes);
|
||||
LOG_WARN("Duty cycle limit exceeded, abort send, retry in %d mins", silentMinutes);
|
||||
|
||||
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
||||
if (cn) {
|
||||
@@ -475,7 +475,7 @@ ErrorCode Router::send(meshtastic_MeshPacket *p)
|
||||
// p->from as the original sender, so do not rewrite their POSITION_APP payload.
|
||||
if (isFromUs(p)) {
|
||||
if (!applyPositionPrecisionForChannel(*p, p->channel)) {
|
||||
LOG_ERROR("Dropping malformed position packet before send");
|
||||
LOG_ERROR("Drop malformed position packet before send");
|
||||
packetPool.release(p);
|
||||
return meshtastic_Routing_Error_BAD_REQUEST;
|
||||
}
|
||||
@@ -652,18 +652,18 @@ bool checkXeddsaReceivePolicy(meshtastic_MeshPacket *p)
|
||||
nodeInfoLiteSetBit(node, NODEINFO_BITFIELD_HAS_XEDDSA_SIGNED_MASK, true);
|
||||
LOG_DEBUG("Verified XEdDSA signature from 0x%08x", p->from);
|
||||
} else {
|
||||
LOG_WARN("XEdDSA signature verification failed from 0x%08x, dropping", p->from);
|
||||
LOG_WARN("XEdDSA signature verify failed from 0x%08x, drop", p->from);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
const auto bootstrap = verifyFirstContactNodeInfo(p);
|
||||
if (bootstrap == NodeInfoBootstrapResult::INVALID) {
|
||||
LOG_WARN("Invalid first-contact XEdDSA NodeInfo from 0x%08x, dropping", p->from);
|
||||
LOG_WARN("Invalid first-contact XEdDSA NodeInfo from 0x%08x, drop", p->from);
|
||||
return false;
|
||||
}
|
||||
if (bootstrap == NodeInfoBootstrapResult::VERIFIED)
|
||||
return true;
|
||||
LOG_DEBUG("No public key for 0x%08x, cannot verify XEdDSA signature", p->from);
|
||||
LOG_DEBUG("No public key for 0x%08x, can't verify XEdDSA signature", p->from);
|
||||
if (strict)
|
||||
return false;
|
||||
}
|
||||
@@ -672,14 +672,13 @@ bool checkXeddsaReceivePolicy(meshtastic_MeshPacket *p)
|
||||
// senders emit only those two sizes (perhapsEncode sets 0 or XEDDSA_SIGNATURE_SIZE). Drop
|
||||
// it: a crafted partial signature would otherwise land in the unsigned branch below while
|
||||
// its bytes inflated the size estimate, letting a forged broadcast dodge the downgrade drop.
|
||||
LOG_WARN("Malformed XEdDSA signature (%u bytes) from 0x%08x, dropping", (unsigned)p->decoded.xeddsa_signature.size,
|
||||
p->from);
|
||||
LOG_WARN("Malformed XEdDSA signature (%u bytes) from 0x%08x, drop", (unsigned)p->decoded.xeddsa_signature.size, p->from);
|
||||
return false;
|
||||
} else {
|
||||
if (p->pki_encrypted)
|
||||
return true;
|
||||
if (strict) {
|
||||
LOG_WARN("Dropping unsigned packet from 0x%08x in Strict signature mode", p->from);
|
||||
LOG_WARN("Drop unsigned packet from 0x%08x in Strict signature mode", p->from);
|
||||
return false;
|
||||
}
|
||||
if (compatible)
|
||||
@@ -692,7 +691,7 @@ bool checkXeddsaReceivePolicy(meshtastic_MeshPacket *p)
|
||||
if (!canonicalSignableSize(&p->decoded, &canonicalSize))
|
||||
return true; // can't size it; never drop on a sizing failure
|
||||
if (canonicalSize + XEDDSA_SIGNATURE_FIELD_BYTES + MESHTASTIC_HEADER_LENGTH <= MAX_LORA_PAYLOAD_LEN) {
|
||||
LOG_WARN("Dropping unsigned packet from 0x%08x that previously signed", p->from);
|
||||
LOG_WARN("Drop unsigned packet from 0x%08x that previously signed", p->from);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -735,11 +734,11 @@ RoutingAuthVerdict passesRoutingAuthGate(meshtastic_MeshPacket *p)
|
||||
return RoutingAuthVerdict::REJECT;
|
||||
}
|
||||
if (state == DecodeState::DECODE_FATAL) {
|
||||
LOG_WARN("Fatal decode error, dropping packet");
|
||||
LOG_WARN("Fatal decode error, drop packet");
|
||||
return RoutingAuthVerdict::REJECT;
|
||||
}
|
||||
if (state == DecodeState::DECODE_FAILURE) {
|
||||
LOG_WARN("Decryptable packet failed decoding, dropping packet");
|
||||
LOG_WARN("Decryptable packet failed decoding, drop");
|
||||
return RoutingAuthVerdict::REJECT;
|
||||
}
|
||||
|
||||
@@ -804,7 +803,7 @@ DecodeState perhapsDecode(meshtastic_MeshPacket *p)
|
||||
|
||||
if (config.device.rebroadcast_mode == meshtastic_Config_DeviceConfig_RebroadcastMode_KNOWN_ONLY &&
|
||||
!nodeInfoLiteHasUser(nodeDB->getMeshNode(p->from))) {
|
||||
LOG_DEBUG("Node 0x%08x not in nodeDB-> Rebroadcast mode KNOWN_ONLY will ignore packet", p->from);
|
||||
LOG_DEBUG("Node 0x%08x not in nodeDB, Rebroadcast KNOWN_ONLY ignores packet", p->from);
|
||||
return DecodeState::DECODE_FAILURE;
|
||||
}
|
||||
|
||||
@@ -817,7 +816,7 @@ DecodeState perhapsDecode(meshtastic_MeshPacket *p)
|
||||
|
||||
size_t rawSize = p->encrypted.size;
|
||||
if (rawSize > sizeof(bytes)) {
|
||||
LOG_ERROR("Packet too large to attempt decryption! (rawSize=%d > 256)", rawSize);
|
||||
LOG_ERROR("Packet too large to decrypt (rawSize=%d > 256)", rawSize);
|
||||
return DecodeState::DECODE_FATAL;
|
||||
}
|
||||
bool decrypted = false;
|
||||
@@ -874,7 +873,7 @@ DecodeState perhapsDecode(meshtastic_MeshPacket *p)
|
||||
adminKeyFallbackRefund();
|
||||
}
|
||||
if (decrypted) {
|
||||
LOG_INFO("PKI Decryption worked!");
|
||||
LOG_INFO("PKI Decryption worked");
|
||||
meshtastic_Data decodedtmp;
|
||||
memset(&decodedtmp, 0, sizeof(decodedtmp));
|
||||
size_t payloadSize = rawSize - MESHTASTIC_PKC_OVERHEAD;
|
||||
@@ -888,7 +887,7 @@ DecodeState perhapsDecode(meshtastic_MeshPacket *p)
|
||||
}
|
||||
decrypted = true;
|
||||
rawSize = payloadSize; // commit the overhead subtraction only on full success
|
||||
LOG_INFO("Packet decrypted using PKI!");
|
||||
LOG_INFO("Packet decrypted using PKI");
|
||||
p->pki_encrypted = true;
|
||||
memcpy(p->public_key.bytes, remotePublic.bytes, 32);
|
||||
p->public_key.size = 32;
|
||||
@@ -906,7 +905,7 @@ DecodeState perhapsDecode(meshtastic_MeshPacket *p)
|
||||
} else {
|
||||
// AEAD already authenticated this ciphertext, so no other candidate could decode it -
|
||||
// the payload is simply malformed.
|
||||
LOG_ERROR("PKC Decrypted, but pb_decode failed!");
|
||||
LOG_ERROR("PKC Decrypted, but pb_decode failed");
|
||||
return DecodeState::DECODE_FAILURE;
|
||||
}
|
||||
}
|
||||
@@ -1014,7 +1013,7 @@ DecodeState perhapsDecode(meshtastic_MeshPacket *p)
|
||||
#endif
|
||||
return DecodeState::DECODE_SUCCESS;
|
||||
} else {
|
||||
LOG_WARN("No suitable channel found for decoding, hash was 0x%x!", p->channel);
|
||||
LOG_WARN("No channel found for decoding, hash 0x%x", p->channel);
|
||||
return (matchedChannel || pkiAttempted || licensedPkiCandidate) ? DecodeState::DECODE_FAILURE
|
||||
: DecodeState::DECODE_OPAQUE;
|
||||
}
|
||||
@@ -1118,7 +1117,7 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p)
|
||||
// If the compressed length is greater than or equal to the original size, don't use the compressed form
|
||||
if (compressed_len >= p->decoded.payload.size) {
|
||||
|
||||
LOG_DEBUG("Not using compressing message");
|
||||
LOG_DEBUG("Not compressing");
|
||||
// Set the uncompressed payload variant anyway. Shouldn't hurt?
|
||||
// p->decoded.which_payloadVariant = Data_payload_tag;
|
||||
|
||||
@@ -1156,13 +1155,12 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p)
|
||||
// We may want to retool things so we can send a PKC packet when the client specifies a key and nodenum, even if the node
|
||||
// is not in the local nodedb
|
||||
if (wouldEncryptWithPKC(p, chIndex, haveDestKey)) {
|
||||
LOG_DEBUG("Use PKI!");
|
||||
LOG_DEBUG("Use PKI");
|
||||
if (numbytes + MESHTASTIC_HEADER_LENGTH + MESHTASTIC_PKC_OVERHEAD > MAX_LORA_PAYLOAD_LEN)
|
||||
return meshtastic_Routing_Error_TOO_LARGE;
|
||||
// Check for a usable public key for the destination (NodeDB or a pending key-verification key)
|
||||
if (!haveDestKey) {
|
||||
LOG_WARN("Unknown public key for destination node 0x%08x (portnum %d), refusing to send legacy DM", p->to,
|
||||
p->decoded.portnum);
|
||||
LOG_WARN("Unknown public key for 0x%08x (portnum %d), refuse legacy DM", p->to, p->decoded.portnum);
|
||||
return meshtastic_Routing_Error_PKI_SEND_FAIL_PUBLIC_KEY;
|
||||
}
|
||||
if (p->pki_encrypted && !memfll(p->public_key.bytes, 0, 32) && memcmp(p->public_key.bytes, destKey.bytes, 32) != 0) {
|
||||
@@ -1173,7 +1171,7 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p)
|
||||
// On failure encrypted.bytes holds no ciphertext, so continuing would put the plaintext
|
||||
// on the air labelled pki_encrypted.
|
||||
if (!crypto->encryptCurve25519(p->to, getFrom(p), destKey, p->id, numbytes, bytes, p->encrypted.bytes)) {
|
||||
LOG_WARN("PKI encryption failed for destination node 0x%08x", p->to);
|
||||
LOG_WARN("PKI encryption failed for 0x%08x", p->to);
|
||||
return meshtastic_Routing_Error_PKI_FAILED;
|
||||
}
|
||||
numbytes += MESHTASTIC_PKC_OVERHEAD;
|
||||
@@ -1289,7 +1287,7 @@ void Router::deliverLocal(meshtastic_MeshPacket *p, RxSource src)
|
||||
// broadcast). Mirrors sendToPhone()'s degrade-on-exhaustion behavior.
|
||||
if (copy)
|
||||
packetPool.release(copy);
|
||||
LOG_WARN("Deferred local queue full/alloc failed, dropping loopback of 0x%08x", p->id);
|
||||
LOG_WARN("Deferred local queue full/alloc failed, drop loopback of 0x%08x", p->id);
|
||||
#ifdef PIO_UNIT_TESTING
|
||||
deferredLocalDropped++;
|
||||
#endif
|
||||
@@ -1372,8 +1370,8 @@ void Router::dispatchReceived(meshtastic_MeshPacket *p, RxSource src)
|
||||
// Fatal decoding error, we can't do anything with this packet
|
||||
LOG_WARN(decodedState == DecodeState::DECODE_POLICY_REJECT
|
||||
? "Packet rejected by signature policy"
|
||||
: (decodedState == DecodeState::DECODE_FATAL ? "Fatal decode error, dropping packet"
|
||||
: "Decryptable packet failed decoding, dropping packet"));
|
||||
: (decodedState == DecodeState::DECODE_FATAL ? "Fatal decode error, drop packet"
|
||||
: "Decryptable packet failed decoding, drop"));
|
||||
// A policy rejection is attacker-controlled input and must not cancel a valid pending
|
||||
// transmission with the same (from, id). Preserve the pre-existing fatal-decode behavior.
|
||||
if (decodedState == DecodeState::DECODE_FATAL)
|
||||
@@ -1404,7 +1402,7 @@ void Router::dispatchReceived(meshtastic_MeshPacket *p, RxSource src)
|
||||
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
|
||||
p->decoded.portnum == meshtastic_PortNum_NEIGHBORINFO_APP &&
|
||||
(!moduleConfig.has_neighbor_info || !moduleConfig.neighbor_info.enabled)) {
|
||||
LOG_DEBUG("Neighbor info module is disabled, ignore neighbor packet");
|
||||
LOG_DEBUG("Neighbor info module disabled, ignore packet");
|
||||
cancelSending(p->from, p->id);
|
||||
skipHandle = true;
|
||||
}
|
||||
@@ -1416,7 +1414,7 @@ void Router::dispatchReceived(meshtastic_MeshPacket *p, RxSource src)
|
||||
p->decoded.portnum == meshtastic_PortNum_MESH_BEACON_APP &&
|
||||
(!moduleConfig.has_mesh_beacon ||
|
||||
!(moduleConfig.mesh_beacon.flags & meshtastic_ModuleConfig_MeshBeaconConfig_Flags_FLAG_LISTEN_ENABLED))) {
|
||||
LOG_DEBUG("Beacon listening is disabled, ignore beacon packet");
|
||||
LOG_DEBUG("Beacon listening disabled, ignore packet");
|
||||
cancelSending(p->from, p->id);
|
||||
skipHandle = true;
|
||||
}
|
||||
@@ -1449,7 +1447,7 @@ void Router::dispatchReceived(meshtastic_MeshPacket *p, RxSource src)
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_MQTT
|
||||
if (p_encrypted == nullptr) {
|
||||
LOG_WARN("p_encrypted is null, skipping MQTT publish");
|
||||
LOG_WARN("p_encrypted null, skip MQTT publish");
|
||||
} else {
|
||||
// Mark as pki_encrypted if it is not yet decoded and MQTT encryption is also enabled, hash matches and it's a DM not
|
||||
// to us (because we would be able to decrypt it)
|
||||
@@ -1469,7 +1467,7 @@ void Router::dispatchReceived(meshtastic_MeshPacket *p, RxSource src)
|
||||
if (encodeResult != meshtastic_Routing_Error_NONE) {
|
||||
// Encryption failed, release the new packet and fall back to sending the original encrypted packet to
|
||||
// MQTT
|
||||
LOG_WARN("Encryption of new TR packet failed, sending original TR to MQTT");
|
||||
LOG_WARN("New TR packet encrypt failed, send original TR to MQTT");
|
||||
packetPool.release(p_encrypted_new);
|
||||
p_encrypted_new = nullptr;
|
||||
} else {
|
||||
@@ -1479,7 +1477,7 @@ void Router::dispatchReceived(meshtastic_MeshPacket *p, RxSource src)
|
||||
}
|
||||
} else {
|
||||
// Allocation failed, log a warning and fall back to sending the original encrypted packet to MQTT
|
||||
LOG_WARN("Failed to allocate new encrypted packet for TR, sending original TR to MQTT");
|
||||
LOG_WARN("Alloc encrypted TR packet failed, send original TR to MQTT");
|
||||
}
|
||||
}
|
||||
mqtt->onSend(*p_encrypted, *p, p->channel);
|
||||
@@ -1504,7 +1502,7 @@ void Router::perhapsHandleReceived(meshtastic_MeshPacket *p)
|
||||
// assert(radioConfig.has_preferences);
|
||||
if (is_in_repeated(config.lora.ignore_incoming, p->from)) {
|
||||
clearRoutingAuthCache();
|
||||
LOG_DEBUG("Ignore msg, 0x%08x is in our ignore list", p->from);
|
||||
LOG_DEBUG("Ignore msg, 0x%08x in ignore list", p->from);
|
||||
packetPool.release(p);
|
||||
return;
|
||||
}
|
||||
@@ -1554,7 +1552,7 @@ void Router::perhapsHandleReceived(meshtastic_MeshPacket *p)
|
||||
|
||||
if (shouldFilterReceived(p)) {
|
||||
clearRoutingAuthCache();
|
||||
LOG_DEBUG("Incoming msg was filtered from 0x%08x", p->from);
|
||||
LOG_DEBUG("Incoming msg filtered from 0x%08x", p->from);
|
||||
packetPool.release(p);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -77,9 +77,9 @@ template <typename T> bool SX126xInterface<T>::init()
|
||||
}
|
||||
#endif
|
||||
if (tcxoVoltage == 0.0)
|
||||
LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE not defined, not using DIO3 as TCXO reference voltage");
|
||||
LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE not defined, DIO3 not used as TCXO Vref");
|
||||
else
|
||||
LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE defined, using DIO3 as TCXO reference voltage at %f V", tcxoVoltage);
|
||||
LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE defined, DIO3 as TCXO Vref %f V", tcxoVoltage);
|
||||
setTransmitEnable(false);
|
||||
// FIXME: May want to set depending on a definition, currently all SX126x variant files use the DC-DC regulator option
|
||||
bool useRegulatorLDO = false; // Seems to depend on the connection to pin 9/DCC_SW - if an inductor DCDC?
|
||||
@@ -139,21 +139,21 @@ template <typename T> bool SX126xInterface<T>::init()
|
||||
// no effect
|
||||
#if ARCH_PORTDUINO
|
||||
if (res == RADIOLIB_ERR_NONE) {
|
||||
LOG_DEBUG("Use MCU pin %i as RXEN and pin %i as TXEN to control RF switching", portduino_config.lora_rxen_pin.pin,
|
||||
LOG_DEBUG("Use MCU pin %i as RXEN, pin %i as TXEN for RF switching", portduino_config.lora_rxen_pin.pin,
|
||||
portduino_config.lora_txen_pin.pin);
|
||||
lora.setRfSwitchPins(portduino_config.lora_rxen_pin.pin, portduino_config.lora_txen_pin.pin);
|
||||
}
|
||||
#else
|
||||
#ifndef SX126X_RXEN
|
||||
#define SX126X_RXEN RADIOLIB_NC
|
||||
LOG_DEBUG("SX126X_RXEN not defined, defaulting to RADIOLIB_NC");
|
||||
LOG_DEBUG("SX126X_RXEN not defined, default RADIOLIB_NC");
|
||||
#endif
|
||||
#ifndef SX126X_TXEN
|
||||
#define SX126X_TXEN RADIOLIB_NC
|
||||
LOG_DEBUG("SX126X_TXEN not defined, defaulting to RADIOLIB_NC");
|
||||
LOG_DEBUG("SX126X_TXEN not defined, default RADIOLIB_NC");
|
||||
#endif
|
||||
if (res == RADIOLIB_ERR_NONE) {
|
||||
LOG_DEBUG("Use MCU pin %i as RXEN and pin %i as TXEN to control RF switching", SX126X_RXEN, SX126X_TXEN);
|
||||
LOG_DEBUG("Use MCU pin %i as RXEN, pin %i as TXEN for RF switching", SX126X_RXEN, SX126X_TXEN);
|
||||
lora.setRfSwitchPins(SX126X_RXEN, SX126X_TXEN);
|
||||
}
|
||||
#endif
|
||||
@@ -162,15 +162,15 @@ template <typename T> bool SX126xInterface<T>::init()
|
||||
LOG_INFO("Set RX gain to boosted mode; result: %d", result);
|
||||
} else {
|
||||
uint16_t result = lora.setRxBoostedGainMode(false);
|
||||
LOG_INFO("Set RX gain to power saving mode (boosted mode off); result: %d", result);
|
||||
LOG_INFO("Set RX gain to power saving mode; result: %d", result);
|
||||
}
|
||||
|
||||
// Undocumented SX1262 register patch recommended by Heltec/Semtech for improved RX sensitivity.
|
||||
// Sets bit 0 of register 0x8B5.
|
||||
if (module.SPIsetRegValue(0x8B5, 0x01, 0, 0) == RADIOLIB_ERR_NONE) {
|
||||
LOG_INFO("Applied SX1262 register 0x8B5 patch for RX improvement");
|
||||
LOG_INFO("Applied SX1262 reg 0x8B5 RX patch");
|
||||
} else {
|
||||
LOG_WARN("Failed to apply SX1262 register 0x8B5 patch for RX improvement");
|
||||
LOG_WARN("Can't apply SX1262 reg 0x8B5 RX patch");
|
||||
}
|
||||
|
||||
if (res == RADIOLIB_ERR_NONE)
|
||||
@@ -230,7 +230,7 @@ template <typename T> bool SX126xInterface<T>::reconfigure()
|
||||
if (err != RADIOLIB_ERR_NONE) {
|
||||
// Don't abort: this power is operator config (tx_power/SX126X_MAX_POWER); a value above the
|
||||
// driver's max would crash the daemon before reloadConfig() persists. Flag it and keep prior power.
|
||||
LOG_ERROR("SX126X setOutputPower %d dBm rejected (%s%d); keeping previous Tx power", power, radioLibErr, err);
|
||||
LOG_ERROR("SX126X setOutputPower %d dBm rejected (%s%d); keep previous Tx power", power, radioLibErr, err);
|
||||
RECORD_CRITICALERROR(meshtastic_CriticalErrorCode_INVALID_RADIO_SETTING);
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ template <typename T> void SX126xInterface<T>::resetAGC()
|
||||
}
|
||||
|
||||
if (module.hal->digitalRead(module.getGpio())) {
|
||||
LOG_WARN("SX126x AGC reset: calibration did not complete within 50ms");
|
||||
LOG_WARN("SX126x AGC reset: calibration not done in 50ms");
|
||||
startReceive();
|
||||
return;
|
||||
}
|
||||
@@ -506,7 +506,7 @@ template <typename T> void SX126xInterface<T>::resetAGC()
|
||||
// Without this re-apply, every SX1262 node loses its RX boost ~60s after boot
|
||||
// and never recovers until reboot. See empirical evidence in the PR description.
|
||||
if (module.SPIsetRegValue(0x8B5, 0x01, 0, 0) != RADIOLIB_ERR_NONE) {
|
||||
LOG_WARN("SX126x resetAGC: failed to re-apply 0x8B5 RX sensitivity patch");
|
||||
LOG_WARN("SX126x resetAGC: 0x8B5 RX patch re-apply failed");
|
||||
}
|
||||
|
||||
// 6. Resume receiving
|
||||
|
||||
@@ -494,7 +494,7 @@ void WarmNodeStore::load()
|
||||
bool WarmNodeStore::save()
|
||||
{
|
||||
if (!powerHAL_isPowerLevelSafe()) {
|
||||
LOG_ERROR("Error: trying to save WarmStore on unsafe device power level.");
|
||||
LOG_ERROR("Trying to save WarmStore on unsafe device power level");
|
||||
return false;
|
||||
}
|
||||
concurrency::LockGuard g(spiLock);
|
||||
@@ -605,7 +605,7 @@ bool WarmNodeStore::save()
|
||||
if (!entries)
|
||||
return false;
|
||||
if (!powerHAL_isPowerLevelSafe()) {
|
||||
LOG_ERROR("Error: trying to save WarmStore on unsafe device power level.");
|
||||
LOG_ERROR("Trying to save WarmStore on unsafe device power level");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ bool PacketAPI::receivePacket(void)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("Error: unhandled meshtastic_ToRadio variant: %d", mr->which_payload_variant);
|
||||
LOG_ERROR("Unhandled meshtastic_ToRadio variant: %d", mr->which_payload_variant);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ bool ensureCertForIp(IPAddress ip, EthCertMaterial &out)
|
||||
(unsigned)out.keyDer.size(), ipStr.c_str());
|
||||
return true;
|
||||
}
|
||||
LOG_WARN("ETH CERT: cached cert/key failed to parse (partial write?), regenerating");
|
||||
LOG_WARN("ETH CERT: cached cert/key parse failed (partial write?), regen");
|
||||
out.certDer.clear();
|
||||
out.keyDer.clear();
|
||||
}
|
||||
@@ -279,7 +279,7 @@ bool ensureCertForIp(IPAddress ip, EthCertMaterial &out)
|
||||
}
|
||||
}
|
||||
|
||||
LOG_INFO("ETH CERT: generating ECDSA P-256 self-signed cert for IP %s...", ipStr.c_str());
|
||||
LOG_INFO("ETH CERT: gen ECDSA P-256 self-signed cert for IP %s", ipStr.c_str());
|
||||
uint32_t t0 = millis();
|
||||
if (!generateCert(ip, out)) {
|
||||
LOG_ERROR("ETH CERT: generation failed");
|
||||
@@ -299,7 +299,7 @@ bool ensureCertForIp(IPAddress ip, EthCertMaterial &out)
|
||||
writeText(IP_PATH, "");
|
||||
if (!writeBinary(CERT_PATH, out.certDer.data(), out.certDer.size()) ||
|
||||
!writeBinary(KEY_PATH, out.keyDer.data(), out.keyDer.size()) || !writeText(IP_PATH, ipStr)) {
|
||||
LOG_WARN("ETH CERT: persist failed - will regenerate next boot");
|
||||
LOG_WARN("ETH CERT: persist failed, regen next boot");
|
||||
} else {
|
||||
LOG_INFO("ETH CERT: persisted to LittleFS");
|
||||
}
|
||||
@@ -337,7 +337,7 @@ class EthCertThread : public concurrency::OSThread
|
||||
// regenerates whenever its saved IP != ip, so the cert SAN follows.
|
||||
bool ok = ensureCertForIp(ip, material_);
|
||||
if (!ok) {
|
||||
LOG_ERROR("ETH CERT: pipeline FAILED - TLS server will not start");
|
||||
LOG_ERROR("ETH CERT: pipeline FAILED, no TLS server");
|
||||
// Don't leave isReady() reporting true with empty material: a later TLS
|
||||
// teardown (e.g. a W5500 reset) would then fail initTlsContext() and stay
|
||||
// disabled. Clear readiness so the TLS worker waits and the next poll
|
||||
@@ -375,7 +375,7 @@ void initEthCertThread()
|
||||
if (certThread)
|
||||
return;
|
||||
certThread = new EthCertThread();
|
||||
LOG_INFO("ETH CERT: deferred worker scheduled (waits for DHCP, runs once)");
|
||||
LOG_INFO("ETH CERT: deferred worker scheduled (awaits DHCP)");
|
||||
}
|
||||
|
||||
bool isEthCertReady()
|
||||
|
||||
@@ -99,7 +99,7 @@ static bool authenticateClient(EthernetClient &client)
|
||||
// Rate-limit after failed auth - close silently so the error byte is not
|
||||
// misinterpreted as part of the nonce by a re-trying client.
|
||||
if (lastAuthFailure != 0 && (millis() - lastAuthFailure) < OTA_AUTH_COOLDOWN_MS) {
|
||||
LOG_WARN("ETH OTA: Auth cooldown active, rejecting connection");
|
||||
LOG_WARN("ETH OTA: Auth cooldown, reject connection");
|
||||
client.stop();
|
||||
return false;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ static void handleOTAClient(EthernetClient &client)
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_INFO("ETH OTA: Update staged successfully (%u bytes). Rebooting...", hdr.firmwareSize);
|
||||
LOG_INFO("ETH OTA: Update staged (%u bytes). Rebooting", hdr.firmwareSize);
|
||||
client.write(OTA_OK);
|
||||
client.flush();
|
||||
delay(500);
|
||||
|
||||
@@ -102,7 +102,7 @@ static void taskCreateCert(void *parameter)
|
||||
size_t certLen = prefs.getBytesLength("cert");
|
||||
|
||||
if (pkLen && certLen) {
|
||||
LOG_INFO("Existing SSL Certificate found!");
|
||||
LOG_INFO("Existing SSL Certificate found");
|
||||
|
||||
uint8_t *pkBuffer = new uint8_t[pkLen];
|
||||
prefs.getBytes("PK", pkBuffer, pkLen);
|
||||
@@ -180,7 +180,7 @@ void createSSLCert()
|
||||
runLoop = true;
|
||||
}
|
||||
}
|
||||
LOG_INFO("SSL Cert Ready!");
|
||||
LOG_INFO("SSL Cert Ready");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ int callback_static_file(const struct _u_request *request, struct _u_response *r
|
||||
content_type = u_map_get_case(&configWeb.mime_types, get_filename_ext(file_requested));
|
||||
if (content_type == NULL) {
|
||||
content_type = u_map_get(&configWeb.mime_types, "*");
|
||||
LOG_DEBUG("Static File Server - Unknown mime type for extension %s ", get_filename_ext(file_requested));
|
||||
LOG_DEBUG("Static File Server - Unknown mime type for ext %s ", get_filename_ext(file_requested));
|
||||
}
|
||||
u_map_put(response->map_header, "Content-Type", content_type);
|
||||
u_map_copy_into(response->map_header, &configWeb.map_header);
|
||||
@@ -230,7 +230,7 @@ int callback_static_file(const struct _u_request *request, struct _u_response *r
|
||||
free(real_path); // realpath uses malloc
|
||||
return U_CALLBACK_CONTINUE;
|
||||
} else {
|
||||
LOG_DEBUG("Static File Server - Error, user_data is NULL or inconsistent");
|
||||
LOG_DEBUG("Static File Server - user_data NULL or inconsistent");
|
||||
return U_CALLBACK_ERROR;
|
||||
}
|
||||
}
|
||||
@@ -303,7 +303,7 @@ int handleAPIv1FromRadio(const struct _u_request *req, struct _u_response *res,
|
||||
ulfius_set_string_body_response(res, 200, tmpa);
|
||||
// LOG_DEBUG("\n----webAPI response all:----");
|
||||
// LOG_DEBUG(tmpa);
|
||||
// LOG_DEBUG("");
|
||||
// LOG_DEBUG(".");
|
||||
}
|
||||
// Otherwise, just return one protobuf
|
||||
} else {
|
||||
@@ -312,7 +312,7 @@ int handleAPIv1FromRadio(const struct _u_request *req, struct _u_response *res,
|
||||
ulfius_set_binary_body_response(res, 200, tmpa, len);
|
||||
// LOG_DEBUG("\n----webAPI response:");
|
||||
// LOG_DEBUG(tmpa);
|
||||
// LOG_DEBUG("");
|
||||
// LOG_DEBUG(".");
|
||||
}
|
||||
|
||||
// LOG_DEBUG("end radio->web", len);
|
||||
@@ -381,7 +381,7 @@ char *read_file_into_string(const char *filename)
|
||||
// reserve mem for file + 1 byte
|
||||
char *buffer = (char *)malloc(filesize + 1);
|
||||
if (buffer == NULL) {
|
||||
LOG_ERROR("Malloc of mem failed for file : %s ", filename);
|
||||
LOG_ERROR("Malloc failed for file : %s ", filename);
|
||||
fclose(file);
|
||||
return NULL;
|
||||
}
|
||||
@@ -406,13 +406,13 @@ int PiWebServerThread::CheckSSLandLoad()
|
||||
// read certificate
|
||||
cert_pem = read_file_into_string(CERT_PATH);
|
||||
if (cert_pem == NULL) {
|
||||
LOG_ERROR("ERROR SSL Certificate File can't be loaded or is missing");
|
||||
LOG_ERROR("SSL Certificate File can't be loaded or missing");
|
||||
return 1;
|
||||
}
|
||||
// read private key
|
||||
key_pem = read_file_into_string(KEY_PATH);
|
||||
if (key_pem == NULL) {
|
||||
LOG_ERROR("ERROR file private_key can't be loaded or is missing");
|
||||
LOG_ERROR("File private_key can't be loaded or missing");
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -479,13 +479,13 @@ PiWebServerThread::PiWebServerThread()
|
||||
webservport = portduino_config.webserverport;
|
||||
LOG_INFO("Use webserver port from yaml config %i ", webservport);
|
||||
} else {
|
||||
LOG_INFO("Webserver port in yaml config set to 0, defaulting to port 9443");
|
||||
LOG_INFO("Webserver port in yaml config 0, default to 9443");
|
||||
webservport = 9443;
|
||||
}
|
||||
|
||||
// Web Content Service Instance
|
||||
if (ulfius_init_instance(&instanceWeb, webservport, NULL, DEFAULT_REALM) != U_OK) {
|
||||
LOG_ERROR("Webserver couldn't be started, abort execution");
|
||||
LOG_ERROR("Webserver start failed, abort");
|
||||
} else {
|
||||
|
||||
LOG_INFO("Webserver started");
|
||||
@@ -534,7 +534,7 @@ PiWebServerThread::PiWebServerThread()
|
||||
LOG_INFO("Web Server framework started on port: %i ", webservport);
|
||||
LOG_INFO("Web Server root %s", (char *)webrootpath.c_str());
|
||||
} else {
|
||||
LOG_ERROR("Error starting Web Server framework, error number: %d", retssl);
|
||||
LOG_ERROR("Web Server framework start failed, err: %d", retssl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ static void onNetworkConnected()
|
||||
|
||||
// start mdns
|
||||
if (!MDNS.begin("Meshtastic")) {
|
||||
LOG_ERROR("Error setting up mDNS responder!");
|
||||
LOG_ERROR("mDNS setup failed");
|
||||
} else {
|
||||
LOG_INFO("mDNS Host: Meshtastic.local");
|
||||
MDNS.addService("meshtastic", "tcp", SERVER_API_DEFAULT_PORT);
|
||||
@@ -270,7 +270,7 @@ static int32_t reconnectWiFi()
|
||||
if (WiFi.isConnected() && (!Throttle::isWithinTimespanMs(lastrun_ntp, 43200000) || (lastrun_ntp == 0))) { // every 12 hours
|
||||
LOG_DEBUG("Update NTP time from %s", config.network.ntp_server);
|
||||
if (timeClient.update()) {
|
||||
LOG_DEBUG("NTP Request Success - Setting RTCQualityNTP if needed");
|
||||
LOG_DEBUG("NTP success - set RTCQualityNTP if needed");
|
||||
|
||||
struct timeval tv;
|
||||
tv.tv_sec = timeClient.getEpochTime();
|
||||
@@ -477,7 +477,7 @@ static void WiFiEvent(WiFiEvent_t event)
|
||||
}
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_AUTHMODE_CHANGE:
|
||||
LOG_INFO("Authentication mode of access point has changed");
|
||||
LOG_INFO("AP auth mode changed");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_GOT_IP:
|
||||
LOG_INFO("Obtained IP address: %s", WiFi.localIP().toString().c_str());
|
||||
@@ -493,7 +493,7 @@ static void WiFiEvent(WiFiEvent_t event)
|
||||
#endif
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_LOST_IP:
|
||||
LOG_INFO("Lost IP address and IP address is reset to 0");
|
||||
LOG_INFO("Lost IP address, reset to 0");
|
||||
#if HAS_UDP_MULTICAST
|
||||
if (udpHandler) {
|
||||
udpHandler->stop();
|
||||
@@ -507,19 +507,19 @@ static void WiFiEvent(WiFiEvent_t event)
|
||||
}
|
||||
break;
|
||||
case ARDUINO_EVENT_WPS_ER_SUCCESS:
|
||||
LOG_INFO("WiFi Protected Setup (WPS): succeeded in enrollee mode");
|
||||
LOG_INFO("WPS: succeeded in enrollee mode");
|
||||
break;
|
||||
case ARDUINO_EVENT_WPS_ER_FAILED:
|
||||
LOG_INFO("WiFi Protected Setup (WPS): failed in enrollee mode");
|
||||
LOG_INFO("WPS: failed in enrollee mode");
|
||||
break;
|
||||
case ARDUINO_EVENT_WPS_ER_TIMEOUT:
|
||||
LOG_INFO("WiFi Protected Setup (WPS): timeout in enrollee mode");
|
||||
LOG_INFO("WPS: timeout in enrollee mode");
|
||||
break;
|
||||
case ARDUINO_EVENT_WPS_ER_PIN:
|
||||
LOG_INFO("WiFi Protected Setup (WPS): pin code in enrollee mode");
|
||||
LOG_INFO("WPS: pin code in enrollee mode");
|
||||
break;
|
||||
case ARDUINO_EVENT_WPS_ER_PBC_OVERLAP:
|
||||
LOG_INFO("WiFi Protected Setup (WPS): push button overlap in enrollee mode");
|
||||
LOG_INFO("WPS: push button overlap in enrollee mode");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_AP_START:
|
||||
LOG_INFO("WiFi access point started");
|
||||
|
||||
Reference in New Issue
Block a user