From b6f71ca1db40c7c4854d697b6a4e8cf47e143534 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Fri, 11 Sep 2020 22:17:45 -0700 Subject: [PATCH 1/9] Update screen.cpp for for crash when gps gets lock Update screen.cpp for for crash when gps gets a lock --- src/graphics/Screen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index ff3204365..5229f5660 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -250,7 +250,7 @@ static void drawGPScoordinates(OLEDDisplay *display, int16_t x, int16_t y, const displayLine = "No GPS Lock"; display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); } else { - char coordinateLine[20]; + char coordinateLine[22]; sprintf(coordinateLine, "%f %f", gps->getLatitude() * 1e-7, gps->getLongitude() * 1e-7); display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(coordinateLine))) / 2, y, coordinateLine); } From 6d9bdbb6287e1ddb2909be21675583b5acc3840f Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 12 Sep 2020 10:21:44 -0700 Subject: [PATCH 2/9] 0.9.7 --- bin/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/version.sh b/bin/version.sh index b71c5d64c..dd1d34998 100644 --- a/bin/version.sh +++ b/bin/version.sh @@ -1,3 +1,3 @@ -export VERSION=0.9.6 \ No newline at end of file +export VERSION=0.9.7 \ No newline at end of file From 62e333b235e4caf962989b9a4a51150b691726cd Mon Sep 17 00:00:00 2001 From: geeksville Date: Sun, 13 Sep 2020 11:53:31 -0700 Subject: [PATCH 3/9] 1.0.0 --- bin/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/version.sh b/bin/version.sh index dd1d34998..02a3c9d62 100644 --- a/bin/version.sh +++ b/bin/version.sh @@ -1,3 +1,3 @@ -export VERSION=0.9.7 \ No newline at end of file +export VERSION=1.0.0 \ No newline at end of file From 621fcb598e3f275da81a04817d843399d4588f85 Mon Sep 17 00:00:00 2001 From: geeksville Date: Mon, 14 Sep 2020 09:25:14 -0700 Subject: [PATCH 4/9] Declare 1.0 --- docs/README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/README.md b/docs/README.md index 270d89633..6c73c0e24 100644 --- a/docs/README.md +++ b/docs/README.md @@ -43,6 +43,7 @@ For an detailed walk-through aimed at beginners, we recommend [meshtastic.letsta Note: Updates are happening almost daily, only major updates are listed below. For more details see our forum. +- 09/14/2020 - 1.0.0 Now with over 1700 android users, over 2000 nodes and translated into 15 languages. This project will always be a "beta" experiment, but now quite usable. We are currently selecting 1.1 features in our discussion 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. @@ -77,13 +78,14 @@ Make sure to buy the frequency range which is legal for your country. For the US Instructions for installing prebuilt firmware can be found [here](https://github.com/meshtastic/Meshtastic-esp32/blob/master/README.md). For a nice looking cases: - - 3D printable cases - 1. TTGO T-Beam V0 see this [design](https://www.thingiverse.com/thing:3773717) by [bsiege](https://www.thingiverse.com/bsiege). - 2. TTGO T_Beam V1 (SMA) see this [design](https://www.thingiverse.com/thing:3830711) by [rwanrooy](https://www.thingiverse.com/rwanrooy) or this [remix](https://www.thingiverse.com/thing:3949330) by [8ung](https://www.thingiverse.com/8ung) - 3. TTGO T_Beam V1 (IPEX) see this [design](https://www.thingiverse.com/thing:4587297) by [drewsed](https://www.thingiverse.com/drewsed) - 4. Heltec Lora32 see this [design](https://www.thingiverse.com/thing:3125854) by [ornotermes](https://www.thingiverse.com/ornotermes). - - Laser-cut cases - 1. TTGO T_Beam V1 (SMA) see this [design](https://www.thingiverse.com/thing:4552771) by [jefish](https://www.thingiverse.com/jefish) + +- 3D printable cases + 1. TTGO T-Beam V0 see this [design](https://www.thingiverse.com/thing:3773717) by [bsiege](https://www.thingiverse.com/bsiege). + 2. TTGO T_Beam V1 (SMA) see this [design](https://www.thingiverse.com/thing:3830711) by [rwanrooy](https://www.thingiverse.com/rwanrooy) or this [remix](https://www.thingiverse.com/thing:3949330) by [8ung](https://www.thingiverse.com/8ung) + 3. TTGO T_Beam V1 (IPEX) see this [design](https://www.thingiverse.com/thing:4587297) by [drewsed](https://www.thingiverse.com/drewsed) + 4. Heltec Lora32 see this [design](https://www.thingiverse.com/thing:3125854) by [ornotermes](https://www.thingiverse.com/ornotermes). +- Laser-cut cases + 1. TTGO T_Beam V1 (SMA) see this [design](https://www.thingiverse.com/thing:4552771) by [jefish](https://www.thingiverse.com/jefish) # IMPORTANT DISCLAIMERS AND FAQ From 313cee9a3f78db9d998ed90d14b21fb815e0490c Mon Sep 17 00:00:00 2001 From: geeksville Date: Tue, 15 Sep 2020 17:54:55 -0700 Subject: [PATCH 5/9] update webpage --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 6c73c0e24..f2fd6b578 100644 --- a/docs/README.md +++ b/docs/README.md @@ -44,7 +44,7 @@ For an detailed walk-through aimed at beginners, we recommend [meshtastic.letsta Note: Updates are happening almost daily, only major updates are listed below. For more details see our forum. - 09/14/2020 - 1.0.0 Now with over 1700 android users, over 2000 nodes and translated into 15 languages. This project will always be a "beta" experiment, but now quite usable. We are currently selecting 1.1 features in our discussion 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/24/2020 - 0.7.x Now with over 1000 android users, over 600 people using the radios and translated into 22 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. From 31fc8fafecb66b41004107387897e878da391455 Mon Sep 17 00:00:00 2001 From: geeksville Date: Tue, 15 Sep 2020 17:55:33 -0700 Subject: [PATCH 6/9] make default power level radio chipset specific --- src/mesh/RF95Interface.cpp | 6 ++++++ src/mesh/RadioInterface.cpp | 4 ---- src/mesh/SX1262Interface.cpp | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp index 194765821..3e19404bf 100644 --- a/src/mesh/RF95Interface.cpp +++ b/src/mesh/RF95Interface.cpp @@ -6,6 +6,8 @@ #define MAX_POWER 17 // if we use 20 we are limited to 1% duty cycle or hw might overheat. For continuous operation set a limit of 17 +#define POWER_DEFAULT 17 // How much power to use if the user hasn't set a power level + RF95Interface::RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, SPIClass &spi) : RadioLibInterface(cs, irq, rst, 0, spi) { @@ -32,6 +34,10 @@ bool RF95Interface::init() RadioLibInterface::init(); applyModemConfig(); + + if (power == 0) + power = POWER_DEFAULT; + if (power > MAX_POWER) // This chip has lower power limits than some power = MAX_POWER; diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 45a9fed75..0cdd4da68 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -118,8 +118,6 @@ unsigned long hash(char *str) return hash; } -#define POWER_DEFAULT 17 - /** * Pull our channel settings etc... from protobufs to the dumb interface settings */ @@ -129,8 +127,6 @@ void RadioInterface::applyModemConfig() // No Sync Words in LORA mode power = channelSettings.tx_power; - if (power == 0) - power = POWER_DEFAULT; // If user has manually specified a channel num, then use that, otherwise generate one by hashing the name int channel_num = (channelSettings.channel_num ? channelSettings.channel_num - 1 : hash(channelSettings.name)) % NUM_CHANNELS; diff --git a/src/mesh/SX1262Interface.cpp b/src/mesh/SX1262Interface.cpp index f581cdb1c..75a84034d 100644 --- a/src/mesh/SX1262Interface.cpp +++ b/src/mesh/SX1262Interface.cpp @@ -37,6 +37,10 @@ bool SX1262Interface::init() bool useRegulatorLDO = false; // Seems to depend on the connection to pin 9/DCC_SW - if an inductor DCDC? applyModemConfig(); + + if (power == 0) + power = 22; + if (power > 22) // This chip has lower power limits than some power = 22; int res = lora.begin(freq, bw, sf, cr, syncWord, power, currentLimit, preambleLength, tcxoVoltage, useRegulatorLDO); From 7d4058f49dadec6f135a8534d550d68ee862159b Mon Sep 17 00:00:00 2001 From: geeksville Date: Tue, 15 Sep 2020 18:00:21 -0700 Subject: [PATCH 7/9] let users set 20 dBm if they wish --- src/mesh/RF95Interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp index 3e19404bf..3d03e403b 100644 --- a/src/mesh/RF95Interface.cpp +++ b/src/mesh/RF95Interface.cpp @@ -3,7 +3,7 @@ #include "RadioLibRF95.h" #include -#define MAX_POWER 17 +#define MAX_POWER 20 // if we use 20 we are limited to 1% duty cycle or hw might overheat. For continuous operation set a limit of 17 #define POWER_DEFAULT 17 // How much power to use if the user hasn't set a power level From c6d93d1a28518e06eeef7cd33ca69975a132cce3 Mon Sep 17 00:00:00 2001 From: geeksville Date: Tue, 15 Sep 2020 18:54:50 -0700 Subject: [PATCH 8/9] fix #346 limit tx power in japan --- src/mesh/RF95Interface.cpp | 2 ++ src/mesh/RadioInterface.cpp | 19 +++++++++++++++++++ src/mesh/RadioInterface.h | 6 ++++++ src/mesh/SX1262Interface.cpp | 3 +++ 4 files changed, 30 insertions(+) diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp index 3d03e403b..594cec91f 100644 --- a/src/mesh/RF95Interface.cpp +++ b/src/mesh/RF95Interface.cpp @@ -41,6 +41,8 @@ bool RF95Interface::init() if (power > MAX_POWER) // This chip has lower power limits than some power = MAX_POWER; + limitPower(); + iface = lora = new RadioLibRF95(&module); #ifdef RF95_TCXO diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 0cdd4da68..4d43d22ff 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -136,6 +136,25 @@ void RadioInterface::applyModemConfig() power); } +/** + * Some regulatory regions limit xmit power. + * This function should be called by subclasses after setting their desired power. It might lower it + */ +void RadioInterface::limitPower() +{ + uint8_t maxPower = 255; // No limit + +#ifdef HW_VERSION_JP + maxPower = 13; // See https://github.com/meshtastic/Meshtastic-device/issues/346 +#endif + if (power > maxPower) { + DEBUG_MSG("Lowering transmit power because of regulatory limits\n"); + power = maxPower; + } + + DEBUG_MSG("Set radio: final power level=%d\n", power); +} + ErrorCode SimRadio::send(MeshPacket *p) { DEBUG_MSG("SimRadio.send\n"); diff --git a/src/mesh/RadioInterface.h b/src/mesh/RadioInterface.h index b8cba208d..645ee5c05 100644 --- a/src/mesh/RadioInterface.h +++ b/src/mesh/RadioInterface.h @@ -119,6 +119,12 @@ class RadioInterface : protected concurrency::NotifiedWorkerThread virtual void loop() {} // Idle processing + /** + * Some regulatory regions limit xmit power. + * This function should be called by subclasses after setting their desired power. It might lower it + */ + void limitPower(); + /** * Convert our modemConfig enum into wf, sf, etc... * diff --git a/src/mesh/SX1262Interface.cpp b/src/mesh/SX1262Interface.cpp index 75a84034d..130f340c3 100644 --- a/src/mesh/SX1262Interface.cpp +++ b/src/mesh/SX1262Interface.cpp @@ -43,6 +43,9 @@ bool SX1262Interface::init() if (power > 22) // This chip has lower power limits than some power = 22; + + limitPower(); + int res = lora.begin(freq, bw, sf, cr, syncWord, power, currentLimit, preambleLength, tcxoVoltage, useRegulatorLDO); DEBUG_MSG("SX1262 init result %d\n", res); From 435c955acd7b4472f895d6401b57aac7b9c554a2 Mon Sep 17 00:00:00 2001 From: geeksville Date: Tue, 15 Sep 2020 21:05:57 -0700 Subject: [PATCH 9/9] make hash prototype a bit stricter --- src/mesh/RadioInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 4d43d22ff..ae4ef4219 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -107,7 +107,7 @@ bool RadioInterface::init() * djb2 by Dan Bernstein. * http://www.cse.yorku.ca/~oz/hash.html */ -unsigned long hash(char *str) +unsigned long hash(const char *str) { unsigned long hash = 5381; int c;