Compare commits

...

5 Commits

Author SHA1 Message Date
GUVWAF
2d4d36c605
Drop oldest packet from radio when queue is full (#5212)
Some checks are pending
CI / setup (rp2040) (push) Waiting to run
CI / setup (stm32) (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32-s3 (push) Blocked by required conditions
CI / build-esp32-c3 (push) Blocked by required conditions
CI / build-esp32-c6 (push) Blocked by required conditions
CI / build-nrf52 (push) Blocked by required conditions
CI / build-rpi2040 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / package-raspbian (push) Waiting to run
CI / package-raspbian-armv7l (push) Waiting to run
CI / package-native (push) Waiting to run
CI / after-checks (push) Blocked by required conditions
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions
Flawfinder Scan / Flawfinder (push) Waiting to run
And still notify Router

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-11-01 15:48:55 -05:00
Ben Meadors
cbe74009a9 Comment out unused var to get rid of warning 2024-11-01 15:46:11 -05:00
Ben Meadors
701421b50a Trunk fmt 2024-11-01 15:17:25 -05:00
Aaron.Lee
336cdc0efe
Add Heltec V3 battery read pin detect function (#5196) 2024-11-01 15:12:41 -05:00
Ben Meadors
a1ac358b0a
Don't try to count non-lora transmissions into airtime (or attempt to decode) (#5215)
* Don't try to count non-lora transmissions into airtime (or attempt to decode)

* Don't need to check utilization anymore
2024-11-01 13:20:11 -05:00
8 changed files with 35 additions and 19 deletions

View File

@ -245,7 +245,8 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' }} if: ${{ github.event_name == 'workflow_dispatch' }}
outputs: outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
needs: [ needs:
[
gather-artifacts, gather-artifacts,
package-raspbian, package-raspbian,
package-raspbian-armv7l, package-raspbian-armv7l,

View File

@ -8,10 +8,10 @@ plugins:
uri: https://github.com/trunk-io/plugins uri: https://github.com/trunk-io/plugins
lint: lint:
enabled: enabled:
- trufflehog@3.82.13 - trufflehog@3.83.2
- yamllint@1.35.1 - yamllint@1.35.1
- bandit@1.7.10 - bandit@1.7.10
- checkov@3.2.269 - checkov@3.2.276
- terrascan@1.19.9 - terrascan@1.19.9
- trivy@0.56.2 - trivy@0.56.2
#- trufflehog@3.63.2-rc0 #- trufflehog@3.63.2-rc0

View File

@ -154,9 +154,16 @@ static void adcEnable()
#ifdef ADC_CTRL // enable adc voltage divider when we need to read #ifdef ADC_CTRL // enable adc voltage divider when we need to read
#ifdef ADC_USE_PULLUP #ifdef ADC_USE_PULLUP
pinMode(ADC_CTRL, INPUT_PULLUP); pinMode(ADC_CTRL, INPUT_PULLUP);
#else
#ifdef HELTEC_V3
pinMode(ADC_CTRL, INPUT);
uint8_t adc_ctl_enable_value = !(digitalRead(ADC_CTRL));
pinMode(ADC_CTRL, OUTPUT);
digitalWrite(ADC_CTRL, adc_ctl_enable_value);
#else #else
pinMode(ADC_CTRL, OUTPUT); pinMode(ADC_CTRL, OUTPUT);
digitalWrite(ADC_CTRL, ADC_CTRL_ENABLED); digitalWrite(ADC_CTRL, ADC_CTRL_ENABLED);
#endif
#endif #endif
delay(10); delay(10);
#endif #endif
@ -167,10 +174,14 @@ static void adcDisable()
#ifdef ADC_CTRL // disable adc voltage divider when we need to read #ifdef ADC_CTRL // disable adc voltage divider when we need to read
#ifdef ADC_USE_PULLUP #ifdef ADC_USE_PULLUP
pinMode(ADC_CTRL, INPUT_PULLDOWN); pinMode(ADC_CTRL, INPUT_PULLDOWN);
#else
#ifdef HELTEC_V3
pinMode(ADC_CTRL, ANALOG);
#else #else
digitalWrite(ADC_CTRL, !ADC_CTRL_ENABLED); digitalWrite(ADC_CTRL, !ADC_CTRL_ENABLED);
#endif #endif
#endif #endif
#endif
} }
#endif #endif

View File

@ -137,11 +137,12 @@ NodeDB::NodeDB()
memcpy(myNodeInfo.device_id.bytes, &device_id_start, sizeof(device_id_start)); memcpy(myNodeInfo.device_id.bytes, &device_id_start, sizeof(device_id_start));
memcpy(myNodeInfo.device_id.bytes + sizeof(device_id_start), &device_id_end, sizeof(device_id_end)); memcpy(myNodeInfo.device_id.bytes + sizeof(device_id_start), &device_id_end, sizeof(device_id_end));
myNodeInfo.device_id.size = 16; myNodeInfo.device_id.size = 16;
hasUniqueId = true; // Uncomment below to print the device id
// hasUniqueId = true;
#else #else
// FIXME - implement for other platforms // FIXME - implement for other platforms
#endif #endif
// Uncomment below to print the device id
// if (hasUniqueId) { // if (hasUniqueId) {
// std::string deviceIdHex; // std::string deviceIdHex;
// for (size_t i = 0; i < myNodeInfo.device_id.size; ++i) { // for (size_t i = 0; i < myNodeInfo.device_id.size; ++i) {

View File

@ -278,11 +278,14 @@ void RadioLibInterface::onNotify(uint32_t notification)
// Send any outgoing packets we have ready // Send any outgoing packets we have ready
meshtastic_MeshPacket *txp = txQueue.dequeue(); meshtastic_MeshPacket *txp = txQueue.dequeue();
assert(txp); assert(txp);
bool isLoraTx = txp->to != NODENUM_BROADCAST_NO_LORA;
startSend(txp); startSend(txp);
// Packet has been sent, count it toward our TX airtime utilization. if (isLoraTx) {
uint32_t xmitMsec = getPacketTime(txp); // Packet has been sent, count it toward our TX airtime utilization.
airTime->logAirtime(TX_LOG, xmitMsec); uint32_t xmitMsec = getPacketTime(txp);
airTime->logAirtime(TX_LOG, xmitMsec);
}
} }
} }
} else { } else {

View File

@ -81,14 +81,17 @@ int32_t Router::runOnce()
*/ */
void Router::enqueueReceivedMessage(meshtastic_MeshPacket *p) void Router::enqueueReceivedMessage(meshtastic_MeshPacket *p)
{ {
if (fromRadioQueue.enqueue(p, 0)) { // NOWAIT - fixme, if queue is full, delete older messages // Try enqueue until successful
while (!fromRadioQueue.enqueue(p, 0)) {
// Nasty hack because our threading is primitive. interfaces shouldn't need to know about routers FIXME meshtastic_MeshPacket *old_p;
setReceivedMessage(); old_p = fromRadioQueue.dequeuePtr(0); // Dequeue and discard the oldest packet
} else { if (old_p) {
printPacket("BUG! fromRadioQueue is full! Discarding!", p); printPacket("fromRadioQ full, drop oldest!", old_p);
packetPool.release(p); packetPool.release(old_p);
}
} }
// Nasty hack because our threading is primitive. interfaces shouldn't need to know about routers FIXME
setReceivedMessage();
} }
/// Generate a unique packet id /// Generate a unique packet id

View File

@ -121,9 +121,7 @@ Will be used for broadcast.
*/ */
int32_t NeighborInfoModule::runOnce() int32_t NeighborInfoModule::runOnce()
{ {
if (airTime->isTxAllowedChannelUtil(true) && airTime->isTxAllowedAirUtil()) { sendNeighborInfo(NODENUM_BROADCAST_NO_LORA, false);
sendNeighborInfo(NODENUM_BROADCAST_NO_LORA, false);
}
return Default::getConfiguredOrDefaultMs(moduleConfig.neighbor_info.update_interval, default_neighbor_info_broadcast_secs); return Default::getConfiguredOrDefaultMs(moduleConfig.neighbor_info.update_interval, default_neighbor_info_broadcast_secs);
} }

View File

@ -19,4 +19,3 @@ static const uint8_t MOSI = 38;
static const uint8_t SS = 17; static const uint8_t SS = 17;
#endif /* Pins_Arduino_h */ #endif /* Pins_Arduino_h */