Merge remote-tracking branch 'origin/master' into mapReport

This commit is contained in:
GUVWAF 2024-03-10 14:54:41 +01:00
commit 084b01715e
16 changed files with 30 additions and 40 deletions

View File

@ -473,11 +473,6 @@ bool Power::setup()
void Power::shutdown() void Power::shutdown()
{ {
screen->setOn(false);
#if defined(USE_EINK) && defined(PIN_EINK_EN)
digitalWrite(PIN_EINK_EN, LOW); // power off backlight first
#endif
LOG_INFO("Shutting down\n"); LOG_INFO("Shutting down\n");
#ifdef HAS_PMU #ifdef HAS_PMU

View File

@ -11,7 +11,7 @@
#define PI 3.1415926535897932384626433832795 #define PI 3.1415926535897932384626433832795
#define OLC_CODE_LEN 11 #define OLC_CODE_LEN 11
#define DEG_CONVERT 180 / PI #define DEG_CONVERT (180 / PI)
// Helper functions // Helper functions
// Raises a number to an exponent, handling negative exponents. // Raises a number to an exponent, handling negative exponents.

View File

@ -122,11 +122,6 @@ bool EInkDisplay::connect()
{ {
LOG_INFO("Doing EInk init\n"); LOG_INFO("Doing EInk init\n");
#ifdef PIN_EINK_PWR_ON
pinMode(PIN_EINK_PWR_ON, OUTPUT);
digitalWrite(PIN_EINK_PWR_ON, HIGH); // If we need to assert a pin to power external peripherals
#endif
#ifdef PIN_EINK_EN #ifdef PIN_EINK_EN
// backlight power, HIGH is backlight on, LOW is off // backlight power, HIGH is backlight on, LOW is off
pinMode(PIN_EINK_EN, OUTPUT); pinMode(PIN_EINK_EN, OUTPUT);

View File

@ -938,6 +938,9 @@ void Screen::doDeepSleep()
static const int sleepFrameCount = sizeof(sleepFrames) / sizeof(sleepFrames[0]); static const int sleepFrameCount = sizeof(sleepFrames) / sizeof(sleepFrames[0]);
ui->setFrames(sleepFrames, sleepFrameCount); ui->setFrames(sleepFrames, sleepFrameCount);
ui->update(); ui->update();
#ifdef PIN_EINK_EN
digitalWrite(PIN_EINK_EN, LOW); // power off backlight
#endif
#endif #endif
setOn(false); setOn(false);
} }

View File

@ -219,10 +219,11 @@ void setup()
initDeepSleep(); initDeepSleep();
// Testing this fix für erratic T-Echo boot behaviour // power on peripherals
#if defined(TTGO_T_ECHO) && defined(PIN_EINK_PWR_ON) #if defined(TTGO_T_ECHO) && defined(PIN_POWER_EN)
pinMode(PIN_EINK_PWR_ON, OUTPUT); pinMode(PIN_POWER_EN, OUTPUT);
digitalWrite(PIN_EINK_PWR_ON, HIGH); digitalWrite(PIN_POWER_EN, HIGH);
digitalWrite(PIN_POWER_EN1, INPUT);
#endif #endif
#if defined(VEXT_ENABLE_V03) #if defined(VEXT_ENABLE_V03)

View File

@ -113,7 +113,7 @@ void RangeTestModuleRadio::sendPayload(NodeNum dest, bool wantReplies)
meshtastic_MeshPacket *p = allocDataPacket(); meshtastic_MeshPacket *p = allocDataPacket();
p->to = dest; p->to = dest;
p->decoded.want_response = wantReplies; p->decoded.want_response = wantReplies;
p->hop_limit = 0;
p->want_ack = true; p->want_ack = true;
packetSequence++; packetSequence++;

View File

@ -736,6 +736,9 @@ std::string MQTT::meshPacketToJson(meshtastic_MeshPacket *mp)
if ((int)decoded->VDOP) { if ((int)decoded->VDOP) {
msgPayload["VDOP"] = new JSONValue((int)decoded->VDOP); msgPayload["VDOP"] = new JSONValue((int)decoded->VDOP);
} }
if ((int)decoded->precision_bits) {
msgPayload["precision_bits"] = new JSONValue((int)decoded->precision_bits);
}
jsonObj["payload"] = new JSONValue(msgPayload); jsonObj["payload"] = new JSONValue(msgPayload);
} else { } else {
LOG_ERROR("Error decoding protobuf for position message!\n"); LOG_ERROR("Error decoding protobuf for position message!\n");
@ -889,6 +892,8 @@ std::string MQTT::meshPacketToJson(meshtastic_MeshPacket *mp)
jsonObj["rssi"] = new JSONValue((int)mp->rx_rssi); jsonObj["rssi"] = new JSONValue((int)mp->rx_rssi);
if (mp->rx_snr != 0) if (mp->rx_snr != 0)
jsonObj["snr"] = new JSONValue((float)mp->rx_snr); jsonObj["snr"] = new JSONValue((float)mp->rx_snr);
if (mp->hop_start != 0 && mp->hop_limit <= mp->hop_start)
jsonObj["hops_away"] = new JSONValue((uint)(mp->hop_start - mp->hop_limit));
// serialize and write it to the stream // serialize and write it to the stream
JSONValue *value = new JSONValue(jsonObj); JSONValue *value = new JSONValue(jsonObj);

View File

@ -80,7 +80,7 @@ class MQTT : private concurrency::OSThread
private: private:
std::string statusTopic = "/2/stat/"; // For "online"/"offline" message and MapReport std::string statusTopic = "/2/stat/"; // For "online"/"offline" message and MapReport
std::string cryptTopic = "/2/c/"; // msh/2/c/CHANNELID/NODEID std::string cryptTopic = "/2/e/"; // msh/2/e/CHANNELID/NODEID
std::string jsonTopic = "/2/json/"; // msh/2/json/CHANNELID/NODEID std::string jsonTopic = "/2/json/"; // msh/2/json/CHANNELID/NODEID
// For map reporting (only applies when enabled) // For map reporting (only applies when enabled)

View File

@ -200,6 +200,13 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false)
nodeDB.saveToDisk(); nodeDB.saveToDisk();
#ifdef TTGO_T_ECHO
#ifdef PIN_POWER_EN
pinMode(PIN_POWER_EN, INPUT); // power off peripherals
pinMode(PIN_POWER_EN1, INPUT_PULLDOWN);
#endif
#endif
// Kill GPS power completely (even if previously we just had it in sleep mode) // Kill GPS power completely (even if previously we just had it in sleep mode)
if (gps) if (gps)
gps->setGPSPower(false, false, 0); gps->setGPSPower(false, false, 0);

View File

@ -9,7 +9,7 @@
#define LED_PIN 18 // LED #define LED_PIN 18 // LED
#define LED_INVERTED 1 #define LED_INVERTED 1
#define HAS_SCREEN 0 #define HAS_SCREEN 1
#define HAS_GPS 0 #define HAS_GPS 0
#undef GPS_RX_PIN #undef GPS_RX_PIN
#undef GPS_TX_PIN #undef GPS_TX_PIN

View File

@ -133,10 +133,6 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define PIN_EINK_SCLK (0 + 3) #define PIN_EINK_SCLK (0 + 3)
#define PIN_EINK_MOSI (0 + 30) // also called SDI #define PIN_EINK_MOSI (0 + 30) // also called SDI
// Controls power for the eink display - Board power is enabled either by VBUS from USB or the CPU asserting PWR_ON
// FIXME - I think this is actually just the board power enable - it enables power to the CPU also
// #define PIN_EINK_PWR_ON (-1)
// #define USE_EINK // #define USE_EINK
// RAKRGB // RAKRGB

View File

@ -133,10 +133,6 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define PIN_EINK_SCLK (0 + 3) #define PIN_EINK_SCLK (0 + 3)
#define PIN_EINK_MOSI (0 + 30) // also called SDI #define PIN_EINK_MOSI (0 + 30) // also called SDI
// Controls power for the eink display - Board power is enabled either by VBUS from USB or the CPU asserting PWR_ON
// FIXME - I think this is actually just the board power enable - it enables power to the CPU also
// #define PIN_EINK_PWR_ON (-1)
// #define USE_EINK // #define USE_EINK
// RAKRGB // RAKRGB

View File

@ -133,10 +133,6 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define PIN_EINK_SCLK (0 + 3) #define PIN_EINK_SCLK (0 + 3)
#define PIN_EINK_MOSI (0 + 30) // also called SDI #define PIN_EINK_MOSI (0 + 30) // also called SDI
// Controls power for the eink display - Board power is enabled either by VBUS from USB or the CPU asserting PWR_ON
// FIXME - I think this is actually just the board power enable - it enables power to the CPU also
// #define PIN_EINK_PWR_ON (-1)
#define USE_EINK #define USE_EINK
// RAKRGB // RAKRGB

View File

@ -119,10 +119,6 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define PIN_EINK_SCLK (0 + 14) // SCL #define PIN_EINK_SCLK (0 + 14) // SCL
#define PIN_EINK_MOSI (0 + 13) // SDA #define PIN_EINK_MOSI (0 + 13) // SDA
// Controls power for the eink display - Board power is enabled either by VBUS from USB or the CPU asserting PWR_ON
// FIXME - I think this is actually just the board power enable - it enables power to the CPU also
// #define PIN_EINK_PWR_ON (-1)
// RAKRGB // RAKRGB
#define HAS_NCP5623 #define HAS_NCP5623

View File

@ -156,9 +156,9 @@ External serial flash WP25R1635FZUIL0
#define PIN_EINK_SCLK (0 + 31) #define PIN_EINK_SCLK (0 + 31)
#define PIN_EINK_MOSI (0 + 29) // also called SDI #define PIN_EINK_MOSI (0 + 29) // also called SDI
// Controls power for the eink display - Board power is enabled either by VBUS from USB or the CPU asserting PWR_ON // Controls power for all peripherals (eink + GPS + LoRa + Sensor)
// FIXME - I think this is actually just the board power enable - it enables power to the CPU also #define PIN_POWER_EN (0 + 12)
#define PIN_EINK_PWR_ON (0 + 12) #define PIN_POWER_EN1 (0 + 13)
#define USE_EINK #define USE_EINK

View File

@ -1,4 +1,4 @@
[VERSION] [VERSION]
major = 2 major = 2
minor = 2 minor = 3
build = 25 build = 0