From 0a9f7147f3b9b313f8a6ecb41e9832891f0ead47 Mon Sep 17 00:00:00 2001 From: geeksville Date: Tue, 8 Sep 2020 10:25:37 -0700 Subject: [PATCH 01/16] probably fix #341 enable internal pullup on lora-v2 button --- src/configuration.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/configuration.h b/src/configuration.h index 50e16e6a..e70f1fda 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -255,6 +255,7 @@ along with this program. If not, see . // #define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost #define LED_PIN 2 // If defined we will blink this LED #define BUTTON_PIN 0 // If defined, this will be used for user button presses +#define BUTTON_NEED_PULLUP #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module @@ -281,6 +282,7 @@ along with this program. If not, see . #define BUTTON_PIN \ 0 // If defined, this will be used for user button presses, if your board doesn't have a physical switch, you can wire one // between this pin and ground +#define BUTTON_NEED_PULLUP #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module From c0073025649fb586ae28ea48c8fd903558f661a5 Mon Sep 17 00:00:00 2001 From: geeksville Date: Tue, 8 Sep 2020 10:28:53 -0700 Subject: [PATCH 02/16] fix #363 gps altitude - based on tip by @a-f-G-U-C --- src/gps/UBloxGPS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gps/UBloxGPS.cpp b/src/gps/UBloxGPS.cpp index 80d7064b..36203964 100644 --- a/src/gps/UBloxGPS.cpp +++ b/src/gps/UBloxGPS.cpp @@ -165,7 +165,7 @@ void UBloxGPS::doTask() latitude = ublox.getLatitude(0); longitude = ublox.getLongitude(0); - altitude = ublox.getAltitude(0) / 1000; // in mm convert to meters + altitude = ublox.getAltitudeMSL(0) / 1000; // in mm convert to meters dop = ublox.getPDOP(0); // PDOP (an accuracy metric) is reported in 10^2 units so we have to scale down when we use it heading = ublox.getHeading(0); numSatellites = ublox.getSIV(0); From 48256d6e9eaa234ad921cb7696072a9e922f8fba Mon Sep 17 00:00:00 2001 From: Garret Kelly Date: Tue, 8 Sep 2020 15:22:49 -0400 Subject: [PATCH 03/16] Fix compilation without a BUTTON_PIN definition --- src/sleep.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sleep.cpp b/src/sleep.cpp index 3bce7266..886886b5 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -284,8 +284,10 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r assert(esp_light_sleep_start() == ESP_OK); esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause(); +#ifdef BUTTON_PIN if (cause == ESP_SLEEP_WAKEUP_GPIO) DEBUG_MSG("Exit light sleep gpio: btn=%d\n", !digitalRead(BUTTON_PIN)); +#endif return cause; } From 076f8bd77bf6a122230c1efae9676cc89395f08e Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 9 Sep 2020 14:15:43 -0700 Subject: [PATCH 04/16] fix #370 by pulling in my bugfix to ESP32-Nimble --- platformio.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index 72ae1af9..4329d037 100644 --- a/platformio.ini +++ b/platformio.ini @@ -85,8 +85,8 @@ build_flags = # board_build.ldscript = linker/esp32.extram.bss.ld lib_ignore = segger_rtt platform_packages = - framework-arduinoespressif32 @ https://github.com/meshtastic/arduino-esp32.git#1adba3f11ca8406ac0a704d151697b572058b53d - + framework-arduinoespressif32 @ https://github.com/meshtastic/arduino-esp32.git#2814f110aa618429bdd9a0a2d6a93c55f29f87a6 + ; not needed included in ttgo-t-beam board file ; also to use PSRAM https://docs.platformio.org/en/latest/platforms/espressif32.html#external-ram-psram ; -DBOARD_HAS_PSRAM From ee27c15c2c085f1dbe327f0140d45fd15ad5c36a Mon Sep 17 00:00:00 2001 From: geeksville Date: Thu, 10 Sep 2020 09:24:48 -0700 Subject: [PATCH 05/16] likely fix for bug #373. fix #339. great gps fixes from @a-f-G-U-C fixes described in bug #376 --- proto | 2 +- src/gps/UBloxGPS.cpp | 16 ++++++++++------ src/mesh/mesh.pb.h | 4 ++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/proto b/proto index 3caee2e5..ce422b7c 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 3caee2e5b92d4429c6cf47a4c88d4615001f300b +Subproject commit ce422b7c448906c6fee3eef64bbd41adfbc990f0 diff --git a/src/gps/UBloxGPS.cpp b/src/gps/UBloxGPS.cpp index 36203964..624ab77b 100644 --- a/src/gps/UBloxGPS.cpp +++ b/src/gps/UBloxGPS.cpp @@ -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"); @@ -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; @@ -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) diff --git a/src/mesh/mesh.pb.h b/src/mesh/mesh.pb.h index 27ff63f9..64b2758c 100644 --- a/src/mesh/mesh.pb.h +++ b/src/mesh/mesh.pb.h @@ -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 @@ -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 From de7b9877f9e8c50920d2b85b633f59206dd7d55b Mon Sep 17 00:00:00 2001 From: geeksville Date: Thu, 10 Sep 2020 09:51:53 -0700 Subject: [PATCH 06/16] remove auto-inserted whitespace that might confuse platformio --- platformio.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 4329d037..1069f8e0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -85,8 +85,8 @@ build_flags = # board_build.ldscript = linker/esp32.extram.bss.ld lib_ignore = segger_rtt platform_packages = - framework-arduinoespressif32 @ https://github.com/meshtastic/arduino-esp32.git#2814f110aa618429bdd9a0a2d6a93c55f29f87a6 - + framework-arduinoespressif32@https://github.com/meshtastic/arduino-esp32.git#2814f110aa618429bdd9a0a2d6a93c55f29f87a6 + ; not needed included in ttgo-t-beam board file ; also to use PSRAM https://docs.platformio.org/en/latest/platforms/espressif32.html#external-ram-psram ; -DBOARD_HAS_PSRAM @@ -94,7 +94,7 @@ platform_packages = ; -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG -; The 1.0 release of the TBEAM board +; The 1.0 release of the TBEAM board [env:tbeam] extends = esp32_base board = ttgo-t-beam From 8ca6bbfb786ce936dfecbddca842cc8a4c13190e Mon Sep 17 00:00:00 2001 From: geeksville Date: Fri, 11 Sep 2020 13:30:44 -0700 Subject: [PATCH 07/16] 0.9.6 --- bin/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/version.sh b/bin/version.sh index 388402b6..b71c5d64 100644 --- a/bin/version.sh +++ b/bin/version.sh @@ -1,3 +1,3 @@ -export VERSION=0.9.5 \ No newline at end of file +export VERSION=0.9.6 \ No newline at end of file From b6f71ca1db40c7c4854d697b6a4e8cf47e143534 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Fri, 11 Sep 2020 22:17:45 -0700 Subject: [PATCH 08/16] 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 ff320436..5229f566 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 09/16] 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 b71c5d64..dd1d3499 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 10/16] 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 dd1d3499..02a3c9d6 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 11/16] 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 270d8963..6c73c0e2 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 12/16] update webpage --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 6c73c0e2..f2fd6b57 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 13/16] 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 19476582..3e19404b 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 45a9fed7..0cdd4da6 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 f581cdb1..75a84034 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 14/16] 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 3e19404b..3d03e403 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 15/16] 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 3d03e403..594cec91 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 0cdd4da6..4d43d22f 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 b8cba208..645ee5c0 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 75a84034..130f340c 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 16/16] 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 4d43d22f..ae4ef421 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;