From 74c138620a97d57799be13ddddfbf277dcb7af31 Mon Sep 17 00:00:00 2001 From: a-f-G-U-C <65810997+a-f-G-U-C@users.noreply.github.com> Date: Thu, 28 Oct 2021 11:25:45 +0000 Subject: [PATCH 1/3] revert sanity check from PR 898 --- src/plugins/PositionPlugin.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/PositionPlugin.cpp b/src/plugins/PositionPlugin.cpp index 5f03ec6b..509750c8 100644 --- a/src/plugins/PositionPlugin.cpp +++ b/src/plugins/PositionPlugin.cpp @@ -18,11 +18,15 @@ bool PositionPlugin::handleReceivedProtobuf(const MeshPacket &mp, Position *pptr { auto p = *pptr; - // If inbound message is a replay (or spoof!) of our own messages, do not process + // If inbound message is a replay (or spoof!) of our own messages, we shouldn't process // (why use second-hand sources for our own data?) + + // FIXME this can in fact happen with packets sent from EUD (src=RX_SRC_USER) + // to set fixed location, EUD-GPS location or just the time (see also issue #900) if (nodeDB.getNodeNum() == getFrom(&mp)) { - DEBUG_MSG("Ignored an incoming update from MYSELF\n"); - return false; + DEBUG_MSG("Incoming update from MYSELF\n"); + // DEBUG_MSG("Ignored an incoming update from MYSELF\n"); + // return false; } // Log packet size and list of fields From 646d1caf66a3d69102e587e3442d615ea39145a4 Mon Sep 17 00:00:00 2001 From: a-f-G-U-C <65810997+a-f-G-U-C@users.noreply.github.com> Date: Thu, 28 Oct 2021 11:31:19 +0000 Subject: [PATCH 2/3] updatePosition process time-only message --- src/mesh/NodeDB.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index e5594b21..6f1d26f6 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -457,10 +457,19 @@ void NodeDB::updatePosition(uint32_t nodeId, const Position &p, RxSource src) p.pos_timestamp, p.time, p.latitude_i, p.longitude_i); info->position = p; + } else if ((p.time > 0) && !p.latitude_i && !p.longitude_i && !p.pos_timestamp && + !p.location_source) { + // FIXME SPECIAL TIME SETTING PACKET FROM EUD TO RADIO + // (stop-gap fix for issue #900) + DEBUG_MSG("updatePosition SPECIAL time setting time=%u\n", p.time); + info->position.time = p.time; + } else { // Be careful to only update fields that have been set by the REMOTE sender // A lot of position reports don't have time populated. In that case, be careful to not blow away the time we // recorded based on the packet rxTime + // + // FIXME perhaps handle RX_SRC_USER separately? DEBUG_MSG("updatePosition REMOTE node=0x%x time=%u, latI=%d, lonI=%d\n", nodeId, p.time, p.latitude_i, p.longitude_i); From d4ea18851d7ef39d9bfd1dd05c21b0c7e9b35319 Mon Sep 17 00:00:00 2001 From: a-f-G-U-C <65810997+a-f-G-U-C@users.noreply.github.com> Date: Thu, 28 Oct 2021 11:33:32 +0000 Subject: [PATCH 3/3] update for RX_SRC_USER --- src/mesh/Router.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 68b08161..053f3629 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -334,9 +334,11 @@ void Router::handleReceived(MeshPacket *p, RxSource src) if (decoded) { // parsing was successful, queue for our recipient if (src == RX_SRC_LOCAL) - printPacket("handleReceived(local)", p); + printPacket("handleReceived(LOCAL)", p); + else if (src == RX_SRC_USER) + printPacket("handleReceived(USER)", p); else - printPacket("handleReceived(remote)", p); + printPacket("handleReceived(REMOTE)", p); } else { printPacket("packet decoding failed (no PSK?)", p); }