change! time of last packet rx in node->last_heard instead of node->position.time

pull/761/head
Kevin Hester 2021-03-26 09:30:15 +08:00
rodzic dd0f1b2704
commit 04225f7bc2
5 zmienionych plików z 18 dodań i 15 usunięć

Wyświetl plik

@ -4,13 +4,16 @@ You probably don't care about this section - skip to the next one.
## before next release
* turn off bluetooth interface ENTIRELY while using serial API (was python client times out on connect sometimes)
* gps assistance from phone not working?
* split position.time and last_heard
* update android app to use last_heard
* have android fill in if local GPS has poor signal
* DONE turn off bluetooth interface ENTIRELY while using serial API (was python client times out on connect sometimes)
* DONE gps assistance from phone not working?
* DONE test latest firmware update with is_router
* DONE firmware OTA updates of is_router true nodes fails?
* DONE add UI in android app to reset to defaults https://github.com/meshtastic/Meshtastic-Android/issues/263
* DONE TEST THIS! changing channels requires a reboot to take effect https://github.com/meshtastic/Meshtastic-device/issues/752
* DIBE bug report with remote info request timing out
* DONE bug report with remote info request timing out
* DONE retest channel changing in android (using sim?)
* DONE move remote admin doc from forum into git
* DONE check crashlytics

Wyświetl plik

@ -198,7 +198,7 @@ NodeInfo *MeshService::refreshMyNodeInfo()
Position &position = node->position;
// Update our local node info with our position (even if we don't decide to update anyone else)
position.time =
node->last_heard =
getValidTime(RTCQualityFromNet); // This nodedb timestamp might be stale, so update it if our clock is kinda valid
position.battery_level = powerStatus->getBatteryChargePercent();

Wyświetl plik

@ -408,8 +408,7 @@ uint32_t sinceLastSeen(const NodeInfo *n)
{
uint32_t now = getTime();
uint32_t last_seen = n->position.time;
int delta = (int)(now - last_seen);
int delta = (int)(now - n->last_heard);
if (delta < 0) // our clock must be slightly off still - not set from GPS yet
delta = 0;
@ -443,7 +442,7 @@ void NodeDB::updatePosition(uint32_t nodeId, const Position &p)
// Be careful to only update fields that have been set by the 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
if (!info->position.time && p.time)
if (p.time)
info->position.time = p.time;
if (p.battery_level)
info->position.battery_level = p.battery_level;
@ -493,10 +492,8 @@ void NodeDB::updateFrom(const MeshPacket &mp)
NodeInfo *info = getOrCreateNode(getFrom(&mp));
if (mp.rx_time) { // if the packet has a valid timestamp use it to update our last_seen
info->has_position = true; // at least the time is valid
info->position.time = mp.rx_time;
}
if (mp.rx_time) // if the packet has a valid timestamp use it to update our last_heard
info->last_heard = mp.rx_time;
if (mp.rx_snr)
info->snr = mp.rx_snr; // keep the most recent SNR we received for this node.

Wyświetl plik

@ -125,7 +125,7 @@ extern const pb_msgdesc_t ChannelFile_msg;
/* Maximum encoded size of messages (where known) */
#define LegacyRadioConfig_size 4
#define LegacyRadioConfig_LegacyPreferences_size 2
#define DeviceState_size 4920
#define DeviceState_size 5112
#define ChannelFile_size 832
#ifdef __cplusplus

Wyświetl plik

@ -161,6 +161,7 @@ typedef struct _NodeInfo {
User user;
bool has_position;
Position position;
uint32_t last_heard;
float snr;
} NodeInfo;
@ -233,7 +234,7 @@ extern "C" {
#define Routing_init_default {0, {RouteDiscovery_init_default}}
#define Data_init_default {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0}
#define MeshPacket_init_default {0, 0, 0, 0, {Data_init_default}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0}
#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0}
#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0}
#define MyNodeInfo_init_default {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0}
#define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN}
#define FromRadio_init_default {0, 0, {MyNodeInfo_init_default}}
@ -244,7 +245,7 @@ extern "C" {
#define Routing_init_zero {0, {RouteDiscovery_init_zero}}
#define Data_init_zero {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0}
#define MeshPacket_init_zero {0, 0, 0, 0, {Data_init_zero}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0}
#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0}
#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0}
#define MyNodeInfo_init_zero {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0}
#define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN}
#define FromRadio_init_zero {0, 0, {MyNodeInfo_init_zero}}
@ -299,6 +300,7 @@ extern "C" {
#define NodeInfo_num_tag 1
#define NodeInfo_user_tag 2
#define NodeInfo_position_tag 3
#define NodeInfo_last_heard_tag 4
#define NodeInfo_snr_tag 7
#define Routing_route_request_tag 1
#define Routing_route_reply_tag 2
@ -378,6 +380,7 @@ X(a, STATIC, SINGULAR, INT32, rx_rssi, 13)
X(a, STATIC, SINGULAR, UINT32, num, 1) \
X(a, STATIC, OPTIONAL, MESSAGE, user, 2) \
X(a, STATIC, OPTIONAL, MESSAGE, position, 3) \
X(a, STATIC, SINGULAR, FIXED32, last_heard, 4) \
X(a, STATIC, SINGULAR, FLOAT, snr, 7)
#define NodeInfo_CALLBACK NULL
#define NodeInfo_DEFAULT NULL
@ -463,7 +466,7 @@ extern const pb_msgdesc_t ToRadio_msg;
#define Routing_size 42
#define Data_size 260
#define MeshPacket_size 309
#define NodeInfo_size 126
#define NodeInfo_size 131
#define MyNodeInfo_size 89
#define LogRecord_size 81
#define FromRadio_size 318