diff --git a/.github/workflows/build_raspbian_armv7l.yml b/.github/workflows/build_raspbian_armv7l.yml index 39b297d1b..f7fddd038 100644 --- a/.github/workflows/build_raspbian_armv7l.yml +++ b/.github/workflows/build_raspbian_armv7l.yml @@ -13,8 +13,8 @@ jobs: - name: Install libbluetooth shell: bash run: | - apt-get update -y --fix-missing - apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev + sudo apt-get update -y --fix-missing + sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/package_amd64.yml b/.github/workflows/package_amd64.yml index a5442246a..4f6636712 100644 --- a/.github/workflows/package_amd64.yml +++ b/.github/workflows/package_amd64.yml @@ -54,6 +54,10 @@ jobs: mkdir -p .debpkg/etc/meshtasticd/available.d mkdir -p .debpkg/usr/lib/systemd/system/ tar -xf build.tar -C .debpkg/usr/share/doc/meshtasticd/web + shopt -s dotglob nullglob + if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi + if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi + if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz cp release/meshtasticd_linux_x86_64 .debpkg/usr/sbin/meshtasticd cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml diff --git a/.github/workflows/package_raspbian.yml b/.github/workflows/package_raspbian.yml index 89efba1de..d9b12d6da 100644 --- a/.github/workflows/package_raspbian.yml +++ b/.github/workflows/package_raspbian.yml @@ -54,6 +54,10 @@ jobs: mkdir -p .debpkg/etc/meshtasticd/available.d mkdir -p .debpkg/usr/lib/systemd/system/ tar -xf build.tar -C .debpkg/usr/share/doc/meshtasticd/web + shopt -s dotglob nullglob + if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi + if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi + if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz cp release/meshtasticd_linux_aarch64 .debpkg/usr/sbin/meshtasticd cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml diff --git a/.github/workflows/package_raspbian_armv7l.yml b/.github/workflows/package_raspbian_armv7l.yml index 5cbc27097..e19df9d17 100644 --- a/.github/workflows/package_raspbian_armv7l.yml +++ b/.github/workflows/package_raspbian_armv7l.yml @@ -54,6 +54,10 @@ jobs: mkdir -p .debpkg/etc/meshtasticd/available.d mkdir -p .debpkg/usr/lib/systemd/system/ tar -xf build.tar -C .debpkg/usr/share/doc/meshtasticd/web + shopt -s dotglob nullglob + if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi + if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi + if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz cp release/meshtasticd_linux_armv7l .debpkg/usr/sbin/meshtasticd cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 382975e9f..1f17bc691 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -43,6 +43,7 @@ lib_deps = ${arduino_base.lib_deps} ${networking_base.lib_deps} ${environmental_base.lib_deps} + ${radiolib_base.lib_deps} https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2 h2zero/NimBLE-Arduino@^1.4.2 https://github.com/dbSuS/libpax.git#7bcd3fcab75037505be9b122ab2b24cc5176b587 diff --git a/arch/esp32/esp32c6.ini b/arch/esp32/esp32c6.ini index 53d7f92ec..3f8b1bdbe 100644 --- a/arch/esp32/esp32c6.ini +++ b/arch/esp32/esp32c6.ini @@ -23,6 +23,7 @@ lib_deps = ${arduino_base.lib_deps} ${networking_base.lib_deps} ${environmental_base.lib_deps} + ${radiolib_base.lib_deps} lewisxhe/XPowersLib@^0.2.6 https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f rweather/Crypto@^0.4.0 diff --git a/arch/nrf52/nrf52.ini b/arch/nrf52/nrf52.ini index c5b3ea71b..5fba503f3 100644 --- a/arch/nrf52/nrf52.ini +++ b/arch/nrf52/nrf52.ini @@ -14,12 +14,14 @@ build_flags = -Wno-unused-variable -Isrc/platform/nrf52 -DLFS_NO_ASSERT ; Disable LFS assertions , see https://github.com/meshtastic/firmware/pull/3818 + -DMESHTASTIC_EXCLUDE_AUDIO=1 build_src_filter = ${arduino_base.build_src_filter} - - - - - - - - - - lib_deps= ${arduino_base.lib_deps} + ${radiolib_base.lib_deps} rweather/Crypto@^0.4.0 lib_ignore = diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 39d1c0b8c..04fd6db09 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -23,6 +23,7 @@ build_src_filter = lib_deps = ${env.lib_deps} ${networking_base.lib_deps} + ${radiolib_base.lib_deps} rweather/Crypto@^0.4.0 https://github.com/lovyan03/LovyanGFX.git#1401c28a47646fe00538d487adcb2eb3c72de805 diff --git a/arch/rp2xx0/rp2040.ini b/arch/rp2xx0/rp2040.ini index 62b4ac30c..d7db47250 100644 --- a/arch/rp2xx0/rp2040.ini +++ b/arch/rp2xx0/rp2040.ini @@ -23,4 +23,5 @@ lib_ignore = lib_deps = ${arduino_base.lib_deps} ${environmental_base.lib_deps} + ${radiolib_base.lib_deps} rweather/Crypto \ No newline at end of file diff --git a/arch/rp2xx0/rp2350.ini b/arch/rp2xx0/rp2350.ini index 7ef6332e3..33bb36ad1 100644 --- a/arch/rp2xx0/rp2350.ini +++ b/arch/rp2xx0/rp2350.ini @@ -21,4 +21,5 @@ lib_ignore = lib_deps = ${arduino_base.lib_deps} ${environmental_base.lib_deps} + ${radiolib_base.lib_deps} rweather/Crypto diff --git a/arch/stm32/stm32.ini b/arch/stm32/stm32.ini index 715e8aa73..7e211496d 100644 --- a/arch/stm32/stm32.ini +++ b/arch/stm32/stm32.ini @@ -30,8 +30,9 @@ upload_protocol = stlink lib_deps = ${env.lib_deps} charlesbaynham/OSFS@^1.2.3 + jgromes/RadioLib@7.0.2 https://github.com/caveman99/Crypto.git#f61ae26a53f7a2d0ba5511625b8bf8eff3a35d5e lib_ignore = - mathertel/OneButton@~2.6.1 + mathertel/OneButton@2.6.1 Wire \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 2e3ee56f9..f7c73c190 100644 --- a/platformio.ini +++ b/platformio.ini @@ -29,7 +29,7 @@ default_envs = tbeam ;default_envs = rak4631 ;default_envs = rak4631_eth_gw ;default_envs = rak2560 -;default_envs = rak10701 +;default_envs = rak_wismeshtap ;default_envs = wio-e5 ;default_envs = radiomaster_900_bandit_nano ;default_envs = radiomaster_900_bandit_micro @@ -39,128 +39,130 @@ default_envs = tbeam ;default_envs = heltec_vision_master_e213 ;default_envs = heltec_vision_master_e290 ;default_envs = heltec_mesh_node_t114 - extra_configs = - arch/*/*.ini - variants/*/platformio.ini + arch/*/*.ini + variants/*/platformio.ini +description = Meshtastic [env] test_build_src = true extra_scripts = bin/platformio-custom.py - ; note: we add src to our include search path so that lmic_project_config can override ; note: TINYGPS_OPTION_NO_CUSTOM_FIELDS is VERY important. We don't use custom fields and somewhere in that pile ; of code is a heap corruption bug! ; FIXME: fix lib/BluetoothOTA dependency back on src/ so we can remove -Isrc ; The Radiolib stuff will speed up building considerably. Exclud all the stuff we dont need. build_flags = -Wno-missing-field-initializers - -Wno-format - -Isrc -Isrc/mesh -Isrc/mesh/generated -Isrc/gps -Isrc/buzz -Wl,-Map,.pio/build/output.map - -DUSE_THREAD_NAMES - -DTINYGPS_OPTION_NO_CUSTOM_FIELDS - -DPB_ENABLE_MALLOC=1 - -DRADIOLIB_EXCLUDE_CC1101=1 - -DRADIOLIB_EXCLUDE_NRF24=1 - -DRADIOLIB_EXCLUDE_RF69=1 - -DRADIOLIB_EXCLUDE_SX1231=1 - -DRADIOLIB_EXCLUDE_SX1233=1 - -DRADIOLIB_EXCLUDE_SI443X=1 - -DRADIOLIB_EXCLUDE_RFM2X=1 - -DRADIOLIB_EXCLUDE_AFSK=1 - -DRADIOLIB_EXCLUDE_BELL=1 - -DRADIOLIB_EXCLUDE_HELLSCHREIBER=1 - -DRADIOLIB_EXCLUDE_MORSE=1 - -DRADIOLIB_EXCLUDE_RTTY=1 - -DRADIOLIB_EXCLUDE_SSTV=1 - -DRADIOLIB_EXCLUDE_AX25=1 - -DRADIOLIB_EXCLUDE_DIRECT_RECEIVE=1 - -DRADIOLIB_EXCLUDE_BELL=1 - -DRADIOLIB_EXCLUDE_PAGER=1 - -DRADIOLIB_EXCLUDE_FSK4=1 - -DRADIOLIB_EXCLUDE_APRS=1 - -DRADIOLIB_EXCLUDE_LORAWAN=1 - -DMESHTASTIC_EXCLUDE_DROPZONE=1 - -DMESHTASTIC_EXCLUDE_REMOTEHARDWARE=1 - #-DBUILD_EPOCH=$UNIX_TIME - ;-D OLED_PL + + -Wno-format + -Isrc -Isrc/mesh -Isrc/mesh/generated -Isrc/gps -Isrc/buzz -Wl,-Map,.pio/build/output.map + -DUSE_THREAD_NAMES + -DTINYGPS_OPTION_NO_CUSTOM_FIELDS + -DPB_ENABLE_MALLOC=1 + -DRADIOLIB_EXCLUDE_CC1101=1 + -DRADIOLIB_EXCLUDE_NRF24=1 + -DRADIOLIB_EXCLUDE_RF69=1 + -DRADIOLIB_EXCLUDE_SX1231=1 + -DRADIOLIB_EXCLUDE_SX1233=1 + -DRADIOLIB_EXCLUDE_SI443X=1 + -DRADIOLIB_EXCLUDE_RFM2X=1 + -DRADIOLIB_EXCLUDE_AFSK=1 + -DRADIOLIB_EXCLUDE_BELL=1 + -DRADIOLIB_EXCLUDE_HELLSCHREIBER=1 + -DRADIOLIB_EXCLUDE_MORSE=1 + -DRADIOLIB_EXCLUDE_RTTY=1 + -DRADIOLIB_EXCLUDE_SSTV=1 + -DRADIOLIB_EXCLUDE_AX25=1 + -DRADIOLIB_EXCLUDE_DIRECT_RECEIVE=1 + -DRADIOLIB_EXCLUDE_BELL=1 + -DRADIOLIB_EXCLUDE_PAGER=1 + -DRADIOLIB_EXCLUDE_FSK4=1 + -DRADIOLIB_EXCLUDE_APRS=1 + -DRADIOLIB_EXCLUDE_LORAWAN=1 + -DMESHTASTIC_EXCLUDE_DROPZONE=1 + -DMESHTASTIC_EXCLUDE_REMOTEHARDWARE=1 + -DMESHTASTIC_EXCLUDE_POWERSTRESS=1 ; exclude power stress test module from main firmware + #-DBUILD_EPOCH=$UNIX_TIME + ;-D OLED_PL monitor_speed = 115200 monitor_filters = direct - lib_deps = - jgromes/RadioLib@~7.0.2 - https://github.com/meshtastic/esp8266-oled-ssd1306.git#e16cee124fe26490cb14880c679321ad8ac89c95 ; ESP8266_SSD1306 - mathertel/OneButton@~2.6.1 ; OneButton library for non-blocking button debounce - https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159 - https://github.com/meshtastic/TinyGPSPlus.git#71a82db35f3b973440044c476d4bcdc673b104f4 - https://github.com/meshtastic/ArduinoThread.git#1ae8778c85d0a2a729f989e0b1e7d7c4dc84eef0 - nanopb/Nanopb@^0.4.9 - erriez/ErriezCRC32@^1.0.1 - + https://github.com/meshtastic/esp8266-oled-ssd1306.git#e16cee124fe26490cb14880c679321ad8ac89c95 + mathertel/OneButton@2.6.1 + https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159 + https://github.com/meshtastic/TinyGPSPlus.git#71a82db35f3b973440044c476d4bcdc673b104f4 + https://github.com/meshtastic/ArduinoThread.git#1ae8778c85d0a2a729f989e0b1e7d7c4dc84eef0 + nanopb/Nanopb@0.4.9 + erriez/ErriezCRC32@1.0.1 + ; Used for the code analysis in PIO Home / Inspect check_tool = cppcheck check_skip_packages = yes check_flags = - -DAPP_VERSION=1.0.0 - --suppressions-list=suppressions.txt - --inline-suppr + -DAPP_VERSION=1.0.0 + --suppressions-list=suppressions.txt + --inline-suppr ; Common settings for conventional (non Portduino) Arduino targets [arduino_base] framework = arduino lib_deps = - ${env.lib_deps} - end2endzone/NonBlockingRTTTL@^1.3.0 - https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#5cf62b36c6f30bc72a07bdb2c11fc9a22d1e31da - + ${env.lib_deps} + end2endzone/NonBlockingRTTTL@1.3.0 + https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#5cf62b36c6f30bc72a07bdb2c11fc9a22d1e31da build_flags = ${env.build_flags} -Os build_src_filter = ${env.build_src_filter} - ; Common libs for communicating over TCP/IP networks such as MQTT [networking_base] lib_deps = - knolleary/PubSubClient@^2.8 - arduino-libraries/NTPClient@^3.1.0 - arcao/Syslog@^2.0.0 + knolleary/PubSubClient@2.8 + arduino-libraries/NTPClient@3.1.0 + arcao/Syslog@2.0.0 + +[radiolib_base] +lib_deps = + jgromes/RadioLib@7.1.0 ; Common libs for environmental measurements in telemetry module ; (not included in native / portduino) [environmental_base] lib_deps = - adafruit/Adafruit BusIO@^1.16.1 - adafruit/Adafruit Unified Sensor@^1.1.11 - adafruit/Adafruit BMP280 Library@^2.6.8 - adafruit/Adafruit BMP085 Library@^1.2.4 - adafruit/Adafruit BME280 Library@^2.2.2 - adafruit/Adafruit BMP3XX Library@^2.1.5 - adafruit/Adafruit MCP9808 Library@^2.0.0 - adafruit/Adafruit INA260 Library@^1.5.0 - adafruit/Adafruit INA219@^1.2.0 - adafruit/Adafruit MAX1704X@^1.0.3 - adafruit/Adafruit SHTC3 Library@^1.0.0 - adafruit/Adafruit LPS2X@^2.0.4 - adafruit/Adafruit SHT31 Library@^2.2.2 - adafruit/Adafruit PM25 AQI Sensor@^1.1.1 - adafruit/Adafruit MPU6050@^2.2.4 - adafruit/Adafruit LIS3DH@^1.3.0 - adafruit/Adafruit AHTX0@^2.0.5 - adafruit/Adafruit LSM6DS@^4.7.2 - adafruit/Adafruit VEML7700 Library@^2.1.6 - adafruit/Adafruit SHT4x Library@^1.0.4 - adafruit/Adafruit TSL2591 Library@^1.4.5 - sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@^1.0.5 - sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@^1.2.13 - ClosedCube OPT3001@^1.1.2 - emotibit/EmotiBit MLX90632@^1.0.8 - dfrobot/DFRobot_RTU@^1.0.3 - sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@^1.1.2 - adafruit/Adafruit MLX90614 Library@^2.1.5 + adafruit/Adafruit BusIO@1.16.2 + adafruit/Adafruit Unified Sensor@1.1.14 + adafruit/Adafruit BMP280 Library@2.6.8 + adafruit/Adafruit BMP085 Library@1.2.4 + adafruit/Adafruit BME280 Library@2.2.4 + adafruit/Adafruit BMP3XX Library@2.1.5 + adafruit/Adafruit MCP9808 Library@2.0.2 + adafruit/Adafruit INA260 Library@1.5.2 + adafruit/Adafruit INA219@1.2.3 + adafruit/Adafruit MAX1704X@1.0.3 + adafruit/Adafruit SHTC3 Library@1.0.1 + adafruit/Adafruit LPS2X@2.0.6 + adafruit/Adafruit SHT31 Library@2.2.2 + adafruit/Adafruit PM25 AQI Sensor@1.1.1 + adafruit/Adafruit MPU6050@2.2.6 + adafruit/Adafruit LIS3DH@1.3.0 + adafruit/Adafruit AHTX0@2.0.5 + adafruit/Adafruit LSM6DS@4.7.3 + adafruit/Adafruit VEML7700 Library@2.1.6 + adafruit/Adafruit SHT4x Library@1.0.5 + adafruit/Adafruit TSL2591 Library@1.4.5 + sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6 + sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.2.13 + ClosedCube OPT3001@1.1.2 + emotibit/EmotiBit MLX90632@1.0.8 + dfrobot/DFRobot_RTU@1.0.3 + sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@1.1.2 + adafruit/Adafruit MLX90614 Library@2.1.5 - https://github.com/boschsensortec/Bosch-BSEC2-Library#v1.7.2502 - boschsensortec/BME68x Sensor Library@^1.1.40407 - https://github.com/KodinLanewave/INA3221@^1.0.1 - lewisxhe/SensorLib@0.2.0 - mprograms/QMC5883LCompass@^1.2.0 - - https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d - https://github.com/gjelsoe/STK8xxx-Accelerometer.git#v0.1.1 + https://github.com/boschsensortec/Bosch-BSEC2-Library#v1.7.2502 + boschsensortec/BME68x Sensor Library@1.1.40407 + https://github.com/KodinLanewave/INA3221@1.0.1 + lewisxhe/SensorLib@0.2.0 + mprograms/QMC5883LCompass@1.2.3 + + https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d + https://github.com/gjelsoe/STK8xxx-Accelerometer.git#v0.1.1 diff --git a/protobufs b/protobufs index 834915aa0..04f21f5c7 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 834915aa046532da0bd8478c250eb33847e9518f +Subproject commit 04f21f5c7238b8e02f794d9282c4786752634b3c diff --git a/src/input/TouchScreenBase.cpp b/src/input/TouchScreenBase.cpp index 03618b338..a63203362 100644 --- a/src/input/TouchScreenBase.cpp +++ b/src/input/TouchScreenBase.cpp @@ -1,6 +1,10 @@ #include "TouchScreenBase.h" #include "main.h" +#if defined(RAK14014) && !defined(MESHTASTIC_EXCLUDE_CANNEDMESSAGES) +#include "modules/CannedMessageModule.h" +#endif + #ifndef TIME_LONG_PRESS #define TIME_LONG_PRESS 400 #endif @@ -102,12 +106,30 @@ int32_t TouchScreenBase::runOnce() } _touchedOld = touched; +#if defined RAK14014 + // Speed up the processing speed of the keyboard in virtual keyboard mode + auto state = cannedMessageModule->getRunState(); + if (state == CANNED_MESSAGE_RUN_STATE_FREETEXT) { + if (_tapped) { + _tapped = false; + e.touchEvent = static_cast(TOUCH_ACTION_TAP); + LOG_DEBUG("action TAP(%d/%d)\n", _last_x, _last_y); + } + } else { + if (_tapped && (time_t(millis()) - _start) > TIME_LONG_PRESS - 50) { + _tapped = false; + e.touchEvent = static_cast(TOUCH_ACTION_TAP); + LOG_DEBUG("action TAP(%d/%d)\n", _last_x, _last_y); + } + } +#else // fire TAP event when no 2nd tap occured within time if (_tapped && (time_t(millis()) - _start) > TIME_LONG_PRESS - 50) { _tapped = false; e.touchEvent = static_cast(TOUCH_ACTION_TAP); LOG_DEBUG("action TAP(%d/%d)", _last_x, _last_y); } +#endif // fire LONG_PRESS event without the need for release if (touched && (time_t(millis()) - _start) > TIME_LONG_PRESS) { diff --git a/src/main.cpp b/src/main.cpp index 0d4e9d021..35c7974af 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1269,6 +1269,31 @@ extern meshtastic_DeviceMetadata getDeviceMetadata() deviceMetadata.hw_model = HW_VENDOR; deviceMetadata.hasRemoteHardware = moduleConfig.remote_hardware.enabled; deviceMetadata.excluded_modules = meshtastic_ExcludedModules_EXCLUDED_NONE; +#if MESHTASTIC_EXCLUDE_REMOTEHARDWARE + deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_REMOTEHARDWARE_CONFIG; +#endif +#if MESHTASTIC_EXCLUDE_AUDIO + deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_AUDIO_CONFIG; +#endif +#if !HAS_SCREEN || NO_EXT_GPIO + deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_CANNEDMSG_CONFIG | meshtastic_ExcludedModules_EXTNOTIF_CONFIG; +#endif +// Only edge case here is if we apply this a device with built in Accelerometer and want to detect interrupts +// We'll have to macro guard against those targets potentially +#if NO_EXT_GPIO + deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_DETECTIONSENSOR_CONFIG; +#endif +// If we don't have any GPIO and we don't have GPS, no purpose in having serial config +#if NO_EXT_GPIO && NO_GPS + deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_SERIAL_CONFIG; +#endif +#ifndef ARCH_ESP32 + deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_PAXCOUNTER_CONFIG; +#endif +#if !defined(HAS_NCP5623) && !defined(RGBLED_RED) && !defined(HAS_NEOPIXEL) && !defined(UNPHONE) && !RAK_4631 + deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_AMBIENTLIGHTING_CONFIG; +#endif + #if !(MESHTASTIC_EXCLUDE_PKI) deviceMetadata.hasPKC = true; #endif diff --git a/src/mesh/Default.h b/src/mesh/Default.h index 7a7507c84..d39886d1c 100644 --- a/src/mesh/Default.h +++ b/src/mesh/Default.h @@ -19,7 +19,7 @@ #define default_node_info_broadcast_secs 3 * 60 * 60 #define default_neighbor_info_broadcast_secs 6 * 60 * 60 #define min_node_info_broadcast_secs 60 * 60 // No regular broadcasts of more than once an hour -#define min_neighbor_info_broadcast_secs 2 * 60 * 60 +#define min_neighbor_info_broadcast_secs 4 * 60 * 60 #define default_mqtt_address "mqtt.meshtastic.org" #define default_mqtt_username "meshdev" diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 7c4c482bd..09f2ca5ea 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -232,6 +232,9 @@ NodeDB::NodeDB() moduleConfig.telemetry.health_update_interval = Default::getConfiguredOrMinimumValue( moduleConfig.telemetry.health_update_interval, min_default_telemetry_interval_secs); } + // Ensure that the neighbor info update interval is coerced to the minimum + moduleConfig.neighbor_info.update_interval = + Default::getConfiguredOrMinimumValue(moduleConfig.neighbor_info.update_interval, min_neighbor_info_broadcast_secs); if (devicestateCRC != crc32Buffer(&devicestate, sizeof(devicestate))) saveWhat |= SEGMENT_DEVICESTATE; @@ -481,7 +484,7 @@ void NodeDB::initConfigIntervals() config.display.screen_on_secs = default_screen_on_secs; -#if defined(T_WATCH_S3) || defined(T_DECK) +#if defined(T_WATCH_S3) || defined(T_DECK) || defined(RAK14014) config.power.is_power_saving = true; config.display.screen_on_secs = 30; config.power.wait_bluetooth_secs = 30; @@ -1234,9 +1237,7 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n) if (!lite) { if (isFull()) { - if (screen) - screen->print("Warn: node database full!\nErasing oldest entry\n"); - LOG_WARN("Node database full with %i nodes and %i bytes free! Erasing oldest entry", numMeshNodes, + LOG_INFO("Node database full with %i nodes and %i bytes free. Erasing oldest entry", numMeshNodes, memGet.getFreeHeap()); // look for oldest node and erase it uint32_t oldest = UINT32_MAX; @@ -1303,4 +1304,4 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co LOG_ERROR("A critical failure occurred, portduino is exiting"); exit(2); #endif -} \ No newline at end of file +} diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index ba8820140..5954dcafd 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -225,62 +225,70 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) } case STATE_SEND_METADATA: - LOG_DEBUG("Send Metadata"); + LOG_DEBUG("Send device metadata"); fromRadioScratch.which_payload_variant = meshtastic_FromRadio_metadata_tag; fromRadioScratch.metadata = getDeviceMetadata(); state = STATE_SEND_CHANNELS; break; case STATE_SEND_CHANNELS: - LOG_DEBUG("Send Channels"); fromRadioScratch.which_payload_variant = meshtastic_FromRadio_channel_tag; fromRadioScratch.channel = channels.getByIndex(config_state); config_state++; // Advance when we have sent all of our Channels if (config_state >= MAX_NUM_CHANNELS) { + LOG_DEBUG("Send channels %d", config_state); state = STATE_SEND_CONFIG; config_state = _meshtastic_AdminMessage_ConfigType_MIN + 1; } break; case STATE_SEND_CONFIG: - LOG_DEBUG("Send Radio config"); fromRadioScratch.which_payload_variant = meshtastic_FromRadio_config_tag; switch (config_state) { case meshtastic_Config_device_tag: + LOG_DEBUG("Send config: device"); fromRadioScratch.config.which_payload_variant = meshtastic_Config_device_tag; fromRadioScratch.config.payload_variant.device = config.device; break; case meshtastic_Config_position_tag: + LOG_DEBUG("Send config: position"); fromRadioScratch.config.which_payload_variant = meshtastic_Config_position_tag; fromRadioScratch.config.payload_variant.position = config.position; break; case meshtastic_Config_power_tag: + LOG_DEBUG("Send config: power"); fromRadioScratch.config.which_payload_variant = meshtastic_Config_power_tag; fromRadioScratch.config.payload_variant.power = config.power; fromRadioScratch.config.payload_variant.power.ls_secs = default_ls_secs; break; case meshtastic_Config_network_tag: + LOG_DEBUG("Send config: network"); fromRadioScratch.config.which_payload_variant = meshtastic_Config_network_tag; fromRadioScratch.config.payload_variant.network = config.network; break; case meshtastic_Config_display_tag: + LOG_DEBUG("Send config: display"); fromRadioScratch.config.which_payload_variant = meshtastic_Config_display_tag; fromRadioScratch.config.payload_variant.display = config.display; break; case meshtastic_Config_lora_tag: + LOG_DEBUG("Send config: lora"); fromRadioScratch.config.which_payload_variant = meshtastic_Config_lora_tag; fromRadioScratch.config.payload_variant.lora = config.lora; break; case meshtastic_Config_bluetooth_tag: + LOG_DEBUG("Send config: bluetooth"); fromRadioScratch.config.which_payload_variant = meshtastic_Config_bluetooth_tag; fromRadioScratch.config.payload_variant.bluetooth = config.bluetooth; break; case meshtastic_Config_security_tag: + LOG_DEBUG("Send config: security"); fromRadioScratch.config.which_payload_variant = meshtastic_Config_security_tag; fromRadioScratch.config.payload_variant.security = config.security; break; - case meshtastic_Config_sessionkey_tag: // NOOP! + case meshtastic_Config_sessionkey_tag: + LOG_DEBUG("Send config: sessionkey"); fromRadioScratch.config.which_payload_variant = meshtastic_Config_sessionkey_tag; break; case meshtastic_Config_device_ui_tag: // NOOP! @@ -302,58 +310,70 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) break; case STATE_SEND_MODULECONFIG: - LOG_DEBUG("Send Module Config"); fromRadioScratch.which_payload_variant = meshtastic_FromRadio_moduleConfig_tag; switch (config_state) { case meshtastic_ModuleConfig_mqtt_tag: + LOG_DEBUG("Send module config: mqtt"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_mqtt_tag; fromRadioScratch.moduleConfig.payload_variant.mqtt = moduleConfig.mqtt; break; case meshtastic_ModuleConfig_serial_tag: + LOG_DEBUG("Send module config: serial"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_serial_tag; fromRadioScratch.moduleConfig.payload_variant.serial = moduleConfig.serial; break; case meshtastic_ModuleConfig_external_notification_tag: + LOG_DEBUG("Send module config: ext notification"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_external_notification_tag; fromRadioScratch.moduleConfig.payload_variant.external_notification = moduleConfig.external_notification; break; case meshtastic_ModuleConfig_store_forward_tag: + LOG_DEBUG("Send module config: store forward"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_store_forward_tag; fromRadioScratch.moduleConfig.payload_variant.store_forward = moduleConfig.store_forward; break; case meshtastic_ModuleConfig_range_test_tag: + LOG_DEBUG("Send module config: range test"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_range_test_tag; fromRadioScratch.moduleConfig.payload_variant.range_test = moduleConfig.range_test; break; case meshtastic_ModuleConfig_telemetry_tag: + LOG_DEBUG("Send module config: telemetry"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_telemetry_tag; fromRadioScratch.moduleConfig.payload_variant.telemetry = moduleConfig.telemetry; break; case meshtastic_ModuleConfig_canned_message_tag: + LOG_DEBUG("Send module config: canned message"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_canned_message_tag; fromRadioScratch.moduleConfig.payload_variant.canned_message = moduleConfig.canned_message; break; case meshtastic_ModuleConfig_audio_tag: + LOG_DEBUG("Send module config: audio"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_audio_tag; fromRadioScratch.moduleConfig.payload_variant.audio = moduleConfig.audio; break; case meshtastic_ModuleConfig_remote_hardware_tag: + LOG_DEBUG("Send module config: remote hardware"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_remote_hardware_tag; fromRadioScratch.moduleConfig.payload_variant.remote_hardware = moduleConfig.remote_hardware; break; case meshtastic_ModuleConfig_neighbor_info_tag: + LOG_DEBUG("Send module config: neighbor info"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_neighbor_info_tag; fromRadioScratch.moduleConfig.payload_variant.neighbor_info = moduleConfig.neighbor_info; break; case meshtastic_ModuleConfig_detection_sensor_tag: + LOG_DEBUG("Send module config: detection sensor"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_detection_sensor_tag; fromRadioScratch.moduleConfig.payload_variant.detection_sensor = moduleConfig.detection_sensor; break; case meshtastic_ModuleConfig_ambient_lighting_tag: + LOG_DEBUG("Send module config: ambient lighting"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_ambient_lighting_tag; fromRadioScratch.moduleConfig.payload_variant.ambient_lighting = moduleConfig.ambient_lighting; break; case meshtastic_ModuleConfig_paxcounter_tag: + LOG_DEBUG("Send module config: paxcounter"); fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_paxcounter_tag; fromRadioScratch.moduleConfig.payload_variant.paxcounter = moduleConfig.paxcounter; break; @@ -453,7 +473,7 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) return numbytes; } - LOG_DEBUG("no FromRadio packet available"); + LOG_DEBUG("No FromRadio packet available"); return 0; } diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index ca9600cab..0b46ca3b9 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -187,9 +187,10 @@ ErrorCode Router::sendLocal(meshtastic_MeshPacket *p, RxSource src) handleReceived(p, src); } - if (!p->channel && !p->pki_encrypted) { // don't override if a channel was requested + // don't override if a channel was requested and no need to set it when PKI is enforced + if (!p->channel && !p->pki_encrypted) { meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(p->to); - if (node && node->user.public_key.size == 0) { + if (node) { p->channel = node->channel; LOG_DEBUG("localSend to channel %d", p->channel); } diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 535cb544d..1ddf9eb6d 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -325,7 +325,9 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) this->shift = !this->shift; } else if (keyTapped == "⌫") { +#ifndef RAK14014 this->highlight = keyTapped[0]; +#endif this->payload = 0x08; @@ -341,7 +343,9 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) validEvent = true; } else if (keyTapped == " ") { +#ifndef RAK14014 this->highlight = keyTapped[0]; +#endif this->payload = keyTapped[0]; @@ -361,7 +365,9 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) this->shift = false; } else if (keyTapped != "") { +#ifndef RAK14014 this->highlight = keyTapped[0]; +#endif this->payload = this->shift ? keyTapped[0] : std::tolower(keyTapped[0]); @@ -830,6 +836,11 @@ void CannedMessageModule::drawKeyboard(OLEDDisplay *display, OLEDDisplayUiState Letter updatedLetter = {letter.character, letter.width, xOffset, yOffset, cellWidth, cellHeight}; +#ifdef RAK14014 // Optimize the touch range of the virtual keyboard in the bottom row + if (outerIndex == outerSize - 1) { + updatedLetter.rectHeight = 240 - yOffset; + } +#endif this->keyboard[this->charSet][outerIndex][innerIndex] = updatedLetter; float characterOffset = ((cellWidth / 2) - (letter.width / 2)); diff --git a/src/modules/CannedMessageModule.h b/src/modules/CannedMessageModule.h index 5504af117..3825634f7 100644 --- a/src/modules/CannedMessageModule.h +++ b/src/modules/CannedMessageModule.h @@ -68,6 +68,10 @@ class CannedMessageModule : public SinglePortModule, public ObservableisTxAllowedChannelUtil(true) && airTime->isTxAllowedAirUtil()) { + sendNeighborInfo(NODENUM_BROADCAST, false); + } else { + sendNeighborInfo(NODENUM_BROADCAST_NO_LORA, false); + } return Default::getConfiguredOrDefaultMs(moduleConfig.neighbor_info.update_interval, default_neighbor_info_broadcast_secs); } diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 76607f6d2..0e2710940 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -580,6 +580,7 @@ void MQTT::onSend(const meshtastic_MeshPacket &mp_encrypted, const meshtastic_Me LOG_DEBUG("portnum %i message", env->packet->decoded.portnum); } else { LOG_DEBUG("nothing, pkt not decrypted"); + mqttPool.release(env); return; // Don't upload a still-encrypted PKI packet if not encryption_enabled } @@ -768,4 +769,4 @@ bool MQTT::isPrivateIpAddress(const char address[]) int octet2Num = atoi(octet2); return octet2Num >= 16 && octet2Num <= 31; -} +} \ No newline at end of file diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index ba3050e9a..1a274aa28 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -170,8 +170,6 @@ #define HW_VENDOR meshtastic_HardwareModel_HELTEC_VISION_MASTER_E213 #elif defined(HELTEC_VISION_MASTER_E290) #define HW_VENDOR meshtastic_HardwareModel_HELTEC_VISION_MASTER_E290 -#elif defined(HELTEC_MESH_NODE_T114) -#define HW_VENDOR meshtastic_HardwareModel_HELTEC_MESH_NODE_T114 #elif defined(SENSECAP_INDICATOR) #define HW_VENDOR meshtastic_HardwareModel_SENSECAP_INDICATOR #elif defined(SEEED_XIAO_S3) diff --git a/variants/heltec_wireless_paper/variant.h b/variants/heltec_wireless_paper/variant.h index 520dcec9b..fe8f391df 100644 --- a/variants/heltec_wireless_paper/variant.h +++ b/variants/heltec_wireless_paper/variant.h @@ -32,6 +32,9 @@ #define HAS_32768HZ #define ADC_CTRL_ENABLED LOW +#define NO_EXT_GPIO 1 +#define NO_GPS 1 + // LoRa #define USE_SX1262 diff --git a/variants/heltec_wireless_paper_v1/variant.h b/variants/heltec_wireless_paper_v1/variant.h index 520dcec9b..fe8f391df 100644 --- a/variants/heltec_wireless_paper_v1/variant.h +++ b/variants/heltec_wireless_paper_v1/variant.h @@ -32,6 +32,9 @@ #define HAS_32768HZ #define ADC_CTRL_ENABLED LOW +#define NO_EXT_GPIO 1 +#define NO_GPS 1 + // LoRa #define USE_SX1262 diff --git a/variants/rak10701/platformio.ini b/variants/rak_wismeshtap/platformio.ini similarity index 80% rename from variants/rak10701/platformio.ini rename to variants/rak_wismeshtap/platformio.ini index 4c9bf3b20..38b988dff 100644 --- a/variants/rak10701/platformio.ini +++ b/variants/rak_wismeshtap/platformio.ini @@ -1,15 +1,18 @@ ; The very slick RAK wireless RAK10701 Field Tester device. Note you will have to flash to Arduino bootloader to use this firmware. Be aware touch is not currently working. -[env:rak10701] +[env:rak_wismeshtap] extends = nrf52840_base board_level = extra board = wiscore_rak4631 -build_flags = ${nrf52840_base.build_flags} -Ivariants/rak10701 -D RAK_4631 +build_flags = ${nrf52840_base.build_flags} -Ivariants/rak_wismeshtap -D RAK_4631 -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DEINK_DISPLAY_MODEL=GxEPD2_213_BN -DEINK_WIDTH=250 -DEINK_HEIGHT=122 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak10701> + + + + -DMESHTASTIC_EXCLUDE_WIFI=1 + -DMESHTASTIC_EXCLUDE_EXTERNALNOTIFICATION=1 + -DMESHTASTIC_EXCLUDE_WAYPOINT=1 +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak_wismeshtap> + + + lib_deps = ${nrf52840_base.lib_deps} ${networking_base.lib_deps} diff --git a/variants/rak10701/variant.cpp b/variants/rak_wismeshtap/variant.cpp similarity index 100% rename from variants/rak10701/variant.cpp rename to variants/rak_wismeshtap/variant.cpp diff --git a/variants/rak10701/variant.h b/variants/rak_wismeshtap/variant.h similarity index 99% rename from variants/rak10701/variant.h rename to variants/rak_wismeshtap/variant.h index c263796ee..19eb841fe 100644 --- a/variants/rak10701/variant.h +++ b/variants/rak_wismeshtap/variant.h @@ -243,7 +243,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG // Therefore must be 1 to keep peripherals powered // Power is on the controllable 3V3_S rail // #define PIN_GPS_RESET (34) -#define PIN_GPS_EN PIN_3V3_EN +// #define PIN_GPS_EN PIN_3V3_EN #define PIN_GPS_PPS (17) // Pulse per second input from the GPS #define GPS_RX_PIN PIN_SERIAL1_RX diff --git a/variants/t-echo/variant.h b/variants/t-echo/variant.h index 9abb4ea69..365dfd804 100644 --- a/variants/t-echo/variant.h +++ b/variants/t-echo/variant.h @@ -216,6 +216,8 @@ External serial flash WP25R1635FZUIL0 #define VBAT_AR_INTERNAL AR_INTERNAL_3_0 #define ADC_MULTIPLIER (2.0F) +#define NO_EXT_GPIO 1 + #define HAS_RTC 1 #ifdef __cplusplus