Skip to content

Commit

Permalink
likely fix for bug meshtastic#373. fix meshtastic#339. great gps fixe…
Browse files Browse the repository at this point in the history
…s from @a-f-G-U-C

fixes described in bug meshtastic#376
  • Loading branch information
geeksville authored and Dafeman committed Sep 14, 2020
1 parent ad60169 commit d3dba69
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion proto
Submodule proto updated from 3caee2 to ce422b
16 changes: 10 additions & 6 deletions src/gps/UBloxGPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ bool UBloxGPS::setup()
// ublox.enableDebugging(Serial);

// try a second time, the ublox lib serial parsing is buggy?
if (!tryConnect())
tryConnect();
// see https://github.com/meshtastic/Meshtastic-device/issues/376
for (int i = 0; (i < 3) && !tryConnect(); i++)
delay(500);

if (isConnected) {
DEBUG_MSG("Connected to UBLOX GPS successfully\n");
Expand Down Expand Up @@ -81,8 +82,11 @@ bool UBloxGPS::setUBXMode()
// assert(ok);
// ok = ublox.setDynamicModel(DYN_MODEL_BIKE); // probably PEDESTRIAN but just in case assume bike speeds
// assert(ok);
if (!ublox.powerSaveMode(true, 2000)) // use power save mode, the default timeout (1100ms seems a bit too tight)
return false;

// per https://github.com/meshtastic/Meshtastic-device/issues/376 powerSaveMode might not work with the marginal
// TTGO antennas
// if (!ublox.powerSaveMode(true, 2000)) // use power save mode, the default timeout (1100ms seems a bit too tight)
// return false;

if (!ublox.saveConfiguration(3000))
return false;
Expand All @@ -106,8 +110,8 @@ bool UBloxGPS::factoryReset()
tryConnect(); // sets isConnected

// try a second time, the ublox lib serial parsing is buggy?
if (!tryConnect())
tryConnect();
for (int i = 0; (i < 3) && !tryConnect(); i++)
delay(500);

DEBUG_MSG("GPS Factory reset success=%d\n", isConnected);
if (isConnected)
Expand Down
4 changes: 2 additions & 2 deletions src/mesh/mesh.pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ typedef struct _ToRadio {
#define DeviceState_version_tag 8
#define DeviceState_rx_text_message_tag 7
#define DeviceState_no_save_tag 9
#define DeviceState_did_gps_reset_tag 10
#define DeviceState_did_gps_reset_tag 11
#define FromRadio_packet_tag 2
#define FromRadio_my_info_tag 3
#define FromRadio_node_info_tag 4
Expand Down Expand Up @@ -519,7 +519,7 @@ X(a, STATIC, REPEATED, MESSAGE, receive_queue, 5) \
X(a, STATIC, OPTIONAL, MESSAGE, rx_text_message, 7) \
X(a, STATIC, SINGULAR, UINT32, version, 8) \
X(a, STATIC, SINGULAR, BOOL, no_save, 9) \
X(a, STATIC, SINGULAR, BOOL, did_gps_reset, 10)
X(a, STATIC, SINGULAR, BOOL, did_gps_reset, 11)
#define DeviceState_CALLBACK NULL
#define DeviceState_DEFAULT NULL
#define DeviceState_radio_MSGTYPE RadioConfig
Expand Down

0 comments on commit d3dba69

Please sign in to comment.