mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-18 19:12:09 +00:00
Merge branch 'master' into tft-gui-work
This commit is contained in:
commit
5340d0a2b4
@ -7,7 +7,6 @@
|
||||
"extra_flags": [
|
||||
"-DBOARD_HAS_PSRAM",
|
||||
"-DLILYGO_TBEAM_S3_CORE",
|
||||
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||
"-DARDUINO_USB_MODE=1",
|
||||
"-DARDUINO_RUNNING_CORE=1",
|
||||
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
||||
|
34
boards/wiphone.json
Normal file
34
boards/wiphone.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"ldscript": "esp32_out.ld",
|
||||
"partitions": "default_16MB.csv"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": [
|
||||
"-DARDUINO_WIPHONE14",
|
||||
"-DBOARD_HAS_PSRAM",
|
||||
"-mfix-esp32-psram-cache-issue",
|
||||
"-mfix-esp32-psram-cache-strategy=memw"
|
||||
],
|
||||
"f_cpu": "240000000L",
|
||||
"f_flash": "40000000L",
|
||||
"flash_mode": "dio",
|
||||
"mcu": "esp32",
|
||||
"variant": "wiphone",
|
||||
"board": "WiPhone"
|
||||
},
|
||||
"connectivity": ["wifi", "bluetooth"],
|
||||
"frameworks": ["arduino", "espidf"],
|
||||
"name": "WIPhone Integrated 1.4",
|
||||
"upload": {
|
||||
"flash_size": "16MB",
|
||||
"maximum_ram_size": 532480,
|
||||
"maximum_size": 6553600,
|
||||
"maximum_data_size": 4521984,
|
||||
"require_upload_port": true,
|
||||
"speed": 921600
|
||||
},
|
||||
"url": "https://www.wiphone.io/",
|
||||
"vendor": "HackEDA"
|
||||
}
|
@ -1 +1 @@
|
||||
Subproject commit e21899aa6b2b49863cfa2758e5e3b6faacf04bba
|
||||
Subproject commit 1bfe0354d101a6a71ea1354ea158e59193671a0b
|
@ -51,7 +51,9 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port), con
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if !ARCH_PORTDUINO
|
||||
emitRebooted();
|
||||
#endif
|
||||
}
|
||||
|
||||
int32_t SerialConsole::runOnce()
|
||||
|
@ -8,6 +8,12 @@
|
||||
#define TFT_BACKLIGHT_ON HIGH
|
||||
#endif
|
||||
|
||||
#ifdef GPIO_EXTENDER
|
||||
#include <SparkFunSX1509.h>
|
||||
#include <Wire.h>
|
||||
extern SX1509 gpioExtender;
|
||||
#endif
|
||||
|
||||
#ifndef TFT_MESH
|
||||
#define TFT_MESH COLOR565(0x67, 0xEA, 0x94)
|
||||
#endif
|
||||
|
@ -362,7 +362,7 @@ void setup()
|
||||
Wire.begin(I2C_SDA, I2C_SCL);
|
||||
#elif defined(ARCH_PORTDUINO)
|
||||
if (settingsStrings[i2cdev] != "") {
|
||||
LOG_INFO("Using %s as I2C device.\n", settingsStrings[i2cdev]);
|
||||
LOG_INFO("Using %s as I2C device.\n", settingsStrings[i2cdev].c_str());
|
||||
Wire.begin(settingsStrings[i2cdev].c_str());
|
||||
} else {
|
||||
LOG_INFO("No I2C device configured, skipping.\n");
|
||||
|
@ -257,7 +257,7 @@ void MeshService::sendToMesh(meshtastic_MeshPacket *p, RxSource src, bool ccToPh
|
||||
LOG_DEBUG("Can't send status to phone");
|
||||
}
|
||||
|
||||
if (ccToPhone) {
|
||||
if (res == ERRNO_OK && ccToPhone) { // Check if p is not released in case it couldn't be sent
|
||||
sendToPhone(packetPool.allocCopy(*p));
|
||||
}
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ void NodeDB::installDefaultConfig()
|
||||
config.device.node_info_broadcast_secs = default_node_info_broadcast_secs;
|
||||
config.device.serial_enabled = true;
|
||||
resetRadioConfig();
|
||||
strncpy(config.network.ntp_server, "0.pool.ntp.org", 32);
|
||||
strncpy(config.network.ntp_server, "meshtastic.pool.ntp.org", 32);
|
||||
// FIXME: Default to bluetooth capability of platform as default
|
||||
config.bluetooth.enabled = true;
|
||||
config.bluetooth.fixed_pin = defaultBLEPin;
|
||||
|
@ -63,6 +63,8 @@ typedef enum _meshtastic_HardwareModel {
|
||||
meshtastic_HardwareModel_NANO_G2_ULTRA = 18,
|
||||
/* LoRAType device: https://loratype.org/ */
|
||||
meshtastic_HardwareModel_LORA_TYPE = 19,
|
||||
/* wiphone https://www.wiphone.io/ */
|
||||
meshtastic_HardwareModel_WIPHONE = 20,
|
||||
/* B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */
|
||||
meshtastic_HardwareModel_STATION_G1 = 25,
|
||||
/* RAK11310 (RP2040 + SX1262) */
|
||||
@ -151,6 +153,9 @@ typedef enum _meshtastic_HardwareModel {
|
||||
/* TWC_MESH_V4
|
||||
Adafruit NRF52840 feather express with SX1262, SSD1306 OLED and NEO6M GPS */
|
||||
meshtastic_HardwareModel_TWC_MESH_V4 = 62,
|
||||
/* NRF52_PROMICRO_DIY
|
||||
Promicro NRF52840 with SX1262/LLCC68, SSD1306 OLED and NEO6M GPS */
|
||||
meshtastic_HardwareModel_NRF52_PROMICRO_DIY = 63,
|
||||
/* ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits.
|
||||
------------------------------------------------------------------------------------------------------------------------------------------ */
|
||||
|
@ -45,7 +45,9 @@ typedef enum _meshtastic_TelemetrySensorType {
|
||||
/* BMP085/BMP180 High accuracy temperature and pressure (older Version of BMP280) */
|
||||
meshtastic_TelemetrySensorType_BMP085 = 15,
|
||||
/* RCWL-9620 Doppler Radar Distance Sensor, used for water level detection */
|
||||
meshtastic_TelemetrySensorType_RCWL9620 = 16
|
||||
meshtastic_TelemetrySensorType_RCWL9620 = 16,
|
||||
/* Sensirion High accuracy temperature and humidity */
|
||||
meshtastic_TelemetrySensorType_SHT4X = 17
|
||||
} meshtastic_TelemetrySensorType;
|
||||
|
||||
/* Struct definitions */
|
||||
@ -152,8 +154,8 @@ extern "C" {
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET
|
||||
#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_RCWL9620
|
||||
#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_RCWL9620+1))
|
||||
#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_SHT4X
|
||||
#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_SHT4X+1))
|
||||
|
||||
|
||||
|
||||
|
@ -221,6 +221,8 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
||||
nodeDB->setLocalPosition(r->set_fixed_position);
|
||||
config.position.fixed_position = true;
|
||||
saveChanges(SEGMENT_DEVICESTATE | SEGMENT_CONFIG, false);
|
||||
// Send our new fixed position to the mesh for good measure
|
||||
positionModule->sendOurPosition();
|
||||
#if !MESHTASTIC_EXCLUDE_GPS
|
||||
if (gps != nullptr)
|
||||
gps->enable();
|
||||
|
@ -151,45 +151,53 @@ uint32_t GetTimeSinceMeshPacket(const meshtastic_MeshPacket *mp)
|
||||
void EnvironmentTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||
{
|
||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||
display->setFont(FONT_MEDIUM);
|
||||
display->drawString(x, y, "Environment");
|
||||
display->setFont(FONT_SMALL);
|
||||
|
||||
if (lastMeasurementPacket == nullptr) {
|
||||
display->setFont(FONT_SMALL);
|
||||
display->drawString(x, y += fontHeight(FONT_MEDIUM), "No measurement");
|
||||
// If there's no valid packet, display "Environment"
|
||||
display->drawString(x, y, "Environment");
|
||||
display->drawString(x, y += fontHeight(FONT_SMALL), "No measurement");
|
||||
return;
|
||||
}
|
||||
|
||||
// Decode the last measurement packet
|
||||
meshtastic_Telemetry lastMeasurement;
|
||||
|
||||
uint32_t agoSecs = GetTimeSinceMeshPacket(lastMeasurementPacket);
|
||||
const char *lastSender = getSenderShortName(*lastMeasurementPacket);
|
||||
|
||||
auto &p = lastMeasurementPacket->decoded;
|
||||
if (!pb_decode_from_bytes(p.payload.bytes, p.payload.size, &meshtastic_Telemetry_msg, &lastMeasurement)) {
|
||||
display->setFont(FONT_SMALL);
|
||||
display->drawString(x, y += fontHeight(FONT_MEDIUM), "Measurement Error");
|
||||
display->drawString(x, y, "Measurement Error");
|
||||
LOG_ERROR("Unable to decode last packet");
|
||||
return;
|
||||
}
|
||||
|
||||
display->setFont(FONT_SMALL);
|
||||
// Display "Env. From: ..." on its own
|
||||
display->drawString(x, y, "Env. From: " + String(lastSender) + "(" + String(agoSecs) + "s)");
|
||||
|
||||
String last_temp = String(lastMeasurement.variant.environment_metrics.temperature, 0) + "°C";
|
||||
if (moduleConfig.telemetry.environment_display_fahrenheit) {
|
||||
last_temp = String(CelsiusToFahrenheit(lastMeasurement.variant.environment_metrics.temperature), 0) + "°F";
|
||||
}
|
||||
display->drawString(x, y += fontHeight(FONT_MEDIUM) - 2, "From: " + String(lastSender) + "(" + String(agoSecs) + "s)");
|
||||
display->drawString(x, y += fontHeight(FONT_SMALL) - 2,
|
||||
|
||||
// Continue with the remaining details
|
||||
display->drawString(x, y += fontHeight(FONT_SMALL),
|
||||
"Temp/Hum: " + last_temp + " / " +
|
||||
String(lastMeasurement.variant.environment_metrics.relative_humidity, 0) + "%");
|
||||
if (lastMeasurement.variant.environment_metrics.barometric_pressure != 0)
|
||||
|
||||
if (lastMeasurement.variant.environment_metrics.barometric_pressure != 0) {
|
||||
display->drawString(x, y += fontHeight(FONT_SMALL),
|
||||
"Press: " + String(lastMeasurement.variant.environment_metrics.barometric_pressure, 0) + "hPA");
|
||||
if (lastMeasurement.variant.environment_metrics.voltage != 0)
|
||||
}
|
||||
|
||||
if (lastMeasurement.variant.environment_metrics.voltage != 0) {
|
||||
display->drawString(x, y += fontHeight(FONT_SMALL),
|
||||
"Volt/Cur: " + String(lastMeasurement.variant.environment_metrics.voltage, 0) + "V / " +
|
||||
String(lastMeasurement.variant.environment_metrics.current, 0) + "mA");
|
||||
if (lastMeasurement.variant.environment_metrics.iaq != 0)
|
||||
}
|
||||
if (lastMeasurement.variant.environment_metrics.iaq != 0) {
|
||||
display->drawString(x, y += fontHeight(FONT_SMALL), "IAQ: " + String(lastMeasurement.variant.environment_metrics.iaq));
|
||||
}
|
||||
if (lastMeasurement.variant.environment_metrics.distance != 0)
|
||||
display->drawString(x, y += fontHeight(FONT_SMALL),
|
||||
"Water Level: " + String(lastMeasurement.variant.environment_metrics.distance, 0) + "mm");
|
||||
|
@ -1,8 +1,11 @@
|
||||
#include "RCWL9620Sensor.h"
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include "configuration.h"
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "RCWL9620Sensor.h"
|
||||
#include "TelemetrySensor.h"
|
||||
|
||||
RCWL9620Sensor::RCWL9620Sensor() : TelemetrySensor(meshtastic_TelemetrySensorType_RCWL9620, "RCWL9620") {}
|
||||
|
||||
int32_t RCWL9620Sensor::runOnce()
|
||||
@ -57,4 +60,6 @@ float RCWL9620Sensor::getDistance()
|
||||
} else {
|
||||
return Distance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,3 +1,7 @@
|
||||
#include "configuration.h"
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include <Wire.h>
|
||||
@ -20,4 +24,6 @@ class RCWL9620Sensor : public TelemetrySensor
|
||||
RCWL9620Sensor();
|
||||
virtual int32_t runOnce() override;
|
||||
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
@ -143,6 +143,8 @@
|
||||
#define HW_VENDOR meshtastic_HardwareModel_STATION_G2
|
||||
#elif defined(UNPHONE)
|
||||
#define HW_VENDOR meshtastic_HardwareModel_UNPHONE
|
||||
#elif defined(WIPHONE)
|
||||
#define HW_VENDOR meshtastic_HardwareModel_WIPHONE
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -3,8 +3,6 @@
|
||||
extends = esp32s3_base
|
||||
board = tbeam-s3-core
|
||||
|
||||
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.15
|
||||
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
lewisxhe/PCF8563_Library@1.0.1
|
||||
|
52
variants/wiphone/pins_arduino.h
Normal file
52
variants/wiphone/pins_arduino.h
Normal file
@ -0,0 +1,52 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define EXTERNAL_NUM_INTERRUPTS 16
|
||||
#define NUM_DIGITAL_PINS 20
|
||||
#define NUM_ANALOG_INPUTS 16
|
||||
|
||||
#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
|
||||
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
|
||||
#define digitalPinHasPWM(p) (p < 34)
|
||||
|
||||
static const uint8_t TX = 1;
|
||||
static const uint8_t RX = 3;
|
||||
|
||||
static const uint8_t SDA = 21;
|
||||
static const uint8_t SCL = 22;
|
||||
|
||||
static const uint8_t SS = 5;
|
||||
static const uint8_t MOSI = 23;
|
||||
static const uint8_t MISO = 19;
|
||||
static const uint8_t SCK = 18;
|
||||
|
||||
static const uint8_t G23 = 23;
|
||||
static const uint8_t G19 = 19;
|
||||
static const uint8_t G18 = 18;
|
||||
static const uint8_t G3 = 3;
|
||||
static const uint8_t G16 = 16;
|
||||
static const uint8_t G21 = 21;
|
||||
static const uint8_t G2 = 2;
|
||||
static const uint8_t G12 = 12;
|
||||
static const uint8_t G15 = 15;
|
||||
static const uint8_t G35 = 35;
|
||||
static const uint8_t G36 = 36;
|
||||
static const uint8_t G25 = 25;
|
||||
static const uint8_t G26 = 26;
|
||||
static const uint8_t G1 = 1;
|
||||
static const uint8_t G17 = 17;
|
||||
static const uint8_t G22 = 22;
|
||||
static const uint8_t G5 = 5;
|
||||
static const uint8_t G13 = 13;
|
||||
static const uint8_t G0 = 0;
|
||||
static const uint8_t G34 = 34;
|
||||
|
||||
static const uint8_t DAC1 = 25;
|
||||
static const uint8_t DAC2 = 26;
|
||||
|
||||
static const uint8_t ADC1 = 35;
|
||||
static const uint8_t ADC2 = 36;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
13
variants/wiphone/platformio.ini
Normal file
13
variants/wiphone/platformio.ini
Normal file
@ -0,0 +1,13 @@
|
||||
[env:wiphone]
|
||||
extends = esp32_base
|
||||
board = wiphone
|
||||
monitor_filters = esp32_exception_decoder
|
||||
board_build.partitions = default_16MB.csv
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D WIPHONE -I variants/wiphone
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
lovyan03/LovyanGFX@^1.1.8
|
||||
sparkfun/SX1509 IO Expander@^3.0.5
|
||||
pololu/APA102@^3.0.0
|
||||
|
58
variants/wiphone/variant.h
Normal file
58
variants/wiphone/variant.h
Normal file
@ -0,0 +1,58 @@
|
||||
#define I2C_SDA 15
|
||||
#define I2C_SCL 25
|
||||
|
||||
#define GPIO_EXTENDER 1509
|
||||
#define EXTENDER_FLAG 0x40
|
||||
#define EXTENDER_PIN(x) (x + EXTENDER_FLAG)
|
||||
|
||||
#undef RF95_SCK
|
||||
#undef RF95_MISO
|
||||
#undef RF95_MOSI
|
||||
#undef RF95_NSS
|
||||
|
||||
#define RF95_SCK 14
|
||||
#define RF95_MISO 12
|
||||
#define RF95_MOSI 13
|
||||
#define RF95_NSS 27
|
||||
|
||||
#define USE_RF95
|
||||
#define LORA_DIO0 38
|
||||
#define LORA_RESET RADIOLIB_NC
|
||||
#define LORA_DIO1 RADIOLIB_NC
|
||||
#define LORA_DIO2 RADIOLIB_NC
|
||||
|
||||
// This board has no GPS or Screen for now
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
#define NO_GPS
|
||||
#define HAS_GPS 0
|
||||
#define NO_SCREEN
|
||||
#define HAS_SCREEN 0
|
||||
|
||||
// Default SPI1 will be mapped to the display
|
||||
#define ST7789_SDA 23
|
||||
#define ST7789_SCK 18
|
||||
#define ST7789_CS 5
|
||||
#define ST7789_RS 26
|
||||
#define ST7789_BL -1 // EXTENDER_PIN(9)
|
||||
|
||||
#define ST7789_RESET -1
|
||||
#define ST7789_MISO 19
|
||||
#define ST7789_BUSY -1
|
||||
#define ST7789_SPI_HOST SPI3_HOST
|
||||
#define ST7789_BACKLIGHT_EN -1 // EXTENDER_PIN(9)
|
||||
#define SPI_FREQUENCY 40000000
|
||||
#define SPI_READ_FREQUENCY 16000000
|
||||
#define TFT_HEIGHT 240
|
||||
#define TFT_WIDTH 320
|
||||
#define TFT_OFFSET_X 0
|
||||
#define TFT_OFFSET_Y 0
|
||||
#define TFT_OFFSET_ROTATION 0
|
||||
#define SCREEN_ROTATE
|
||||
#define SCREEN_TRANSITION_FRAMERATE 5
|
||||
|
||||
#define I2S_MCLK_GPIO0
|
||||
#define I2S_BCK_PIN 4 // rev1.3 - 4 (wp05)
|
||||
#define I2S_WS_PIN 33
|
||||
#define I2S_MOSI_PIN 21
|
||||
#define I2S_MISO_PIN 34
|
Loading…
Reference in New Issue
Block a user