mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-06 11:39:32 +00:00
Remove full stops
This commit is contained in:
parent
c53745019f
commit
06ab5e5a4e
@ -106,27 +106,27 @@ class AmbientLightingThread : public concurrency::OSThread
|
|||||||
rgb.setRed(0);
|
rgb.setRed(0);
|
||||||
rgb.setGreen(0);
|
rgb.setGreen(0);
|
||||||
rgb.setBlue(0);
|
rgb.setBlue(0);
|
||||||
LOG_INFO("Turn Off NCP5623 Ambient lighting.");
|
LOG_INFO("Turn Off NCP5623 Ambient lighting");
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_NEOPIXEL
|
#ifdef HAS_NEOPIXEL
|
||||||
pixels.clear();
|
pixels.clear();
|
||||||
pixels.show();
|
pixels.show();
|
||||||
LOG_INFO("Turn Off NeoPixel Ambient lighting.");
|
LOG_INFO("Turn Off NeoPixel Ambient lighting");
|
||||||
#endif
|
#endif
|
||||||
#ifdef RGBLED_CA
|
#ifdef RGBLED_CA
|
||||||
analogWrite(RGBLED_RED, 255 - 0);
|
analogWrite(RGBLED_RED, 255 - 0);
|
||||||
analogWrite(RGBLED_GREEN, 255 - 0);
|
analogWrite(RGBLED_GREEN, 255 - 0);
|
||||||
analogWrite(RGBLED_BLUE, 255 - 0);
|
analogWrite(RGBLED_BLUE, 255 - 0);
|
||||||
LOG_INFO("Turn Off Ambient lighting RGB Common Anode.");
|
LOG_INFO("Turn Off Ambient lighting RGB Common Anode");
|
||||||
#elif defined(RGBLED_RED)
|
#elif defined(RGBLED_RED)
|
||||||
analogWrite(RGBLED_RED, 0);
|
analogWrite(RGBLED_RED, 0);
|
||||||
analogWrite(RGBLED_GREEN, 0);
|
analogWrite(RGBLED_GREEN, 0);
|
||||||
analogWrite(RGBLED_BLUE, 0);
|
analogWrite(RGBLED_BLUE, 0);
|
||||||
LOG_INFO("Turn Off Ambient lighting RGB Common Cathode.");
|
LOG_INFO("Turn Off Ambient lighting RGB Common Cathode");
|
||||||
#endif
|
#endif
|
||||||
#ifdef UNPHONE
|
#ifdef UNPHONE
|
||||||
unphone.rgb(0, 0, 0);
|
unphone.rgb(0, 0, 0);
|
||||||
LOG_INFO("Turn Off unPhone Ambient lighting.");
|
LOG_INFO("Turn Off unPhone Ambient lighting");
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ GPS_RESPONSE GPS::getACKCas(uint8_t class_id, uint8_t msg_id, uint32_t waitMilli
|
|||||||
// Check for an ACK-ACK for the specified class and message id
|
// Check for an ACK-ACK for the specified class and message id
|
||||||
if ((msg_cls == 0x05) && (msg_msg_id == 0x01) && payload_cls == class_id && payload_msg == msg_id) {
|
if ((msg_cls == 0x05) && (msg_msg_id == 0x01) && payload_cls == class_id && payload_msg == msg_id) {
|
||||||
#ifdef GPS_DEBUG
|
#ifdef GPS_DEBUG
|
||||||
LOG_INFO("Got ACK for class %02X message %02X in %d millis.", class_id, msg_id, millis() - startTime);
|
LOG_INFO("Got ACK for class %02X message %02X in %dms", class_id, msg_id, millis() - startTime);
|
||||||
#endif
|
#endif
|
||||||
return GNSS_RESPONSE_OK;
|
return GNSS_RESPONSE_OK;
|
||||||
}
|
}
|
||||||
@ -245,7 +245,7 @@ GPS_RESPONSE GPS::getACKCas(uint8_t class_id, uint8_t msg_id, uint32_t waitMilli
|
|||||||
// Check for an ACK-NACK for the specified class and message id
|
// Check for an ACK-NACK for the specified class and message id
|
||||||
if ((msg_cls == 0x05) && (msg_msg_id == 0x00) && payload_cls == class_id && payload_msg == msg_id) {
|
if ((msg_cls == 0x05) && (msg_msg_id == 0x00) && payload_cls == class_id && payload_msg == msg_id) {
|
||||||
#ifdef GPS_DEBUG
|
#ifdef GPS_DEBUG
|
||||||
LOG_WARN("Got NACK for class %02X message %02X in %d millis.", class_id, msg_id, millis() - startTime);
|
LOG_WARN("Got NACK for class %02X message %02X in %dms", class_id, msg_id, millis() - startTime);
|
||||||
#endif
|
#endif
|
||||||
return GNSS_RESPONSE_NAK;
|
return GNSS_RESPONSE_NAK;
|
||||||
}
|
}
|
||||||
@ -286,7 +286,7 @@ GPS_RESPONSE GPS::getACK(uint8_t class_id, uint8_t msg_id, uint32_t waitMillis)
|
|||||||
while (Throttle::isWithinTimespanMs(startTime, waitMillis)) {
|
while (Throttle::isWithinTimespanMs(startTime, waitMillis)) {
|
||||||
if (ack > 9) {
|
if (ack > 9) {
|
||||||
#ifdef GPS_DEBUG
|
#ifdef GPS_DEBUG
|
||||||
LOG_INFO("Got ACK for class %02X message %02X in %d millis.", class_id, msg_id, millis() - startTime);
|
LOG_INFO("Got ACK for class %02X message %02X in %dms", class_id, msg_id, millis() - startTime);
|
||||||
#endif
|
#endif
|
||||||
return GNSS_RESPONSE_OK; // ACK received
|
return GNSS_RESPONSE_OK; // ACK received
|
||||||
}
|
}
|
||||||
@ -396,8 +396,7 @@ int GPS::getACK(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t
|
|||||||
} else {
|
} else {
|
||||||
// return payload length
|
// return payload length
|
||||||
#ifdef GPS_DEBUG
|
#ifdef GPS_DEBUG
|
||||||
LOG_INFO("Got ACK for class %02X message %02X in %d millis.", requestedClass, requestedID,
|
LOG_INFO("Got ACK for class %02X message %02X in %dms", requestedClass, requestedID, millis() - startTime);
|
||||||
millis() - startTime);
|
|
||||||
#endif
|
#endif
|
||||||
return needRead;
|
return needRead;
|
||||||
}
|
}
|
||||||
@ -584,7 +583,7 @@ bool GPS::setup()
|
|||||||
msglen = makeUBXPacket(0x06, 0x09, sizeof(_message_SAVE), _message_SAVE);
|
msglen = makeUBXPacket(0x06, 0x09, sizeof(_message_SAVE), _message_SAVE);
|
||||||
_serial_gps->write(UBXscratch, msglen);
|
_serial_gps->write(UBXscratch, msglen);
|
||||||
if (getACK(0x06, 0x09, 2000) != GNSS_RESPONSE_OK) {
|
if (getACK(0x06, 0x09, 2000) != GNSS_RESPONSE_OK) {
|
||||||
LOG_WARN("Unable to save GNSS module config.");
|
LOG_WARN("Unable to save GNSS module config");
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("GNSS module config saved!");
|
LOG_INFO("GNSS module config saved!");
|
||||||
}
|
}
|
||||||
@ -603,9 +602,9 @@ bool GPS::setup()
|
|||||||
LOG_DEBUG("reconfigure GNSS - defaults maintained. Is this module GPS-only?");
|
LOG_DEBUG("reconfigure GNSS - defaults maintained. Is this module GPS-only?");
|
||||||
} else {
|
} else {
|
||||||
if (gnssModel == GNSS_MODEL_UBLOX7) {
|
if (gnssModel == GNSS_MODEL_UBLOX7) {
|
||||||
LOG_INFO("GPS+SBAS configured.");
|
LOG_INFO("GPS+SBAS configured");
|
||||||
} else { // 8,9
|
} else { // 8,9
|
||||||
LOG_INFO("GPS+SBAS+GLONASS+Galileo configured.");
|
LOG_INFO("GPS+SBAS+GLONASS+Galileo configured");
|
||||||
}
|
}
|
||||||
// Documentation say, we need wait atleast 0.5s after reconfiguration of GNSS module, before sending next
|
// Documentation say, we need wait atleast 0.5s after reconfiguration of GNSS module, before sending next
|
||||||
// commands for the M8 it tends to be more... 1 sec should be enough ;>)
|
// commands for the M8 it tends to be more... 1 sec should be enough ;>)
|
||||||
@ -653,7 +652,7 @@ bool GPS::setup()
|
|||||||
msglen = makeUBXPacket(0x06, 0x09, sizeof(_message_SAVE), _message_SAVE);
|
msglen = makeUBXPacket(0x06, 0x09, sizeof(_message_SAVE), _message_SAVE);
|
||||||
_serial_gps->write(UBXscratch, msglen);
|
_serial_gps->write(UBXscratch, msglen);
|
||||||
if (getACK(0x06, 0x09, 2000) != GNSS_RESPONSE_OK) {
|
if (getACK(0x06, 0x09, 2000) != GNSS_RESPONSE_OK) {
|
||||||
LOG_WARN("Unable to save GNSS module configuration.");
|
LOG_WARN("Unable to save GNSS module config");
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("GNSS module configuration saved!");
|
LOG_INFO("GNSS module configuration saved!");
|
||||||
}
|
}
|
||||||
@ -701,7 +700,7 @@ bool GPS::setup()
|
|||||||
msglen = makeUBXPacket(0x06, 0x09, sizeof(_message_SAVE_10), _message_SAVE_10);
|
msglen = makeUBXPacket(0x06, 0x09, sizeof(_message_SAVE_10), _message_SAVE_10);
|
||||||
_serial_gps->write(UBXscratch, msglen);
|
_serial_gps->write(UBXscratch, msglen);
|
||||||
if (getACK(0x06, 0x09, 2000) != GNSS_RESPONSE_OK) {
|
if (getACK(0x06, 0x09, 2000) != GNSS_RESPONSE_OK) {
|
||||||
LOG_WARN("Unable to save GNSS module configuration.");
|
LOG_WARN("Unable to save GNSS module config");
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("GNSS module configuration saved!");
|
LOG_INFO("GNSS module configuration saved!");
|
||||||
}
|
}
|
||||||
@ -795,7 +794,7 @@ void GPS::writePinEN(bool on)
|
|||||||
// Write and log
|
// Write and log
|
||||||
enablePin->set(on);
|
enablePin->set(on);
|
||||||
#ifdef GPS_DEBUG
|
#ifdef GPS_DEBUG
|
||||||
LOG_DEBUG("Pin EN %s", val == HIGH ? "HIGH" : "LOW");
|
LOG_DEBUG("Pin EN %s", val == HIGH ? "HI" : "LOW");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -817,7 +816,7 @@ void GPS::writePinStandby(bool standby)
|
|||||||
pinMode(PIN_GPS_STANDBY, OUTPUT);
|
pinMode(PIN_GPS_STANDBY, OUTPUT);
|
||||||
digitalWrite(PIN_GPS_STANDBY, val);
|
digitalWrite(PIN_GPS_STANDBY, val);
|
||||||
#ifdef GPS_DEBUG
|
#ifdef GPS_DEBUG
|
||||||
LOG_DEBUG("Pin STANDBY %s", val == HIGH ? "HIGH" : "LOW");
|
LOG_DEBUG("Pin STANDBY %s", val == HIGH ? "HI" : "LOW");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -985,7 +984,7 @@ int32_t GPS::runOnce()
|
|||||||
{
|
{
|
||||||
if (!GPSInitFinished) {
|
if (!GPSInitFinished) {
|
||||||
if (!_serial_gps || config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT) {
|
if (!_serial_gps || config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT) {
|
||||||
LOG_INFO("GPS set to not-present. Skipping probe.");
|
LOG_INFO("GPS set to not-present. Skipping probe");
|
||||||
return disable();
|
return disable();
|
||||||
}
|
}
|
||||||
if (!setup())
|
if (!setup())
|
||||||
@ -1055,7 +1054,7 @@ int32_t GPS::runOnce()
|
|||||||
|
|
||||||
bool tooLong = scheduling.searchedTooLong();
|
bool tooLong = scheduling.searchedTooLong();
|
||||||
if (tooLong)
|
if (tooLong)
|
||||||
LOG_WARN("Couldn't publish a valid location: didn't get a GPS lock in time.");
|
LOG_WARN("Couldn't publish a valid location: didn't get a GPS lock in time");
|
||||||
|
|
||||||
// Once we get a location we no longer desperately want an update
|
// Once we get a location we no longer desperately want an update
|
||||||
if ((gotLoc && gotTime) || tooLong) {
|
if ((gotLoc && gotTime) || tooLong) {
|
||||||
@ -1505,7 +1504,7 @@ bool GPS::lookForLocation()
|
|||||||
|
|
||||||
#ifndef TINYGPS_OPTION_NO_STATISTICS
|
#ifndef TINYGPS_OPTION_NO_STATISTICS
|
||||||
if (reader.failedChecksum() > lastChecksumFailCount) {
|
if (reader.failedChecksum() > lastChecksumFailCount) {
|
||||||
LOG_WARN("%u new GPS checksum failures, for a total of %u.", reader.failedChecksum() - lastChecksumFailCount,
|
LOG_WARN("%u new GPS checksum failures, for a total of %u", reader.failedChecksum() - lastChecksumFailCount,
|
||||||
reader.failedChecksum());
|
reader.failedChecksum());
|
||||||
lastChecksumFailCount = reader.failedChecksum();
|
lastChecksumFailCount = reader.failedChecksum();
|
||||||
}
|
}
|
||||||
@ -1657,7 +1656,7 @@ bool GPS::whileActive()
|
|||||||
}
|
}
|
||||||
#ifdef SERIAL_BUFFER_SIZE
|
#ifdef SERIAL_BUFFER_SIZE
|
||||||
if (_serial_gps->available() >= SERIAL_BUFFER_SIZE - 1) {
|
if (_serial_gps->available() >= SERIAL_BUFFER_SIZE - 1) {
|
||||||
LOG_WARN("GPS Buffer full with %u bytes waiting. Flushing to avoid corruption.", _serial_gps->available());
|
LOG_WARN("GPS Buffer full with %u bytes waiting. Flushing to avoid corruption", _serial_gps->available());
|
||||||
clearBuffer();
|
clearBuffer();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1710,7 +1709,7 @@ void GPS::toggleGpsMode()
|
|||||||
{
|
{
|
||||||
if (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED) {
|
if (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED) {
|
||||||
config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_DISABLED;
|
config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_DISABLED;
|
||||||
LOG_INFO("User toggled GpsMode. Now DISABLED.");
|
LOG_INFO("User toggled GpsMode. Now DISABLED");
|
||||||
playGPSDisableBeep();
|
playGPSDisableBeep();
|
||||||
#ifdef GNSS_AIROHA
|
#ifdef GNSS_AIROHA
|
||||||
if (powerState == GPS_ACTIVE) {
|
if (powerState == GPS_ACTIVE) {
|
||||||
|
@ -389,10 +389,10 @@ void setup()
|
|||||||
Wire.begin(I2C_SDA, I2C_SCL);
|
Wire.begin(I2C_SDA, I2C_SCL);
|
||||||
#elif defined(ARCH_PORTDUINO)
|
#elif defined(ARCH_PORTDUINO)
|
||||||
if (settingsStrings[i2cdev] != "") {
|
if (settingsStrings[i2cdev] != "") {
|
||||||
LOG_INFO("Using %s as I2C device.", settingsStrings[i2cdev].c_str());
|
LOG_INFO("Using %s as I2C device", settingsStrings[i2cdev].c_str());
|
||||||
Wire.begin(settingsStrings[i2cdev].c_str());
|
Wire.begin(settingsStrings[i2cdev].c_str());
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("No I2C device configured, skipping.");
|
LOG_INFO("No I2C device configured, skipping");
|
||||||
}
|
}
|
||||||
#elif HAS_WIRE
|
#elif HAS_WIRE
|
||||||
Wire.begin();
|
Wire.begin();
|
||||||
@ -770,7 +770,7 @@ void setup()
|
|||||||
if (gps) {
|
if (gps) {
|
||||||
gpsStatus->observe(&gps->newStatus);
|
gpsStatus->observe(&gps->newStatus);
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("Running without GPS.");
|
LOG_DEBUG("Running without GPS");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1070,7 +1070,7 @@ void setup()
|
|||||||
|
|
||||||
// check if the radio chip matches the selected region
|
// check if the radio chip matches the selected region
|
||||||
if ((config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_LORA_24) && (!rIf->wideLora())) {
|
if ((config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_LORA_24) && (!rIf->wideLora())) {
|
||||||
LOG_WARN("Radio chip does not support 2.4GHz LoRa. Reverting to unset.");
|
LOG_WARN("LoRa chip does not support 2.4GHz. Reverting to unset");
|
||||||
config.lora.region = meshtastic_Config_LoRaConfig_RegionCode_UNSET;
|
config.lora.region = meshtastic_Config_LoRaConfig_RegionCode_UNSET;
|
||||||
nodeDB->saveToDisk(SEGMENT_CONFIG);
|
nodeDB->saveToDisk(SEGMENT_CONFIG);
|
||||||
if (!rIf->reconfigure()) {
|
if (!rIf->reconfigure()) {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
void CryptoEngine::generateKeyPair(uint8_t *pubKey, uint8_t *privKey)
|
void CryptoEngine::generateKeyPair(uint8_t *pubKey, uint8_t *privKey)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("Generating Curve25519 key pair...");
|
LOG_DEBUG("Generating Curve25519 keypair");
|
||||||
Curve25519::dh1(public_key, private_key);
|
Curve25519::dh1(public_key, private_key);
|
||||||
memcpy(pubKey, public_key, sizeof(public_key));
|
memcpy(pubKey, public_key, sizeof(public_key));
|
||||||
memcpy(privKey, private_key, sizeof(private_key));
|
memcpy(privKey, private_key, sizeof(private_key));
|
||||||
|
@ -46,7 +46,7 @@ void FloodingRouter::sniffReceived(const meshtastic_MeshPacket *p, const meshtas
|
|||||||
bool isAckorReply = (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) && (p->decoded.request_id != 0);
|
bool isAckorReply = (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) && (p->decoded.request_id != 0);
|
||||||
if (isAckorReply && !isToUs(p) && !isBroadcast(p->to)) {
|
if (isAckorReply && !isToUs(p) && !isBroadcast(p->to)) {
|
||||||
// do not flood direct message that is ACKed or replied to
|
// do not flood direct message that is ACKed or replied to
|
||||||
LOG_DEBUG("Rxd an ACK/reply not for me, cancel rebroadcast.");
|
LOG_DEBUG("Rxd an ACK/reply not for me, cancel rebroadcast");
|
||||||
Router::cancelSending(p->to, p->decoded.request_id); // cancel rebroadcast for this DM
|
Router::cancelSending(p->to, p->decoded.request_id); // cancel rebroadcast for this DM
|
||||||
}
|
}
|
||||||
if (!isToUs(p) && (p->hop_limit > 0) && !isFromUs(p)) {
|
if (!isToUs(p) && (p->hop_limit > 0) && !isFromUs(p)) {
|
||||||
|
@ -83,15 +83,15 @@ int MeshService::handleFromRadio(const meshtastic_MeshPacket *mp)
|
|||||||
IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_ROUTER, meshtastic_Config_DeviceConfig_Role_REPEATER);
|
IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_ROUTER, meshtastic_Config_DeviceConfig_Role_REPEATER);
|
||||||
if (mp->which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
|
if (mp->which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
|
||||||
mp->decoded.portnum == meshtastic_PortNum_TELEMETRY_APP && mp->decoded.request_id > 0) {
|
mp->decoded.portnum == meshtastic_PortNum_TELEMETRY_APP && mp->decoded.request_id > 0) {
|
||||||
LOG_DEBUG("Received telemetry response. Skip sending our NodeInfo."); // because this potentially a Repeater which will
|
LOG_DEBUG("Received telemetry response. Skip sending our NodeInfo"); // because this potentially a Repeater which will
|
||||||
// ignore our request for its NodeInfo
|
// ignore our request for its NodeInfo
|
||||||
} else if (mp->which_payload_variant == meshtastic_MeshPacket_decoded_tag && !nodeDB->getMeshNode(mp->from)->has_user &&
|
} else if (mp->which_payload_variant == meshtastic_MeshPacket_decoded_tag && !nodeDB->getMeshNode(mp->from)->has_user &&
|
||||||
nodeInfoModule && !isPreferredRebroadcaster) {
|
nodeInfoModule && !isPreferredRebroadcaster) {
|
||||||
if (airTime->isTxAllowedChannelUtil(true)) {
|
if (airTime->isTxAllowedChannelUtil(true)) {
|
||||||
LOG_INFO("Heard new node on channel %d, sending NodeInfo and asking for a response.", mp->channel);
|
LOG_INFO("Heard new node on chan %d, sending NodeInfo and asking for a response", mp->channel);
|
||||||
nodeInfoModule->sendOurNodeInfo(mp->from, true, mp->channel);
|
nodeInfoModule->sendOurNodeInfo(mp->from, true, mp->channel);
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("Skip sending NodeInfo due to > 25 percent channel util.");
|
LOG_DEBUG("Skip sending NodeInfo due to > 25 percent chan util");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,7 +306,7 @@ void MeshService::sendToPhone(meshtastic_MeshPacket *p)
|
|||||||
if (d)
|
if (d)
|
||||||
releaseToPool(d);
|
releaseToPool(d);
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN("ToPhone queue is full, dropping packet.");
|
LOG_WARN("ToPhone queue is full, dropping packet");
|
||||||
releaseToPool(p);
|
releaseToPool(p);
|
||||||
fromNum++; // Make sure to notify observers in case they are reconnected so they can get the packets
|
fromNum++; // Make sure to notify observers in case they are reconnected so they can get the packets
|
||||||
return;
|
return;
|
||||||
|
@ -449,7 +449,7 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
|
|||||||
|
|
||||||
void PhoneAPI::sendConfigComplete()
|
void PhoneAPI::sendConfigComplete()
|
||||||
{
|
{
|
||||||
LOG_INFO("Config Send Complete.");
|
LOG_INFO("Config Send Complete");
|
||||||
fromRadioScratch.which_payload_variant = meshtastic_FromRadio_config_complete_id_tag;
|
fromRadioScratch.which_payload_variant = meshtastic_FromRadio_config_complete_id_tag;
|
||||||
fromRadioScratch.config_complete_id = config_nonce;
|
fromRadioScratch.config_complete_id = config_nonce;
|
||||||
config_nonce = 0;
|
config_nonce = 0;
|
||||||
|
@ -346,7 +346,7 @@ bool RadioInterface::reconfigure()
|
|||||||
|
|
||||||
bool RadioInterface::init()
|
bool RadioInterface::init()
|
||||||
{
|
{
|
||||||
LOG_INFO("Starting meshradio init...");
|
LOG_INFO("Starting meshradio init");
|
||||||
|
|
||||||
configChangedObserver.observe(&service->configChanged);
|
configChangedObserver.observe(&service->configChanged);
|
||||||
preflightSleepObserver.observe(&preflightSleep);
|
preflightSleepObserver.observe(&preflightSleep);
|
||||||
@ -494,7 +494,7 @@ void RadioInterface::applyModemConfig()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((myRegion->freqEnd - myRegion->freqStart) < bw / 1000) {
|
if ((myRegion->freqEnd - myRegion->freqStart) < bw / 1000) {
|
||||||
static const char *err_string = "Regional frequency range is smaller than bandwidth. Falling back to default preset.";
|
static const char *err_string = "Regional frequency range is smaller than bandwidth. Falling back to default preset";
|
||||||
LOG_ERROR(err_string);
|
LOG_ERROR(err_string);
|
||||||
RECORD_CRITICALERROR(meshtastic_CriticalErrorCode_INVALID_RADIO_SETTING);
|
RECORD_CRITICALERROR(meshtastic_CriticalErrorCode_INVALID_RADIO_SETTING);
|
||||||
|
|
||||||
|
@ -143,12 +143,12 @@ bool RadioLibInterface::receiveDetected(uint16_t irq, ulong syncWordHeaderValidF
|
|||||||
} else if (!Throttle::isWithinTimespanMs(activeReceiveStart, 2 * preambleTimeMsec) && !(irq & syncWordHeaderValidFlag)) {
|
} else if (!Throttle::isWithinTimespanMs(activeReceiveStart, 2 * preambleTimeMsec) && !(irq & syncWordHeaderValidFlag)) {
|
||||||
// The HEADER_VALID flag should be set by now if it was really a packet, so ignore PREAMBLE_DETECTED flag
|
// The HEADER_VALID flag should be set by now if it was really a packet, so ignore PREAMBLE_DETECTED flag
|
||||||
activeReceiveStart = 0;
|
activeReceiveStart = 0;
|
||||||
LOG_DEBUG("Ignore false preamble detection.");
|
LOG_DEBUG("Ignore false preamble detection");
|
||||||
return false;
|
return false;
|
||||||
} else if (!Throttle::isWithinTimespanMs(activeReceiveStart, maxPacketTimeMsec)) {
|
} else if (!Throttle::isWithinTimespanMs(activeReceiveStart, maxPacketTimeMsec)) {
|
||||||
// We should have gotten an RX_DONE IRQ by now if it was really a packet, so ignore HEADER_VALID flag
|
// We should have gotten an RX_DONE IRQ by now if it was really a packet, so ignore HEADER_VALID flag
|
||||||
activeReceiveStart = 0;
|
activeReceiveStart = 0;
|
||||||
LOG_DEBUG("Ignore false header detection.");
|
LOG_DEBUG("Ignore false header detection");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -366,7 +366,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
|
// when this is called, we should be in receive mode - if we are not, just jump out instead of bombing. Possible Race
|
||||||
// Condition?
|
// Condition?
|
||||||
if (!isReceiving) {
|
if (!isReceiving) {
|
||||||
LOG_ERROR("handleReceiveInterrupt called when not in receive mode, which shouldn't happen.");
|
LOG_ERROR("handleReceiveInterrupt called when not in rx mode, which shouldn't happen");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ void Router::sendAckNak(meshtastic_Routing_Error err, NodeNum to, PacketId idFro
|
|||||||
|
|
||||||
void Router::abortSendAndNak(meshtastic_Routing_Error err, meshtastic_MeshPacket *p)
|
void Router::abortSendAndNak(meshtastic_Routing_Error err, meshtastic_MeshPacket *p)
|
||||||
{
|
{
|
||||||
LOG_ERROR("Error=%d, returning NAK and dropping packet.", err);
|
LOG_ERROR("Error=%d, returning NAK and dropping packet", err);
|
||||||
sendAckNak(err, getFrom(p), p->id, p->channel);
|
sendAckNak(err, getFrom(p), p->id, p->channel);
|
||||||
packetPool.release(p);
|
packetPool.release(p);
|
||||||
}
|
}
|
||||||
@ -218,13 +218,13 @@ ErrorCode Router::send(meshtastic_MeshPacket *p)
|
|||||||
if (hourlyTxPercent > myRegion->dutyCycle) {
|
if (hourlyTxPercent > myRegion->dutyCycle) {
|
||||||
#ifdef DEBUG_PORT
|
#ifdef DEBUG_PORT
|
||||||
uint8_t silentMinutes = airTime->getSilentMinutes(hourlyTxPercent, myRegion->dutyCycle);
|
uint8_t silentMinutes = airTime->getSilentMinutes(hourlyTxPercent, myRegion->dutyCycle);
|
||||||
LOG_WARN("Duty cycle limit exceeded. Aborting send for now, you can send again in %d minutes.", silentMinutes);
|
LOG_WARN("Duty cycle limit exceeded. Aborting send for now, you can send again in %d mins", silentMinutes);
|
||||||
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
||||||
cn->has_reply_id = true;
|
cn->has_reply_id = true;
|
||||||
cn->reply_id = p->id;
|
cn->reply_id = p->id;
|
||||||
cn->level = meshtastic_LogRecord_Level_WARNING;
|
cn->level = meshtastic_LogRecord_Level_WARNING;
|
||||||
cn->time = getValidTime(RTCQualityFromNet);
|
cn->time = getValidTime(RTCQualityFromNet);
|
||||||
sprintf(cn->message, "Duty cycle limit exceeded. You can send again in %d minutes.", silentMinutes);
|
sprintf(cn->message, "Duty cycle limit exceeded. You can send again in %d mins", silentMinutes);
|
||||||
service->sendClientNotification(cn);
|
service->sendClientNotification(cn);
|
||||||
#endif
|
#endif
|
||||||
meshtastic_Routing_Error err = meshtastic_Routing_Error_DUTY_CYCLE_LIMIT;
|
meshtastic_Routing_Error err = meshtastic_Routing_Error_DUTY_CYCLE_LIMIT;
|
||||||
@ -462,13 +462,13 @@ 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 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) {
|
if (compressed_len >= p->decoded.payload.size) {
|
||||||
|
|
||||||
LOG_DEBUG("Not using compressing message.");
|
LOG_DEBUG("Not using compressing message");
|
||||||
// Set the uncompressed payload variant anyway. Shouldn't hurt?
|
// Set the uncompressed payload variant anyway. Shouldn't hurt?
|
||||||
// p->decoded.which_payloadVariant = Data_payload_tag;
|
// p->decoded.which_payloadVariant = Data_payload_tag;
|
||||||
|
|
||||||
// Otherwise we use the compressor
|
// Otherwise we use the compressor
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("Using compressed message.");
|
LOG_DEBUG("Using compressed message");
|
||||||
// Copy the compressed data into the meshpacket
|
// Copy the compressed data into the meshpacket
|
||||||
|
|
||||||
p->decoded.payload.size = compressed_len;
|
p->decoded.payload.size = compressed_len;
|
||||||
|
@ -69,13 +69,13 @@ static void taskCreateCert(void *parameter)
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// Delete the saved certs (used in debugging)
|
// Delete the saved certs (used in debugging)
|
||||||
LOG_DEBUG("Deleting any saved SSL keys ...");
|
LOG_DEBUG("Deleting any saved SSL keys");
|
||||||
// prefs.clear();
|
// prefs.clear();
|
||||||
prefs.remove("PK");
|
prefs.remove("PK");
|
||||||
prefs.remove("cert");
|
prefs.remove("cert");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LOG_INFO("Checking if we have a previously saved SSL Certificate.");
|
LOG_INFO("Checking if we have a saved SSL Certificate");
|
||||||
|
|
||||||
size_t pkLen = prefs.getBytesLength("PK");
|
size_t pkLen = prefs.getBytesLength("PK");
|
||||||
size_t certLen = prefs.getBytesLength("cert");
|
size_t certLen = prefs.getBytesLength("cert");
|
||||||
@ -139,7 +139,7 @@ void createSSLCert()
|
|||||||
16, /* Priority of the task. */
|
16, /* Priority of the task. */
|
||||||
NULL); /* Task handle. */
|
NULL); /* Task handle. */
|
||||||
|
|
||||||
LOG_DEBUG("Waiting for SSL Cert to be generated.");
|
LOG_DEBUG("Waiting for SSL Cert to be generated");
|
||||||
while (!isCertReady) {
|
while (!isCertReady) {
|
||||||
if ((millis() / 500) % 2) {
|
if ((millis() / 500) % 2) {
|
||||||
if (runLoop) {
|
if (runLoop) {
|
||||||
@ -189,7 +189,7 @@ int32_t WebServerThread::runOnce()
|
|||||||
|
|
||||||
void initWebServer()
|
void initWebServer()
|
||||||
{
|
{
|
||||||
LOG_DEBUG("Initializing Web Server ...");
|
LOG_DEBUG("Initializing Web Server...");
|
||||||
|
|
||||||
// We can now use the new certificate to setup our server as usual.
|
// We can now use the new certificate to setup our server as usual.
|
||||||
secureServer = new HTTPSServer(cert);
|
secureServer = new HTTPSServer(cert);
|
||||||
|
@ -403,19 +403,19 @@ int PiWebServerThread::CreateSSLCertificate()
|
|||||||
X509 *x509 = NULL;
|
X509 *x509 = NULL;
|
||||||
|
|
||||||
if (generate_rsa_key(&pkey) != 0) {
|
if (generate_rsa_key(&pkey) != 0) {
|
||||||
LOG_ERROR("Error generating RSA-Key.");
|
LOG_ERROR("Error generating RSA-Key");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (generate_self_signed_x509(pkey, &x509) != 0) {
|
if (generate_self_signed_x509(pkey, &x509) != 0) {
|
||||||
LOG_ERROR("Error generating of X509-Certificat.");
|
LOG_ERROR("Error generating X509-Cert");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ope file to write private key file
|
// Ope file to write private key file
|
||||||
FILE *pkey_file = fopen("private_key.pem", "wb");
|
FILE *pkey_file = fopen("private_key.pem", "wb");
|
||||||
if (!pkey_file) {
|
if (!pkey_file) {
|
||||||
LOG_ERROR("Error opening private key file.");
|
LOG_ERROR("Error opening private key file");
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
// write private key file
|
// write private key file
|
||||||
@ -425,7 +425,7 @@ int PiWebServerThread::CreateSSLCertificate()
|
|||||||
// open Certificate file
|
// open Certificate file
|
||||||
FILE *x509_file = fopen("certificate.pem", "wb");
|
FILE *x509_file = fopen("certificate.pem", "wb");
|
||||||
if (!x509_file) {
|
if (!x509_file) {
|
||||||
LOG_ERROR("Error opening certificate.");
|
LOG_ERROR("Error opening cert");
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
// write cirtificate
|
// write cirtificate
|
||||||
@ -434,7 +434,7 @@ int PiWebServerThread::CreateSSLCertificate()
|
|||||||
|
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
X509_free(x509);
|
X509_free(x509);
|
||||||
LOG_INFO("Create SSL Certifictate -certificate.pem- succesfull ");
|
LOG_INFO("Create SSL Cert -certificate.pem- succesfull ");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -453,9 +453,9 @@ PiWebServerThread::PiWebServerThread()
|
|||||||
|
|
||||||
if (settingsMap[webserverport] != 0) {
|
if (settingsMap[webserverport] != 0) {
|
||||||
webservport = settingsMap[webserverport];
|
webservport = settingsMap[webserverport];
|
||||||
LOG_INFO("Using webserver port from yaml config. %i ", webservport);
|
LOG_INFO("Using webserver port from yaml config %i ", webservport);
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("Webserver port in yaml config set to 0, so defaulting to port 443.");
|
LOG_INFO("Webserver port in yaml config set to 0, defaulting to port 443");
|
||||||
webservport = 443;
|
webservport = 443;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,7 +464,7 @@ PiWebServerThread::PiWebServerThread()
|
|||||||
LOG_ERROR("Webserver couldn't be started, abort execution");
|
LOG_ERROR("Webserver couldn't be started, abort execution");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
LOG_INFO("Webserver started ....");
|
LOG_INFO("Webserver started");
|
||||||
u_map_init(&configWeb.mime_types);
|
u_map_init(&configWeb.mime_types);
|
||||||
u_map_put(&configWeb.mime_types, "*", "application/octet-stream");
|
u_map_put(&configWeb.mime_types, "*", "application/octet-stream");
|
||||||
u_map_put(&configWeb.mime_types, ".html", "text/html");
|
u_map_put(&configWeb.mime_types, ".html", "text/html");
|
||||||
|
@ -77,12 +77,12 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
LOG_DEBUG("Allowing admin response message");
|
LOG_DEBUG("Allowing admin response message");
|
||||||
} else if (mp.from == 0) {
|
} else if (mp.from == 0) {
|
||||||
if (config.security.is_managed) {
|
if (config.security.is_managed) {
|
||||||
LOG_INFO("Ignoring local admin payload because is_managed.");
|
LOG_INFO("Ignoring local admin payload because is_managed");
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
} else if (strcasecmp(ch->settings.name, Channels::adminChannel) == 0) {
|
} else if (strcasecmp(ch->settings.name, Channels::adminChannel) == 0) {
|
||||||
if (!config.security.admin_channel_enabled) {
|
if (!config.security.admin_channel_enabled) {
|
||||||
LOG_INFO("Ignoring admin channel, as legacy admin is disabled.");
|
LOG_INFO("Ignoring admin channel, as legacy admin is disabled");
|
||||||
myReply = allocErrorResponse(meshtastic_Routing_Error_NOT_AUTHORIZED, &mp);
|
myReply = allocErrorResponse(meshtastic_Routing_Error_NOT_AUTHORIZED, &mp);
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
memcmp(mp.public_key.bytes, config.security.admin_key[1].bytes, 32) == 0) ||
|
memcmp(mp.public_key.bytes, config.security.admin_key[1].bytes, 32) == 0) ||
|
||||||
(config.security.admin_key[2].size == 32 &&
|
(config.security.admin_key[2].size == 32 &&
|
||||||
memcmp(mp.public_key.bytes, config.security.admin_key[2].bytes, 32) == 0)) {
|
memcmp(mp.public_key.bytes, config.security.admin_key[2].bytes, 32) == 0)) {
|
||||||
LOG_INFO("PKC admin payload with authorized sender key.");
|
LOG_INFO("PKC admin payload with authorized sender key");
|
||||||
} else {
|
} else {
|
||||||
myReply = allocErrorResponse(meshtastic_Routing_Error_ADMIN_PUBLIC_KEY_UNAUTHORIZED, &mp);
|
myReply = allocErrorResponse(meshtastic_Routing_Error_ADMIN_PUBLIC_KEY_UNAUTHORIZED, &mp);
|
||||||
LOG_INFO("Received PKC admin payload, but the sender public key does not match the admin authorized key!");
|
LOG_INFO("Received PKC admin payload, but the sender public key does not match the admin authorized key!");
|
||||||
@ -216,7 +216,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
disableBluetooth();
|
disableBluetooth();
|
||||||
LOG_INFO("Initiating factory config reset");
|
LOG_INFO("Initiating factory config reset");
|
||||||
nodeDB->factoryReset();
|
nodeDB->factoryReset();
|
||||||
LOG_INFO("Factory config reset finished, rebooting soon.");
|
LOG_INFO("Factory config reset finished, rebooting soon");
|
||||||
reboot(DEFAULT_REBOOT_SECONDS);
|
reboot(DEFAULT_REBOOT_SECONDS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case meshtastic_AdminMessage_get_module_config_response_tag: {
|
case meshtastic_AdminMessage_get_module_config_response_tag: {
|
||||||
LOG_INFO("Client is receiving a get_module_config response.");
|
LOG_INFO("Client is receiving a get_module_config response");
|
||||||
if (fromOthers && r->get_module_config_response.which_payload_variant ==
|
if (fromOthers && r->get_module_config_response.which_payload_variant ==
|
||||||
meshtastic_AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG) {
|
meshtastic_AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG) {
|
||||||
handleGetModuleConfigResponse(mp, r);
|
handleGetModuleConfigResponse(mp, r);
|
||||||
@ -260,13 +260,13 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case meshtastic_AdminMessage_remove_by_nodenum_tag: {
|
case meshtastic_AdminMessage_remove_by_nodenum_tag: {
|
||||||
LOG_INFO("Client is receiving a remove_nodenum command.");
|
LOG_INFO("Client is receiving a remove_nodenum command");
|
||||||
nodeDB->removeNodeByNum(r->remove_by_nodenum);
|
nodeDB->removeNodeByNum(r->remove_by_nodenum);
|
||||||
this->notifyObservers(r); // Observed by screen
|
this->notifyObservers(r); // Observed by screen
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case meshtastic_AdminMessage_set_favorite_node_tag: {
|
case meshtastic_AdminMessage_set_favorite_node_tag: {
|
||||||
LOG_INFO("Client is receiving a set_favorite_node command.");
|
LOG_INFO("Client is receiving a set_favorite_node command");
|
||||||
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(r->set_favorite_node);
|
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(r->set_favorite_node);
|
||||||
if (node != NULL) {
|
if (node != NULL) {
|
||||||
node->is_favorite = true;
|
node->is_favorite = true;
|
||||||
@ -275,7 +275,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case meshtastic_AdminMessage_remove_favorite_node_tag: {
|
case meshtastic_AdminMessage_remove_favorite_node_tag: {
|
||||||
LOG_INFO("Client is receiving a remove_favorite_node command.");
|
LOG_INFO("Client is receiving a remove_favorite_node command");
|
||||||
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(r->remove_favorite_node);
|
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(r->remove_favorite_node);
|
||||||
if (node != NULL) {
|
if (node != NULL) {
|
||||||
node->is_favorite = false;
|
node->is_favorite = false;
|
||||||
@ -284,7 +284,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case meshtastic_AdminMessage_set_fixed_position_tag: {
|
case meshtastic_AdminMessage_set_fixed_position_tag: {
|
||||||
LOG_INFO("Client is receiving a set_fixed_position command.");
|
LOG_INFO("Client is receiving a set_fixed_position command");
|
||||||
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeDB->getNodeNum());
|
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeDB->getNodeNum());
|
||||||
node->has_position = true;
|
node->has_position = true;
|
||||||
node->position = TypeConversions::ConvertToPositionLite(r->set_fixed_position);
|
node->position = TypeConversions::ConvertToPositionLite(r->set_fixed_position);
|
||||||
@ -300,14 +300,14 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case meshtastic_AdminMessage_remove_fixed_position_tag: {
|
case meshtastic_AdminMessage_remove_fixed_position_tag: {
|
||||||
LOG_INFO("Client is receiving a remove_fixed_position command.");
|
LOG_INFO("Client is receiving a remove_fixed_position command");
|
||||||
nodeDB->clearLocalPosition();
|
nodeDB->clearLocalPosition();
|
||||||
config.position.fixed_position = false;
|
config.position.fixed_position = false;
|
||||||
saveChanges(SEGMENT_DEVICESTATE | SEGMENT_CONFIG, false);
|
saveChanges(SEGMENT_DEVICESTATE | SEGMENT_CONFIG, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case meshtastic_AdminMessage_set_time_only_tag: {
|
case meshtastic_AdminMessage_set_time_only_tag: {
|
||||||
LOG_INFO("Client is receiving a set_time_only command.");
|
LOG_INFO("Client is receiving a set_time_only command");
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
tv.tv_sec = r->set_time_only;
|
tv.tv_sec = r->set_time_only;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
@ -316,7 +316,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case meshtastic_AdminMessage_enter_dfu_mode_request_tag: {
|
case meshtastic_AdminMessage_enter_dfu_mode_request_tag: {
|
||||||
LOG_INFO("Client is requesting to enter DFU mode.");
|
LOG_INFO("Client is requesting to enter DFU mode");
|
||||||
#if defined(ARCH_NRF52) || defined(ARCH_RP2040)
|
#if defined(ARCH_NRF52) || defined(ARCH_RP2040)
|
||||||
enterDfuMode();
|
enterDfuMode();
|
||||||
#endif
|
#endif
|
||||||
|
@ -481,7 +481,7 @@ int32_t CannedMessageModule::runOnce()
|
|||||||
}
|
}
|
||||||
this->runState = CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE;
|
this->runState = CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE;
|
||||||
} else {
|
} else {
|
||||||
// LOG_DEBUG("Reset message is empty.");
|
// LOG_DEBUG("Reset message is empty");
|
||||||
this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,16 +65,16 @@ meshtastic_MeshPacket *NodeInfoModule::allocReply()
|
|||||||
{
|
{
|
||||||
if (!airTime->isTxAllowedChannelUtil(false)) {
|
if (!airTime->isTxAllowedChannelUtil(false)) {
|
||||||
ignoreRequest = true; // Mark it as ignored for MeshModule
|
ignoreRequest = true; // Mark it as ignored for MeshModule
|
||||||
LOG_DEBUG("Skip sending NodeInfo due to > 40 percent channel util.");
|
LOG_DEBUG("Skip sending NodeInfo due to > 40 percent chan util");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
// If we sent our NodeInfo less than 5 min. ago, don't send it again as it may be still underway.
|
// If we sent our NodeInfo less than 5 min. ago, don't send it again as it may be still underway.
|
||||||
if (!shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 5 * 60 * 1000)) {
|
if (!shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 5 * 60 * 1000)) {
|
||||||
LOG_DEBUG("Skip sending NodeInfo since we just sent it less than 5 minutes ago.");
|
LOG_DEBUG("Skip sending NodeInfo since we sent it <5 mins ago.");
|
||||||
ignoreRequest = true; // Mark it as ignored for MeshModule
|
ignoreRequest = true; // Mark it as ignored for MeshModule
|
||||||
return NULL;
|
return NULL;
|
||||||
} else if (shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 60 * 1000)) {
|
} else if (shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 60 * 1000)) {
|
||||||
LOG_DEBUG("Skip sending actively requested NodeInfo since we just sent it less than 60 seconds ago.");
|
LOG_DEBUG("Skip sending requested NodeInfo since we sent it <60s ago.");
|
||||||
ignoreRequest = true; // Mark it as ignored for MeshModule
|
ignoreRequest = true; // Mark it as ignored for MeshModule
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
|
@ -351,7 +351,7 @@ void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t cha
|
|||||||
if (IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_TRACKER,
|
if (IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_TRACKER,
|
||||||
meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) &&
|
meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) &&
|
||||||
config.power.is_power_saving) {
|
config.power.is_power_saving) {
|
||||||
LOG_DEBUG("Starting next execution in 5 seconds and then going to sleep.");
|
LOG_DEBUG("Starting next execution in 5s, then going to sleep");
|
||||||
sleepOnNextExecution = true;
|
sleepOnNextExecution = true;
|
||||||
setIntervalFromNow(5000);
|
setIntervalFromNow(5000);
|
||||||
}
|
}
|
||||||
@ -364,7 +364,7 @@ int32_t PositionModule::runOnce()
|
|||||||
if (sleepOnNextExecution == true) {
|
if (sleepOnNextExecution == true) {
|
||||||
sleepOnNextExecution = false;
|
sleepOnNextExecution = false;
|
||||||
uint32_t nightyNightMs = Default::getConfiguredOrDefaultMs(config.position.position_broadcast_secs);
|
uint32_t nightyNightMs = Default::getConfiguredOrDefaultMs(config.position.position_broadcast_secs);
|
||||||
LOG_DEBUG("Sleeping for %ims, then awaking to send position again.", nightyNightMs);
|
LOG_DEBUG("Sleeping for %ims, then awaking to send position again", nightyNightMs);
|
||||||
doDeepSleep(nightyNightMs, false);
|
doDeepSleep(nightyNightMs, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ bool RangeTestModuleRadio::appendFile(const meshtastic_MeshPacket &mp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (FSCom.totalBytes() - FSCom.usedBytes() < 51200) {
|
if (FSCom.totalBytes() - FSCom.usedBytes() < 51200) {
|
||||||
LOG_DEBUG("Filesystem doesn't have enough free space. Aborting write.");
|
LOG_DEBUG("Filesystem doesn't have enough free space. Aborting write");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ void StoreForwardModule::historyAdd(const meshtastic_MeshPacket &mp)
|
|||||||
const auto &p = mp.decoded;
|
const auto &p = mp.decoded;
|
||||||
|
|
||||||
if (this->packetHistoryTotalCount == this->records) {
|
if (this->packetHistoryTotalCount == this->records) {
|
||||||
LOG_WARN("S&F - PSRAM Full. Starting overwrite.");
|
LOG_WARN("S&F - PSRAM Full. Starting overwrite");
|
||||||
this->packetHistoryTotalCount = 0;
|
this->packetHistoryTotalCount = 0;
|
||||||
for (auto &i : lastRequest) {
|
for (auto &i : lastRequest) {
|
||||||
i.second = 0; // Clear the last request index for each client device
|
i.second = 0; // Clear the last request index for each client device
|
||||||
@ -393,7 +393,7 @@ ProcessMessage StoreForwardModule::handleReceived(const meshtastic_MeshPacket &m
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
storeForwardModule->historyAdd(mp);
|
storeForwardModule->historyAdd(mp);
|
||||||
LOG_INFO("S&F stored. Message history contains %u records now.", this->packetHistoryTotalCount);
|
LOG_INFO("S&F stored. Message history contains %u records now", this->packetHistoryTotalCount);
|
||||||
}
|
}
|
||||||
} else if (!isFromUs(&mp) && mp.decoded.portnum == meshtastic_PortNum_STORE_FORWARD_APP) {
|
} else if (!isFromUs(&mp) && mp.decoded.portnum == meshtastic_PortNum_STORE_FORWARD_APP) {
|
||||||
auto &p = mp.decoded;
|
auto &p = mp.decoded;
|
||||||
@ -482,7 +482,7 @@ bool StoreForwardModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp,
|
|||||||
LOG_INFO("Client Request to send STATS");
|
LOG_INFO("Client Request to send STATS");
|
||||||
if (this->busy) {
|
if (this->busy) {
|
||||||
storeForwardModule->sendMessage(getFrom(&mp), meshtastic_StoreAndForward_RequestResponse_ROUTER_BUSY);
|
storeForwardModule->sendMessage(getFrom(&mp), meshtastic_StoreAndForward_RequestResponse_ROUTER_BUSY);
|
||||||
LOG_INFO("S&F - Busy. Try again shortly.");
|
LOG_INFO("S&F - Busy. Try again shortly");
|
||||||
} else {
|
} else {
|
||||||
storeForwardModule->statsSend(getFrom(&mp));
|
storeForwardModule->statsSend(getFrom(&mp));
|
||||||
}
|
}
|
||||||
@ -602,10 +602,10 @@ StoreForwardModule::StoreForwardModule()
|
|||||||
is_server = true;
|
is_server = true;
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO(".");
|
LOG_INFO(".");
|
||||||
LOG_INFO("S&F: not enough PSRAM free, disabling.");
|
LOG_INFO("S&F: not enough PSRAM free, disabling");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("S&F: device doesn't have PSRAM, disabling.");
|
LOG_INFO("S&F: device doesn't have PSRAM, disabling");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Client
|
// Client
|
||||||
|
@ -73,7 +73,7 @@ int32_t EnvironmentTelemetryModule::runOnce()
|
|||||||
sleepOnNextExecution = false;
|
sleepOnNextExecution = false;
|
||||||
uint32_t nightyNightMs = Default::getConfiguredOrDefaultMs(moduleConfig.telemetry.environment_update_interval,
|
uint32_t nightyNightMs = Default::getConfiguredOrDefaultMs(moduleConfig.telemetry.environment_update_interval,
|
||||||
default_telemetry_broadcast_interval_secs);
|
default_telemetry_broadcast_interval_secs);
|
||||||
LOG_DEBUG("Sleeping for %ims, then awaking to send metrics again.", nightyNightMs);
|
LOG_DEBUG("Sleeping for %ims, then waking to send metrics again", nightyNightMs);
|
||||||
doDeepSleep(nightyNightMs, true);
|
doDeepSleep(nightyNightMs, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,7 +463,7 @@ bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
|||||||
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
||||||
|
|
||||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) {
|
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) {
|
||||||
LOG_DEBUG("Starting next execution in 5 seconds and then going to sleep.");
|
LOG_DEBUG("Starting next execution in 5s, then going to sleep");
|
||||||
sleepOnNextExecution = true;
|
sleepOnNextExecution = true;
|
||||||
setIntervalFromNow(5000);
|
setIntervalFromNow(5000);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ int32_t HealthTelemetryModule::runOnce()
|
|||||||
sleepOnNextExecution = false;
|
sleepOnNextExecution = false;
|
||||||
uint32_t nightyNightMs = Default::getConfiguredOrDefaultMs(moduleConfig.telemetry.health_update_interval,
|
uint32_t nightyNightMs = Default::getConfiguredOrDefaultMs(moduleConfig.telemetry.health_update_interval,
|
||||||
default_telemetry_broadcast_interval_secs);
|
default_telemetry_broadcast_interval_secs);
|
||||||
LOG_DEBUG("Sleeping for %ims, then awaking to send metrics again.", nightyNightMs);
|
LOG_DEBUG("Sleeping for %ims, then waking to send metrics again", nightyNightMs);
|
||||||
doDeepSleep(nightyNightMs, true);
|
doDeepSleep(nightyNightMs, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ bool HealthTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
|||||||
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
||||||
|
|
||||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) {
|
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) {
|
||||||
LOG_DEBUG("Starting next execution in 5 seconds and then going to sleep.");
|
LOG_DEBUG("Starting next execution in 5s, then going to sleep");
|
||||||
sleepOnNextExecution = true;
|
sleepOnNextExecution = true;
|
||||||
setIntervalFromNow(5000);
|
setIntervalFromNow(5000);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ int32_t PowerTelemetryModule::runOnce()
|
|||||||
sleepOnNextExecution = false;
|
sleepOnNextExecution = false;
|
||||||
uint32_t nightyNightMs = Default::getConfiguredOrDefaultMs(moduleConfig.telemetry.power_update_interval,
|
uint32_t nightyNightMs = Default::getConfiguredOrDefaultMs(moduleConfig.telemetry.power_update_interval,
|
||||||
default_telemetry_broadcast_interval_secs);
|
default_telemetry_broadcast_interval_secs);
|
||||||
LOG_DEBUG("Sleeping for %ims, then awaking to send metrics again.", nightyNightMs);
|
LOG_DEBUG("Sleeping for %ims, then waking to send metrics again", nightyNightMs);
|
||||||
doDeepSleep(nightyNightMs, true);
|
doDeepSleep(nightyNightMs, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,7 +243,7 @@ bool PowerTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
|||||||
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
||||||
|
|
||||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) {
|
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) {
|
||||||
LOG_DEBUG("Starting next execution in 5s then going to sleep.");
|
LOG_DEBUG("Starting next execution in 5s then going to sleep");
|
||||||
sleepOnNextExecution = true;
|
sleepOnNextExecution = true;
|
||||||
setIntervalFromNow(5000);
|
setIntervalFromNow(5000);
|
||||||
}
|
}
|
||||||
|
@ -80,9 +80,9 @@ void BME680Sensor::loadState()
|
|||||||
file.read((uint8_t *)&bsecState, BSEC_MAX_STATE_BLOB_SIZE);
|
file.read((uint8_t *)&bsecState, BSEC_MAX_STATE_BLOB_SIZE);
|
||||||
file.close();
|
file.close();
|
||||||
bme680.setState(bsecState);
|
bme680.setState(bsecState);
|
||||||
LOG_INFO("%s state read from %s.", sensorName, bsecConfigFileName);
|
LOG_INFO("%s state read from %s", sensorName, bsecConfigFileName);
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("No %s state found (File: %s).", sensorName, bsecConfigFileName);
|
LOG_INFO("No %s state found (File: %s)", sensorName, bsecConfigFileName);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
LOG_ERROR("ERROR: Filesystem not implemented");
|
LOG_ERROR("ERROR: Filesystem not implemented");
|
||||||
@ -119,12 +119,12 @@ void BME680Sensor::updateState()
|
|||||||
}
|
}
|
||||||
auto file = FSCom.open(bsecConfigFileName, FILE_O_WRITE);
|
auto file = FSCom.open(bsecConfigFileName, FILE_O_WRITE);
|
||||||
if (file) {
|
if (file) {
|
||||||
LOG_INFO("%s state write to %s.", sensorName, bsecConfigFileName);
|
LOG_INFO("%s state write to %s", sensorName, bsecConfigFileName);
|
||||||
file.write((uint8_t *)&bsecState, BSEC_MAX_STATE_BLOB_SIZE);
|
file.write((uint8_t *)&bsecState, BSEC_MAX_STATE_BLOB_SIZE);
|
||||||
file.flush();
|
file.flush();
|
||||||
file.close();
|
file.close();
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("Can't write %s state (File: %s).", sensorName, bsecConfigFileName);
|
LOG_INFO("Can't write %s state (File: %s)", sensorName, bsecConfigFileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -19,7 +19,7 @@ int32_t MLX90614Sensor::runOnce()
|
|||||||
LOG_DEBUG("MLX90614 emissivity: %f", mlx.readEmissivity());
|
LOG_DEBUG("MLX90614 emissivity: %f", mlx.readEmissivity());
|
||||||
if (fabs(MLX90614_EMISSIVITY - mlx.readEmissivity()) > 0.001) {
|
if (fabs(MLX90614_EMISSIVITY - mlx.readEmissivity()) > 0.001) {
|
||||||
mlx.writeEmissivity(MLX90614_EMISSIVITY);
|
mlx.writeEmissivity(MLX90614_EMISSIVITY);
|
||||||
LOG_INFO("MLX90614 emissivity updated. In case of weird data, power cycle.");
|
LOG_INFO("MLX90614 emissivity updated. In case of weird data, power cycle");
|
||||||
}
|
}
|
||||||
LOG_DEBUG("MLX90614 Init Succeed");
|
LOG_DEBUG("MLX90614 Init Succeed");
|
||||||
status = true;
|
status = true;
|
||||||
|
@ -103,7 +103,7 @@ bool NAU7802Sensor::saveCalibrationData()
|
|||||||
nau7802config.calibrationFactor = nau7802.getCalibrationFactor();
|
nau7802config.calibrationFactor = nau7802.getCalibrationFactor();
|
||||||
bool okay = false;
|
bool okay = false;
|
||||||
|
|
||||||
LOG_INFO("%s state write to %s.", sensorName, nau7802ConfigFileName);
|
LOG_INFO("%s state write to %s", sensorName, nau7802ConfigFileName);
|
||||||
pb_ostream_t stream = {&writecb, static_cast<Print *>(&file), meshtastic_Nau7802Config_size};
|
pb_ostream_t stream = {&writecb, static_cast<Print *>(&file), meshtastic_Nau7802Config_size};
|
||||||
|
|
||||||
if (!pb_encode(&stream, &meshtastic_Nau7802Config_msg, &nau7802config)) {
|
if (!pb_encode(&stream, &meshtastic_Nau7802Config_msg, &nau7802config)) {
|
||||||
@ -121,7 +121,7 @@ bool NAU7802Sensor::loadCalibrationData()
|
|||||||
auto file = FSCom.open(nau7802ConfigFileName, FILE_O_READ);
|
auto file = FSCom.open(nau7802ConfigFileName, FILE_O_READ);
|
||||||
bool okay = false;
|
bool okay = false;
|
||||||
if (file) {
|
if (file) {
|
||||||
LOG_INFO("%s state read from %s.", sensorName, nau7802ConfigFileName);
|
LOG_INFO("%s state read from %s", sensorName, nau7802ConfigFileName);
|
||||||
pb_istream_t stream = {&readcb, &file, meshtastic_Nau7802Config_size};
|
pb_istream_t stream = {&readcb, &file, meshtastic_Nau7802Config_size};
|
||||||
if (!pb_decode(&stream, &meshtastic_Nau7802Config_msg, &nau7802config)) {
|
if (!pb_decode(&stream, &meshtastic_Nau7802Config_msg, &nau7802config)) {
|
||||||
LOG_ERROR("Error: can't decode protobuf %s", PB_GET_ERROR(&stream));
|
LOG_ERROR("Error: can't decode protobuf %s", PB_GET_ERROR(&stream));
|
||||||
@ -132,7 +132,7 @@ bool NAU7802Sensor::loadCalibrationData()
|
|||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("No %s state found (File: %s).", sensorName, nau7802ConfigFileName);
|
LOG_INFO("No %s state found (File: %s)", sensorName, nau7802ConfigFileName);
|
||||||
}
|
}
|
||||||
return okay;
|
return okay;
|
||||||
}
|
}
|
||||||
|
@ -122,13 +122,13 @@ void MQTT::onReceive(char *topic, byte *payload, size_t length)
|
|||||||
&meshtastic_Position_msg, &pos); // make the Data protobuf from position
|
&meshtastic_Position_msg, &pos); // make the Data protobuf from position
|
||||||
service->sendToMesh(p, RX_SRC_LOCAL);
|
service->sendToMesh(p, RX_SRC_LOCAL);
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("JSON Ignoring downlink message with unsupported type.");
|
LOG_DEBUG("JSON Ignoring downlink message with unsupported type");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_ERROR("JSON Received payload on MQTT but not a valid envelope.");
|
LOG_ERROR("JSON Received payload on MQTT but not a valid envelope");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN("JSON downlink received on channel not called 'mqtt' or without downlink enabled.");
|
LOG_WARN("JSON downlink received on channel not called 'mqtt' or without downlink enabled");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// no json, this is an invalid payload
|
// no json, this is an invalid payload
|
||||||
@ -155,7 +155,7 @@ void MQTT::onReceive(char *topic, byte *payload, size_t length)
|
|||||||
if (e.packet && isFromUs(e.packet))
|
if (e.packet && isFromUs(e.packet))
|
||||||
routingModule->sendAckNak(meshtastic_Routing_Error_NONE, getFrom(e.packet), e.packet->id, ch.index);
|
routingModule->sendAckNak(meshtastic_Routing_Error_NONE, getFrom(e.packet), e.packet->id, ch.index);
|
||||||
else
|
else
|
||||||
LOG_INFO("Ignoring downlink message we originally sent.");
|
LOG_INFO("Ignoring downlink message we originally sent");
|
||||||
} else {
|
} else {
|
||||||
// Find channel by channel_id and check downlink_enabled
|
// Find channel by channel_id and check downlink_enabled
|
||||||
if ((strcmp(e.channel_id, "PKI") == 0 && e.packet) ||
|
if ((strcmp(e.channel_id, "PKI") == 0 && e.packet) ||
|
||||||
@ -165,18 +165,18 @@ void MQTT::onReceive(char *topic, byte *payload, size_t length)
|
|||||||
p->via_mqtt = true; // Mark that the packet was received via MQTT
|
p->via_mqtt = true; // Mark that the packet was received via MQTT
|
||||||
|
|
||||||
if (isFromUs(p)) {
|
if (isFromUs(p)) {
|
||||||
LOG_INFO("Ignoring downlink message we originally sent.");
|
LOG_INFO("Ignoring downlink message we originally sent");
|
||||||
packetPool.release(p);
|
packetPool.release(p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
|
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
|
||||||
if (moduleConfig.mqtt.encryption_enabled) {
|
if (moduleConfig.mqtt.encryption_enabled) {
|
||||||
LOG_INFO("Ignoring decoded message on MQTT, encryption is enabled.");
|
LOG_INFO("Ignoring decoded message on MQTT, encryption is enabled");
|
||||||
packetPool.release(p);
|
packetPool.release(p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (p->decoded.portnum == meshtastic_PortNum_ADMIN_APP) {
|
if (p->decoded.portnum == meshtastic_PortNum_ADMIN_APP) {
|
||||||
LOG_INFO("Ignoring decoded admin packet.");
|
LOG_INFO("Ignoring decoded admin packet");
|
||||||
packetPool.release(p);
|
packetPool.release(p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -242,7 +242,7 @@ MQTT::MQTT() : concurrency::OSThread("mqtt"), mqttQueue(MAX_MQTT_QUEUE)
|
|||||||
|
|
||||||
isMqttServerAddressPrivate = isPrivateIpAddress(moduleConfig.mqtt.address);
|
isMqttServerAddressPrivate = isPrivateIpAddress(moduleConfig.mqtt.address);
|
||||||
if (isMqttServerAddressPrivate) {
|
if (isMqttServerAddressPrivate) {
|
||||||
LOG_INFO("MQTT server is a private IP address.");
|
LOG_INFO("MQTT server on a private IP");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAS_NETWORKING
|
#if HAS_NETWORKING
|
||||||
@ -251,7 +251,7 @@ MQTT::MQTT() : concurrency::OSThread("mqtt"), mqttQueue(MAX_MQTT_QUEUE)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (moduleConfig.mqtt.proxy_to_client_enabled) {
|
if (moduleConfig.mqtt.proxy_to_client_enabled) {
|
||||||
LOG_INFO("MQTT configured to use client proxy...");
|
LOG_INFO("MQTT configured to use client proxy");
|
||||||
enabled = true;
|
enabled = true;
|
||||||
runASAP = true;
|
runASAP = true;
|
||||||
reconnectCount = 0;
|
reconnectCount = 0;
|
||||||
@ -315,7 +315,7 @@ void MQTT::reconnect()
|
|||||||
{
|
{
|
||||||
if (wantsLink()) {
|
if (wantsLink()) {
|
||||||
if (moduleConfig.mqtt.proxy_to_client_enabled) {
|
if (moduleConfig.mqtt.proxy_to_client_enabled) {
|
||||||
LOG_INFO("MQTT connecting via client proxy instead...");
|
LOG_INFO("MQTT connecting via client proxy instead");
|
||||||
enabled = true;
|
enabled = true;
|
||||||
runASAP = true;
|
runASAP = true;
|
||||||
reconnectCount = 0;
|
reconnectCount = 0;
|
||||||
@ -385,7 +385,7 @@ void MQTT::reconnect()
|
|||||||
} else {
|
} else {
|
||||||
#if HAS_WIFI && !defined(ARCH_PORTDUINO)
|
#if HAS_WIFI && !defined(ARCH_PORTDUINO)
|
||||||
reconnectCount++;
|
reconnectCount++;
|
||||||
LOG_ERROR("Failed to contact MQTT server directly (%d/%d)...", reconnectCount, reconnectMax);
|
LOG_ERROR("Failed to contact MQTT server directly (%d/%d)", reconnectCount, reconnectMax);
|
||||||
if (reconnectCount >= reconnectMax) {
|
if (reconnectCount >= reconnectMax) {
|
||||||
needReconnect = true;
|
needReconnect = true;
|
||||||
wifiReconnect->setIntervalFromNow(0);
|
wifiReconnect->setIntervalFromNow(0);
|
||||||
@ -630,9 +630,9 @@ void MQTT::perhapsReportToMap()
|
|||||||
if (map_position_precision == 0 || (localPosition.latitude_i == 0 && localPosition.longitude_i == 0)) {
|
if (map_position_precision == 0 || (localPosition.latitude_i == 0 && localPosition.longitude_i == 0)) {
|
||||||
last_report_to_map = millis();
|
last_report_to_map = millis();
|
||||||
if (map_position_precision == 0)
|
if (map_position_precision == 0)
|
||||||
LOG_WARN("MQTT Map reporting is enabled, but precision is 0");
|
LOG_WARN("MQTT Map reporting enabled, but precision is 0");
|
||||||
if (localPosition.latitude_i == 0 && localPosition.longitude_i == 0)
|
if (localPosition.latitude_i == 0 && localPosition.longitude_i == 0)
|
||||||
LOG_WARN("MQTT Map reporting is enabled, but no position available.");
|
LOG_WARN("MQTT Map reporting enabled, but no position available");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ ErrorCode SimRadio::send(meshtastic_MeshPacket *p)
|
|||||||
|
|
||||||
// set (random) transmit delay to let others reconfigure their radio,
|
// set (random) transmit delay to let others reconfigure their radio,
|
||||||
// to avoid collisions and implement timing-based flooding
|
// to avoid collisions and implement timing-based flooding
|
||||||
LOG_DEBUG("Set random delay before transmitting.");
|
LOG_DEBUG("Set random delay before tx");
|
||||||
setTransmitDelay();
|
setTransmitDelay();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -193,7 +193,7 @@ void SimRadio::startSend(meshtastic_MeshPacket *txp)
|
|||||||
memcpy(&c.data.bytes, p->decoded.payload.bytes, p->decoded.payload.size);
|
memcpy(&c.data.bytes, p->decoded.payload.bytes, p->decoded.payload.size);
|
||||||
c.data.size = p->decoded.payload.size;
|
c.data.size = p->decoded.payload.size;
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN("Payload size is larger than compressed message allows! Sending empty payload.");
|
LOG_WARN("Payload size larger than compressed message allows! Sending empty payload");
|
||||||
}
|
}
|
||||||
p->decoded.payload.size =
|
p->decoded.payload.size =
|
||||||
pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &meshtastic_Compressed_msg, &c);
|
pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &meshtastic_Compressed_msg, &c);
|
||||||
|
@ -71,7 +71,7 @@ void setCPUFast(bool on)
|
|||||||
* (Added: Dec 23, 2021 by Jm Casler)
|
* (Added: Dec 23, 2021 by Jm Casler)
|
||||||
*/
|
*/
|
||||||
#ifndef CONFIG_IDF_TARGET_ESP32C3
|
#ifndef CONFIG_IDF_TARGET_ESP32C3
|
||||||
LOG_DEBUG("Setting CPU to 240MHz because WiFi is in use.");
|
LOG_DEBUG("Setting CPU to 240MHz because WiFi is in use");
|
||||||
setCpuFrequencyMhz(240);
|
setCpuFrequencyMhz(240);
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
@ -305,7 +305,7 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false)
|
|||||||
PMU->disablePowerOutput(XPOWERS_LDO2); // lora radio power channel
|
PMU->disablePowerOutput(XPOWERS_LDO2); // lora radio power channel
|
||||||
}
|
}
|
||||||
if (msecToWake == portMAX_DELAY) {
|
if (msecToWake == portMAX_DELAY) {
|
||||||
LOG_INFO("PMU shutdown.");
|
LOG_INFO("PMU shutdown");
|
||||||
console->flush();
|
console->flush();
|
||||||
PMU->shutdown();
|
PMU->shutdown();
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ void XModemAdapter::sendControl(meshtastic_XModem_Control c)
|
|||||||
{
|
{
|
||||||
xmodemStore = meshtastic_XModem_init_zero;
|
xmodemStore = meshtastic_XModem_init_zero;
|
||||||
xmodemStore.control = c;
|
xmodemStore.control = c;
|
||||||
LOG_DEBUG("XModem: Notify Sending control %d.", c);
|
LOG_DEBUG("XModem: Notify Sending control %d", c);
|
||||||
packetReady.notifyObservers(packetno);
|
packetReady.notifyObservers(packetno);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ void XModemAdapter::handlePacket(meshtastic_XModem xmodemPacket)
|
|||||||
xmodemStore.seq = packetno;
|
xmodemStore.seq = packetno;
|
||||||
xmodemStore.buffer.size = file.read(xmodemStore.buffer.bytes, sizeof(meshtastic_XModem_buffer_t::bytes));
|
xmodemStore.buffer.size = file.read(xmodemStore.buffer.bytes, sizeof(meshtastic_XModem_buffer_t::bytes));
|
||||||
xmodemStore.crc16 = crc16_ccitt(xmodemStore.buffer.bytes, xmodemStore.buffer.size);
|
xmodemStore.crc16 = crc16_ccitt(xmodemStore.buffer.bytes, xmodemStore.buffer.size);
|
||||||
LOG_DEBUG("XModem: STX Notify Sending packet %d, %d Bytes.", packetno, xmodemStore.buffer.size);
|
LOG_DEBUG("XModem: STX Notify Sending packet %d, %d Bytes", packetno, xmodemStore.buffer.size);
|
||||||
if (xmodemStore.buffer.size < sizeof(meshtastic_XModem_buffer_t::bytes)) {
|
if (xmodemStore.buffer.size < sizeof(meshtastic_XModem_buffer_t::bytes)) {
|
||||||
isEOT = true;
|
isEOT = true;
|
||||||
// send EOT on next Ack
|
// send EOT on next Ack
|
||||||
@ -208,7 +208,7 @@ void XModemAdapter::handlePacket(meshtastic_XModem xmodemPacket)
|
|||||||
xmodemStore.seq = packetno;
|
xmodemStore.seq = packetno;
|
||||||
xmodemStore.buffer.size = file.read(xmodemStore.buffer.bytes, sizeof(meshtastic_XModem_buffer_t::bytes));
|
xmodemStore.buffer.size = file.read(xmodemStore.buffer.bytes, sizeof(meshtastic_XModem_buffer_t::bytes));
|
||||||
xmodemStore.crc16 = crc16_ccitt(xmodemStore.buffer.bytes, xmodemStore.buffer.size);
|
xmodemStore.crc16 = crc16_ccitt(xmodemStore.buffer.bytes, xmodemStore.buffer.size);
|
||||||
LOG_DEBUG("XModem: ACK Notify Sending packet %d, %d Bytes.", packetno, xmodemStore.buffer.size);
|
LOG_DEBUG("XModem: ACK Notify Sending packet %d, %d Bytes", packetno, xmodemStore.buffer.size);
|
||||||
if (xmodemStore.buffer.size < sizeof(meshtastic_XModem_buffer_t::bytes)) {
|
if (xmodemStore.buffer.size < sizeof(meshtastic_XModem_buffer_t::bytes)) {
|
||||||
isEOT = true;
|
isEOT = true;
|
||||||
// send EOT on next Ack
|
// send EOT on next Ack
|
||||||
@ -235,7 +235,7 @@ void XModemAdapter::handlePacket(meshtastic_XModem xmodemPacket)
|
|||||||
file.seek((packetno - 1) * sizeof(meshtastic_XModem_buffer_t::bytes));
|
file.seek((packetno - 1) * sizeof(meshtastic_XModem_buffer_t::bytes));
|
||||||
xmodemStore.buffer.size = file.read(xmodemStore.buffer.bytes, sizeof(meshtastic_XModem_buffer_t::bytes));
|
xmodemStore.buffer.size = file.read(xmodemStore.buffer.bytes, sizeof(meshtastic_XModem_buffer_t::bytes));
|
||||||
xmodemStore.crc16 = crc16_ccitt(xmodemStore.buffer.bytes, xmodemStore.buffer.size);
|
xmodemStore.crc16 = crc16_ccitt(xmodemStore.buffer.bytes, xmodemStore.buffer.size);
|
||||||
LOG_DEBUG("XModem: NAK Notify Sending packet %d, %d Bytes.", packetno, xmodemStore.buffer.size);
|
LOG_DEBUG("XModem: NAK Notify Sending packet %d, %d Bytes", packetno, xmodemStore.buffer.size);
|
||||||
if (xmodemStore.buffer.size < sizeof(meshtastic_XModem_buffer_t::bytes)) {
|
if (xmodemStore.buffer.size < sizeof(meshtastic_XModem_buffer_t::bytes)) {
|
||||||
isEOT = true;
|
isEOT = true;
|
||||||
// send EOT on next Ack
|
// send EOT on next Ack
|
||||||
|
Loading…
Reference in New Issue
Block a user