Skip to content

Commit

Permalink
Add more log context in case of (beacon) enqueue error.
Browse files Browse the repository at this point in the history
  • Loading branch information
brocaar committed Aug 26, 2024
1 parent 8546dc9 commit 980948c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion chirpstack-concentratord-sx1301/src/handler/beacon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ pub fn beacon_loop(
"Beacon enqueued, beacon_time_gps_epoch: {:?}",
next_beacon_time
),
Err(err) => warn!("Enqueue beacon failed, error: {}", err),
Err(err) => warn!(
"Enqueue beacon failed, error: {}, beacon_time_gps_epoch: {:?}",
err, next_beacon_time
),
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion chirpstack-concentratord-sx1302/src/handler/beacon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ pub fn beacon_loop(
"Beacon enqueued, beacon_time_gps_epoch: {:?}",
next_beacon_time
),
Err(err) => warn!("Enqueue beacon failed, error: {}", err),
Err(err) => warn!(
"Enqueue beacon failed, error: {}, beacon_time_gps_epoch: {:?}",
err, next_beacon_time
),
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions libconcentratord/src/jitqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,13 @@ impl<T: TxPacket + Copy> Queue<T> {
|| item.linear_count - linear_count
< self.tx_start_delay + self.tx_margin_delay + self.tx_jit_delay
{
warn!("Too late to enqueue packet, downlink_id: {}, counter_us: {}, current_counter_us: {}", item.packet.get_id(), item.packet.get_count_us(), concentrator_count);
return Err(gw::TxAckStatus::TooLate);
}

// Is it too early to send this packet?
if item.linear_count - linear_count > self.tx_max_advance_delay {
warn!("Too early to enqueue packet, downlink_id: {}, counter_us: {}, current_counter_us: {}", item.packet.get_id(), item.packet.get_count_us(), concentrator_count);
return Err(gw::TxAckStatus::TooEarly);
}

Expand Down

0 comments on commit 980948c

Please sign in to comment.