Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions boards/thinknode_m9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_opi",
"partitions": "default_16MB.csv"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_CDC_ON_BOOT=0",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=0"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"psram_type": "qio_opi",
"hwids": [
[
"0x303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "ELECROW-ThinkNode-M9"
},
"connectivity": [
"wifi",
"bluetooth",
"lora"
],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": [
"esp-builtin"
],
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "elecrow-thinknode-m9",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 524288,
"maximum_size": 16777216,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 921600
},
"url": "https://www.elecrow.com/thinknode-m1-meshtastic-lora-signal-transceiver-powered-by-nrf52840-with-154-screen-support-gps.html",
"vendor": "ELECROW"
}
1 change: 1 addition & 0 deletions src/helpers/AutoDiscoverRTCClock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void AutoDiscoverRTCClock::begin(TwoWire& wire) {
}

if (i2c_probe(wire, PCF8563_ADDRESS)) {
MESH_DEBUG_PRINTLN("PCF8563: Found");
rtc_8563_success = rtc_8563.begin(&wire);
}

Expand Down
14 changes: 14 additions & 0 deletions src/helpers/ui/ST7789Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
#define SCALE_Y 2.109375f // 135 / 64
#endif

#ifdef DISPLAY_SCALE_X
#define SCALE_X DISPLAY_SCALE_X
#endif

#ifdef DISPLAY_SCALE_Y
#define SCALE_Y DISPLAY_SCALE_Y
#endif

bool ST7789Display::begin() {
if(!_isOn) {
pinMode(PIN_TFT_VDD_CTL, OUTPUT);
Expand All @@ -32,6 +40,9 @@ bool ST7789Display::begin() {

display.init();
display.landscapeScreen();
#ifdef DISPLAY_FLIP_VERTICALLY
display.flipScreenVertically();
#endif
display.displayOn();
setCursor(0,0);

Expand All @@ -49,6 +60,9 @@ void ST7789Display::turnOn() {
// Re-initialize the display
display.init();
display.displayOn();
#ifdef DISPLAY_FLIP_VERTICALLY
display.flipScreenVertically();
#endif
delay(20);

// Now turn on the backlight
Expand Down
4 changes: 3 additions & 1 deletion src/helpers/ui/ST7789Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ class ST7789Display : public DisplayDriver {

bool i2c_probe(TwoWire& wire, uint8_t addr);
public:
#ifdef HELTEC_VISION_MASTER_T190
#if defined(HELTEC_VISION_MASTER_T190)
ST7789Display() : DisplayDriver(128, 64), display(&SPI, PIN_TFT_RST, PIN_TFT_DC, PIN_TFT_CS, GEOMETRY_RAWMODE, 320, 170,PIN_TFT_SDA,-1,PIN_TFT_SCL) {_isOn = false;}
#elif defined(THINKNODE_M9)
ST7789Display() : DisplayDriver(128, 64), display(&SPI, ST7789_RESET, ST7789_RS, ST7789_CS, GEOMETRY_RAWMODE, 320, 240, ST7789_SDA, ST7789_MISO, ST7789_SCK) {_isOn = false;}
#else
ST7789Display() : DisplayDriver(128, 64), display(&SPI1, PIN_TFT_RST, PIN_TFT_DC, PIN_TFT_CS, GEOMETRY_RAWMODE, 240, 135) {_isOn = false;}
#endif
Expand Down
23 changes: 23 additions & 0 deletions variants/thinknode_m9/ThinkNodeM9Board.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "ThinkNodeM9Board.h"

void ThinkNodeM9Board::begin() {

// power on screen
pinMode(VEXT_ENABLE, OUTPUT);
digitalWrite(VEXT_ENABLE, VEXT_ON_VALUE);

ESP32Board::begin();

}

void ThinkNodeM9Board::powerOff() {
enterDeepSleep(0);
}

uint32_t ThinkNodeM9Board::getIRQGpio() {
return LORA_DIO0;
}

const char* ThinkNodeM9Board::getManufacturerName() const {
return "Elecrow ThinkNode M9";
}
13 changes: 13 additions & 0 deletions variants/thinknode_m9/ThinkNodeM9Board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

#include <Arduino.h>
#include <helpers/ESP32Board.h>

class ThinkNodeM9Board : public ESP32Board {

public:
void begin();
void powerOff() override;
const char* getManufacturerName() const override;
uint32_t getIRQGpio() override;
};
64 changes: 64 additions & 0 deletions variants/thinknode_m9/pins_arduino.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Need this file for ESP32-S3
// No need to modify this file, changes to pins imported from variant.h
// Most is similar to https://github.com/espressif/arduino-esp32/blob/master/variants/esp32s3/pins_arduino.h

#ifndef Pins_Arduino_h
#define Pins_Arduino_h

#include <stdint.h>
#include <variant.h>

#define USB_VID 0x303a
#define USB_PID 0x1001

// Serial
static const uint8_t TX = 43;
static const uint8_t RX = 44;

// Default SPI will be mapped to Radio
static const uint8_t SS = LORA_CS;
static const uint8_t SCK = SPI_SCK;
static const uint8_t MOSI = SPI_MOSI;
static const uint8_t MISO = SPI_MISO;

// The default Wire will be mapped to PMU and RTC
static const uint8_t SCL = I2C_SCL;
static const uint8_t SDA = I2C_SDA;

static const uint8_t A0 = 1;
static const uint8_t A1 = 2;
static const uint8_t A2 = 3;
static const uint8_t A3 = 4;
static const uint8_t A4 = 5;
static const uint8_t A5 = 6;
static const uint8_t A6 = 7;
static const uint8_t A7 = 8;
static const uint8_t A8 = 9;
static const uint8_t A9 = 10;
static const uint8_t A10 = 11;
static const uint8_t A11 = 12;
static const uint8_t A12 = 13;
static const uint8_t A13 = 14;
static const uint8_t A14 = 15;
static const uint8_t A15 = 16;
static const uint8_t A16 = 17;
static const uint8_t A17 = 18;
static const uint8_t A18 = 19;
static const uint8_t A19 = 20;

static const uint8_t T1 = 1;
static const uint8_t T2 = 2;
static const uint8_t T3 = 3;
static const uint8_t T4 = 4;
static const uint8_t T5 = 5;
static const uint8_t T6 = 6;
static const uint8_t T7 = 7;
static const uint8_t T8 = 8;
static const uint8_t T9 = 9;
static const uint8_t T10 = 10;
static const uint8_t T11 = 11;
static const uint8_t T12 = 12;
static const uint8_t T13 = 13;
static const uint8_t T14 = 14;

#endif /* Pins_Arduino_h */
160 changes: 160 additions & 0 deletions variants/thinknode_m9/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
[ThinkNode_M9]
extends = esp32_base
board = thinknode_m9
board_check = true
board_build.partitions = default_16MB.csv
upload_protocol = esptool
build_flags =
${esp32_base.build_flags}
${sensor_base.build_flags}
-I variants/thinknode_m9
-I src/helpers/esp32
-I src/helpers/sensors
-D THINKNODE_M9
-D PIN_BUZZER=9
-D PIN_BOARD_SCL=6
-D PIN_BOARD_SDA=7
-D P_LORA_NSS=39
-D P_LORA_RESET=45
-D P_LORA_BUSY=41
-D P_LORA_SCLK=40
-D P_LORA_MISO=38
-D P_LORA_MOSI=47
-D P_LORA_DIO_1=42
-D USE_LR1110
-D RF_SWITCH_TABLE
-D RADIO_CLASS=CustomLR1110
-D WRAPPER_CLASS=CustomLR1110Wrapper
-D LR11X0_DIO_AS_RF_SWITCH=true
-D LR11X0_DIO3_TCXO_VOLTAGE=3.3
-D LORA_TX_POWER=22
-D DISPLAY_CLASS=ST7789Display
-D DISPLAY_FLIP_VERTICALLY=1
-D DISPLAY_SCALE_X=2.5f ; 320 / 128
-D DISPLAY_SCALE_Y=3.75f ; 240 / 64
-D ST7789
-D PIN_TFT_VDD_CTL=-1
-D PIN_TFT_LEDA_CTL=17
-D PIN_TFT_RST=14
-D PIN_GPS_RX=3
-D PIN_GPS_TX=2
-D PIN_GPS_EN=11
-D PIN_GPS_EN_ACTIVE=LOW
-D PIN_GPS_RESET=5
-D PIN_GPS_RESET_ACTIVE=HIGH
-D GPS_BAUD_RATE=115200
-D ENV_INCLUDE_GPS=1
-D PIN_VBAT_READ=13
build_src_filter = ${esp32_base.build_src_filter}
+<helpers/sensors/EnvironmentSensorManager.cpp>
+<helpers/ui/ST7789Display.cpp>
+<helpers/ui/OLEDDisplay.cpp>
+<helpers/ui/OLEDDisplayFonts.cpp>
+<helpers/*.cpp>
+<../variants/thinknode_m9>
lib_deps = ${esp32_base.lib_deps}
${sensor_base.lib_deps}
adafruit/Adafruit GFX Library @ ^1.12.1

[env:ThinkNode_M9_repeater_]
extends = ThinkNode_M9
build_flags =
${ThinkNode_M9.build_flags}
-D ADVERT_NAME='"ThinkNode M9 Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=50
;-D MESH_PACKET_LOGGING=1
;-D MESH_DEBUG=1
build_src_filter = ${ThinkNode_M9.build_src_filter}
+<../examples/simple_repeater/*.cpp>
lib_deps =
${ThinkNode_M9.lib_deps}
${esp32_ota.lib_deps}

[env:ThinkNode_M9_room_server_]
extends = ThinkNode_M9
build_src_filter = ${ThinkNode_M9.build_src_filter}
+<../examples/simple_room_server>
build_flags =
${ThinkNode_M9.build_flags}
-D ADVERT_NAME='"ThinkNode M9 Room Server"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D ROOM_PASSWORD='"hello"'
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps =
${ThinkNode_M9.lib_deps}
${esp32_ota.lib_deps}

[env:ThinkNode_M9_companion_radio_ble_]
extends = ThinkNode_M9
build_flags =
${ThinkNode_M9.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D BLE_PIN_CODE=123456
-D OFFLINE_QUEUE_SIZE=256
; -D BLE_DEBUG_LOGGING=1
; -D MESH_PACKET_LOGGING=1
build_src_filter = ${ThinkNode_M9.build_src_filter}
+<helpers/esp32/*.cpp>
+<helpers/ui/buzzer.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${ThinkNode_M9.lib_deps}
densaugeo/base64 @ ~1.4.0
end2endzone/NonBlockingRTTTL@^1.3.0

[env:ThinkNode_M9_companion_radio_usb_]
extends = ThinkNode_M9
build_flags =
${ThinkNode_M9.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D OFFLINE_QUEUE_SIZE=256
build_src_filter = ${ThinkNode_M9.build_src_filter}
+<helpers/esp32/*.cpp>
+<helpers/ui/buzzer.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${ThinkNode_M9.lib_deps}
densaugeo/base64 @ ~1.4.0
end2endzone/NonBlockingRTTTL@^1.3.0

[env:ThinkNode_M9_companion_radio_wifi_]
extends = ThinkNode_M9
build_flags =
${ThinkNode_M9.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D OFFLINE_QUEUE_SIZE=256
; -D MESH_PACKET_LOGGING=1
build_src_filter = ${ThinkNode_M9.build_src_filter}
+<helpers/esp32/*.cpp>
+<helpers/ui/buzzer.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${ThinkNode_M9.lib_deps}
densaugeo/base64 @ ~1.4.0
end2endzone/NonBlockingRTTTL@^1.3.0

[env:ThinkNode_M9_kiss_modem]
extends = ThinkNode_M9
build_src_filter = ${ThinkNode_M9.build_src_filter}
+<../examples/kiss_modem/>
Loading
Loading