From 5a7cfdffb379f27232f125849521810dd789b1fe Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 24 Jun 2020 12:49:31 -0700 Subject: [PATCH 1/4] Add links to the preinstalled version of the TBEAMs --- README.md | 7 +++++-- docs/README.md | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c5bce39cd..cbe76494d 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,14 @@ We currently support three models of radios. - TTGO T-Beam - - [T-Beam V1.0 w/ NEO-M8N](https://www.aliexpress.com/item/33047631119.html) (Recommended - slightly better GPS) - - [T-Beam V1.0 w/ NEO-6M](https://www.aliexpress.com/item/33050391850.html) (Includes built-in OLED display) + - [T-Beam V1.0 w/ NEO-6M - special Meshtastic version](https://www.aliexpress.com/item/4001178678568.html) (Includes built-in OLED display and they have **preinstalled** the meshtastic software) + - [T-Beam V1.0 w/ NEO-M8N](https://www.aliexpress.com/item/33047631119.html) (slightly better GPS) - 3D printable cases - [T-Beam V0](https://www.thingiverse.com/thing:3773717) - [T-Beam V1](https://www.thingiverse.com/thing:3830711) - [TTGO LORA32](https://www.aliexpress.com/item/4000211331316.html) - No GPS + - 3D printable case - [TTGO LORA32 v1](https://www.thingiverse.com/thing:3385109) @@ -49,6 +50,8 @@ Getting a version that includes a screen is optional, but highly recommended. Prebuilt binaries for the supported radios are available in our [releases](https://github.com/meshtastic/Meshtastic-esp32/releases). Your initial installation has to happen over USB from your Mac, Windows or Linux PC. Once our software is installed, all future software updates happen over bluetooth from your phone. +Be **very careful** to install the correct load for your board. In particular the popular 'T-BEAM' radio from TTGO is not called 'TTGO-Lora' (that is a different board). So don't install the 'TTGO-Lora' build on a TBEAM, it won't work correctly. + Please post comments on our [group chat](https://meshtastic.discourse.group/) if you have problems or successes. ### Installing from a GUI - Windows and Mac diff --git a/docs/README.md b/docs/README.md index bd5c2d2cd..f6cbf4fef 100644 --- a/docs/README.md +++ b/docs/README.md @@ -39,6 +39,7 @@ This software is 100% open source and developed by a group of hobbyist experimen Note: Updates are happening almost daily, only major updates are listed below. For more details see our forum. +- 06/24/2020 - 0.7.x Now with over 1000 android users, over 600 people using the radios and translated into 13 languages. Fairly stable and we are working through bugs to get to 1.0. - 06/04/2020 - 0.6.7 Beta releases of both the application and the device code are released. Features are fairly solid now with a sizable number of users. - 04/28/2020 - 0.6.0 [Python API](https://pypi.org/project/meshtastic/) released. Makes it easy to use meshtastic devices as "zero config / just works" mesh transport adapters for other projects. - 04/20/2020 - 0.4.3 Pretty solid now both for the android app and the device code. Many people have donated translations and code. Probably going to call it a beta soon. @@ -63,8 +64,9 @@ If you'd like to help with development, the source code is [on github](https://g ## Supported hardware -We currently support two brands of radios. The [TTGO T-Beam](https://www.aliexpress.com/item/4000119152086.html) and the [Heltec LoRa 32](https://heltec.org/project/wifi-lora-32/). Most people should buy the T-Beam and a 18650 battery (total cost less than \$35). Make -sure to buy the frequency range which is legal for your country. For the USA, you should buy the 915MHz version. Getting a version that include a screen is optional, but highly recommended. +We currently support two brands of radios. The [TTGO T-Beam](https://www.aliexpress.com/item/4001178678568.html) and the [Heltec LoRa 32](https://heltec.org/project/wifi-lora-32/). Most people should buy the T-Beam and a 18650 battery (total cost less than \$35). Also, the version of the T-Beam we link to is shipped with Meshtastic **preinstalled** by TTGO, so you don't have to install it yourself. + +Make sure to buy the frequency range which is legal for your country. For the USA, you should buy the 915MHz version. Getting a version that include a screen is optional, but highly recommended. Instructions for installing prebuilt firmware can be found [here](https://github.com/meshtastic/Meshtastic-esp32/blob/master/README.md). From 9f6e23754cd240132d5a617dc0950bb2706314f5 Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 24 Jun 2020 13:10:36 -0700 Subject: [PATCH 2/4] Add a no_save development flag to allow using settings that we don't want to save to flash. Use that flag to guard BLE stress testing code that makes device repeatedly sleep wake to force numerous BLE resets --- proto | 2 +- src/mesh/NodeDB.cpp | 57 +++++++++++++++++++++++++-------------------- src/mesh/mesh.pb.h | 11 +++++---- 3 files changed, 40 insertions(+), 30 deletions(-) diff --git a/proto b/proto index fc79db459..ab281311c 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit fc79db45944959ee3246f6f808db18e4debab72b +Subproject commit ab281311c49f2a9099d66fc6d211dca96d9603b3 diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 2a202f230..fa327cb48 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -103,13 +103,16 @@ void NodeDB::resetRadioConfig() crypto->setKey(channelSettings.psk.size, channelSettings.psk.bytes); // temp hack for quicker testing + // devicestate.no_save = TRUE; + if (devicestate.no_save) { + DEBUG_MSG("***** DEVELOPMENT MODE - DO NOT RELEASE *****"); - /* - radioConfig.preferences.screen_on_secs = 30; - radioConfig.preferences.wait_bluetooth_secs = 30; - radioConfig.preferences.position_broadcast_secs = 6 * 60; - radioConfig.preferences.ls_secs = 60; - */ + // Sleep quite frequently to stress test the BLE comms, broadcast position every 6 mins + radioConfig.preferences.screen_on_secs = 30; + radioConfig.preferences.wait_bluetooth_secs = 30; + radioConfig.preferences.position_broadcast_secs = 6 * 60; + radioConfig.preferences.ls_secs = 60; + } } void NodeDB::installDefaultDeviceState() @@ -257,32 +260,36 @@ void NodeDB::loadFromDisk() void NodeDB::saveToDisk() { #ifdef FS - auto f = FS.open(preftmp, FILE_O_WRITE); - if (f) { - DEBUG_MSG("Writing preferences\n"); + if (!devicestate.no_save) { + auto f = FS.open(preftmp, FILE_O_WRITE); + if (f) { + DEBUG_MSG("Writing preferences\n"); - pb_ostream_t stream = {&writecb, &f, SIZE_MAX, 0}; + pb_ostream_t stream = {&writecb, &f, SIZE_MAX, 0}; - // DEBUG_MSG("Presave channel name=%s\n", channelSettings.name); + // DEBUG_MSG("Presave channel name=%s\n", channelSettings.name); - devicestate.version = DEVICESTATE_CUR_VER; - if (!pb_encode(&stream, DeviceState_fields, &devicestate)) { - DEBUG_MSG("Error: can't write protobuf %s\n", PB_GET_ERROR(&stream)); - // FIXME - report failure to phone + devicestate.version = DEVICESTATE_CUR_VER; + if (!pb_encode(&stream, DeviceState_fields, &devicestate)) { + DEBUG_MSG("Error: can't write protobuf %s\n", PB_GET_ERROR(&stream)); + // FIXME - report failure to phone - f.close(); + f.close(); + } else { + // Success - replace the old file + f.close(); + + // brief window of risk here ;-) + if (!FS.remove(preffile)) + DEBUG_MSG("Warning: Can't remove old pref file\n"); + if (!FS.rename(preftmp, preffile)) + DEBUG_MSG("Error: can't rename new pref file\n"); + } } else { - // Success - replace the old file - f.close(); - - // brief window of risk here ;-) - if (!FS.remove(preffile)) - DEBUG_MSG("Warning: Can't remove old pref file\n"); - if (!FS.rename(preftmp, preffile)) - DEBUG_MSG("Error: can't rename new pref file\n"); + DEBUG_MSG("ERROR: can't write prefs\n"); // FIXME report to app } } else { - DEBUG_MSG("ERROR: can't write prefs\n"); // FIXME report to app + DEBUG_MSG("***** DEVELOPMENT MODE - DO NOT RELEASE - not saving to flash *****"); } #else DEBUG_MSG("ERROR filesystem not implemented\n"); diff --git a/src/mesh/mesh.pb.h b/src/mesh/mesh.pb.h index 808ffab88..2093bd69c 100644 --- a/src/mesh/mesh.pb.h +++ b/src/mesh/mesh.pb.h @@ -188,6 +188,7 @@ typedef struct _DeviceState { bool has_rx_text_message; MeshPacket rx_text_message; uint32_t version; + bool no_save; } DeviceState; typedef struct _FromRadio { @@ -245,7 +246,7 @@ typedef struct _ToRadio { #define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, {0, 0, 0}} #define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0} #define MyNodeInfo_init_default {0, 0, 0, "", "", "", 0, 0, 0, 0, 0, 0, 0, 0} -#define DeviceState_init_default {false, RadioConfig_init_default, false, MyNodeInfo_init_default, false, User_init_default, 0, {NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default}, 0, {MeshPacket_init_default}, false, MeshPacket_init_default, 0} +#define DeviceState_init_default {false, RadioConfig_init_default, false, MyNodeInfo_init_default, false, User_init_default, 0, {NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default}, 0, {MeshPacket_init_default}, false, MeshPacket_init_default, 0, 0} #define DebugString_init_default {""} #define FromRadio_init_default {0, 0, {MeshPacket_init_default}} #define ToRadio_init_default {0, {MeshPacket_init_default}} @@ -261,7 +262,7 @@ typedef struct _ToRadio { #define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, {0, 0, 0}} #define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0} #define MyNodeInfo_init_zero {0, 0, 0, "", "", "", 0, 0, 0, 0, 0, 0, 0, 0} -#define DeviceState_init_zero {false, RadioConfig_init_zero, false, MyNodeInfo_init_zero, false, User_init_zero, 0, {NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero}, 0, {MeshPacket_init_zero}, false, MeshPacket_init_zero, 0} +#define DeviceState_init_zero {false, RadioConfig_init_zero, false, MyNodeInfo_init_zero, false, User_init_zero, 0, {NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero}, 0, {MeshPacket_init_zero}, false, MeshPacket_init_zero, 0, 0} #define DebugString_init_zero {""} #define FromRadio_init_zero {0, 0, {MeshPacket_init_zero}} #define ToRadio_init_zero {0, {MeshPacket_init_zero}} @@ -353,6 +354,7 @@ typedef struct _ToRadio { #define DeviceState_receive_queue_tag 5 #define DeviceState_version_tag 8 #define DeviceState_rx_text_message_tag 7 +#define DeviceState_no_save_tag 9 #define FromRadio_packet_tag 2 #define FromRadio_my_info_tag 3 #define FromRadio_node_info_tag 4 @@ -501,7 +503,8 @@ X(a, STATIC, OPTIONAL, MESSAGE, owner, 3) \ X(a, STATIC, REPEATED, MESSAGE, node_db, 4) \ 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, UINT32, version, 8) \ +X(a, STATIC, SINGULAR, BOOL, no_save, 9) #define DeviceState_CALLBACK NULL #define DeviceState_DEFAULT NULL #define DeviceState_radio_MSGTYPE RadioConfig @@ -599,7 +602,7 @@ extern const pb_msgdesc_t ManufacturingData_msg; #define RadioConfig_UserPreferences_size 188 #define NodeInfo_size 132 #define MyNodeInfo_size 110 -#define DeviceState_size 5401 +#define DeviceState_size 5403 #define DebugString_size 258 #define FromRadio_size 322 #define ToRadio_size 316 From 8bb85cdc692b2dab519b5f1f0dd586edf1db5177 Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 24 Jun 2020 13:13:20 -0700 Subject: [PATCH 3/4] personal TODO list updates (sorry github reviewers) --- docs/software/TODO.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/software/TODO.md b/docs/software/TODO.md index 2c29b000a..7c05a287f 100644 --- a/docs/software/TODO.md +++ b/docs/software/TODO.md @@ -2,8 +2,12 @@ You probably don't care about this section - skip to the next one. +- do device release (after testing BLE fixes) https://github.com/meshtastic/Meshtastic-device/pull/218#event-3475395948 +- some channel names don't work - check for illegal symbols per forum report +- auto invalidate old BLE handles +- disable software update button after update finishes +- mention translations in main readme - check BLE handle stability across sleep - stress test sleep/wake - btu_init_core calls gatt_init - which assigns handles global -- test BLE software update again - @feh123 Sony Xperia Z1 C6903 running Android 5.1.1 - first message sent is still doubled for some people - Android frontend should refetch the android messages from backend service on Resume From e7eee0995ab8c8cfc7ee51e15c5817708554d2c3 Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 24 Jun 2020 16:14:38 -0700 Subject: [PATCH 4/4] fix line endings --- src/mesh/NodeDB.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index fa327cb48..ca28c17a5 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -103,9 +103,9 @@ void NodeDB::resetRadioConfig() crypto->setKey(channelSettings.psk.size, channelSettings.psk.bytes); // temp hack for quicker testing - // devicestate.no_save = TRUE; + // devicestate.no_save = true; if (devicestate.no_save) { - DEBUG_MSG("***** DEVELOPMENT MODE - DO NOT RELEASE *****"); + DEBUG_MSG("***** DEVELOPMENT MODE - DO NOT RELEASE *****\n"); // Sleep quite frequently to stress test the BLE comms, broadcast position every 6 mins radioConfig.preferences.screen_on_secs = 30; @@ -289,7 +289,7 @@ void NodeDB::saveToDisk() DEBUG_MSG("ERROR: can't write prefs\n"); // FIXME report to app } } else { - DEBUG_MSG("***** DEVELOPMENT MODE - DO NOT RELEASE - not saving to flash *****"); + DEBUG_MSG("***** DEVELOPMENT MODE - DO NOT RELEASE - not saving to flash *****\n"); } #else DEBUG_MSG("ERROR filesystem not implemented\n");