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); 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); } 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