mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-05 02:59:11 +00:00
Compare commits
4 Commits
667b4ef0f2
...
3d5eb34c5c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3d5eb34c5c | ||
![]() |
3a9a4bbb92 | ||
![]() |
6eba2789d0 | ||
![]() |
9b4c260a92 |
@ -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
|
||||
|
@ -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<char>(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<char>(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<char>(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) {
|
||||
|
@ -231,6 +231,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;
|
||||
@ -473,7 +476,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;
|
||||
|
@ -218,62 +218,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:
|
||||
LOG_DEBUG("Send config: sessionkey");
|
||||
fromRadioScratch.config.which_payload_variant = meshtastic_Config_sessionkey_tag;
|
||||
break;
|
||||
default:
|
||||
@ -292,58 +300,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;
|
||||
@ -443,7 +463,7 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
|
||||
return numbytes;
|
||||
}
|
||||
|
||||
LOG_DEBUG("no FromRadio packet available");
|
||||
LOG_DEBUG("No FromRadio packet available");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
|
@ -68,6 +68,10 @@ class CannedMessageModule : public SinglePortModule, public Observable<const UIF
|
||||
|
||||
String drawWithCursor(String text, int cursor);
|
||||
|
||||
#ifdef RAK14014
|
||||
cannedMessageModuleRunState getRunState() const { return runState; }
|
||||
#endif
|
||||
|
||||
/*
|
||||
-Override the wantPacket method. We need the Routing Messages to look for ACKs.
|
||||
*/
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -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> +<mesh/eth/> +<mesh/api/> +<mqtt/>
|
||||
-DMESHTASTIC_EXCLUDE_WIFI=1
|
||||
-DMESHTASTIC_EXCLUDE_EXTERNALNOTIFICATION=1
|
||||
-DMESHTASTIC_EXCLUDE_WAYPOINT=1
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak_wismeshtap> +<mesh/eth/> +<mesh/api/> +<mqtt/>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
${networking_base.lib_deps}
|
@ -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
|
Loading…
Reference in New Issue
Block a user