From ffdf735f827bdbe11b9c07634a6bfea608515062 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 13 Mar 2024 15:18:05 +1300 Subject: [PATCH] ignore packets we don't want to see for now --- src/mqtt.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mqtt.js b/src/mqtt.js index 469aa45..e06161c 100644 --- a/src/mqtt.js +++ b/src/mqtt.js @@ -96,7 +96,7 @@ client.on("message", async (topic, message) => { } const logKnownPacketTypes = false; - const logUnknownPacketTypes = false; + const logUnknownPacketTypes = true; const portnum = envelope.packet?.decoded?.portnum; if(portnum === 3) { @@ -299,7 +299,19 @@ client.on("message", async (topic, message) => { else { if(logUnknownPacketTypes){ + + // ignore packets we don't want to see for now + if(portnum === undefined // ignore failed to decrypt + || portnum === 1 // ignore TEXT_MESSAGE_APP + || portnum === 34 // ignore PAXCOUNTER_APP + || portnum === 65 // ignore STORE_FORWARD_APP + || portnum === 66 // ignore RANGE_TEST_APP + ){ + return; + } + console.log(portnum, envelope); + } }