move StationG2Board.h to variants, enable ESM, add companion wifi, cleanup
This commit is contained in:
@@ -1,22 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
#include <helpers/ESP32Board.h>
|
||||||
// LoRa radio module pins for Station G2
|
|
||||||
#define P_LORA_DIO_1 48
|
|
||||||
#define P_LORA_NSS 11
|
|
||||||
#define P_LORA_RESET 21
|
|
||||||
#define P_LORA_BUSY 47
|
|
||||||
#define P_LORA_SCLK 12
|
|
||||||
#define P_LORA_MISO 14
|
|
||||||
#define P_LORA_MOSI 13
|
|
||||||
|
|
||||||
// built-ins
|
|
||||||
//#define PIN_LED_BUILTIN 35
|
|
||||||
//#define PIN_VEXT_EN 36
|
|
||||||
|
|
||||||
#include "ESP32Board.h"
|
|
||||||
|
|
||||||
#include <driver/rtc_io.h>
|
#include <driver/rtc_io.h>
|
||||||
|
|
||||||
class StationG2Board : public ESP32Board {
|
class StationG2Board : public ESP32Board {
|
||||||
@@ -3,28 +3,40 @@ extends = esp32_base
|
|||||||
board = station-g2
|
board = station-g2
|
||||||
build_flags =
|
build_flags =
|
||||||
${esp32_base.build_flags}
|
${esp32_base.build_flags}
|
||||||
|
${sensor_base.build_flags}
|
||||||
-I variants/station_g2
|
-I variants/station_g2
|
||||||
|
-I src/helpers/ui
|
||||||
-D STATION_G2
|
-D STATION_G2
|
||||||
-D RADIO_CLASS=CustomSX1262
|
-D RADIO_CLASS=CustomSX1262
|
||||||
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
||||||
|
-D P_LORA_DIO_1=48
|
||||||
|
-D P_LORA_NSS=11
|
||||||
|
-D P_LORA_RESET=21
|
||||||
|
-D P_LORA_BUSY=47
|
||||||
|
-D P_LORA_SCLK=12
|
||||||
|
-D P_LORA_MISO=14
|
||||||
|
-D P_LORA_MOSI=13
|
||||||
-D LORA_TX_POWER=19
|
-D LORA_TX_POWER=19
|
||||||
; -D P_LORA_TX_LED=35
|
; -D P_LORA_TX_LED=35
|
||||||
-D PIN_BOARD_SDA=5
|
-D PIN_BOARD_SDA=5
|
||||||
-D PIN_BOARD_SCL=6
|
-D PIN_BOARD_SCL=6
|
||||||
-D PIN_USER_BTN=38
|
-D PIN_USER_BTN=38
|
||||||
|
-D PIN_GPS_RX=7
|
||||||
|
-D PIN_GPS_TX=15
|
||||||
-D SX126X_DIO2_AS_RF_SWITCH=true
|
-D SX126X_DIO2_AS_RF_SWITCH=true
|
||||||
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
||||||
-D SX126X_CURRENT_LIMIT=140
|
-D SX126X_CURRENT_LIMIT=140
|
||||||
; -D SX126X_RX_BOOSTED_GAIN=1 - DO NOT ENABLE THIS!
|
; -D SX126X_RX_BOOSTED_GAIN=1 - DO NOT ENABLE THIS!
|
||||||
; https://wiki.uniteng.com/en/meshtastic/station-g2#impact-of-lora-node-dense-areashigh-noise-environments-on-rf-performance
|
; https://wiki.uniteng.com/en/meshtastic/station-g2#impact-of-lora-node-dense-areashigh-noise-environments-on-rf-performance
|
||||||
-I src/helpers/ui
|
|
||||||
-D DISPLAY_CLASS=SH1106Display
|
-D DISPLAY_CLASS=SH1106Display
|
||||||
build_src_filter = ${esp32_base.build_src_filter}
|
build_src_filter = ${esp32_base.build_src_filter}
|
||||||
+<../variants/station_g2>
|
+<../variants/station_g2>
|
||||||
|
+<helpers/sensors>
|
||||||
+<helpers/ui/SH1106Display.cpp>
|
+<helpers/ui/SH1106Display.cpp>
|
||||||
+<helpers/ui/MomentaryButton.cpp>
|
+<helpers/ui/MomentaryButton.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${esp32_base.lib_deps}
|
${esp32_base.lib_deps}
|
||||||
|
${sensor_base.lib_deps}
|
||||||
adafruit/Adafruit SH110X @ ~2.1.13
|
adafruit/Adafruit SH110X @ ~2.1.13
|
||||||
adafruit/Adafruit GFX Library @ ^1.12.1
|
adafruit/Adafruit GFX Library @ ^1.12.1
|
||||||
|
|
||||||
@@ -172,7 +184,6 @@ extends = Station_G2
|
|||||||
build_flags =
|
build_flags =
|
||||||
${Station_G2.build_flags}
|
${Station_G2.build_flags}
|
||||||
-I examples/companion_radio/ui-new
|
-I examples/companion_radio/ui-new
|
||||||
-D DISPLAY_CLASS=SH1106Display
|
|
||||||
-D MAX_CONTACTS=300
|
-D MAX_CONTACTS=300
|
||||||
-D MAX_GROUP_CHANNELS=8
|
-D MAX_GROUP_CHANNELS=8
|
||||||
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
||||||
@@ -190,7 +201,6 @@ extends = Station_G2
|
|||||||
build_flags =
|
build_flags =
|
||||||
${Station_G2.build_flags}
|
${Station_G2.build_flags}
|
||||||
-I examples/companion_radio/ui-new
|
-I examples/companion_radio/ui-new
|
||||||
-D DISPLAY_CLASS=SH1106Display
|
|
||||||
-D MAX_CONTACTS=300
|
-D MAX_CONTACTS=300
|
||||||
-D MAX_GROUP_CHANNELS=8
|
-D MAX_GROUP_CHANNELS=8
|
||||||
-D BLE_PIN_CODE=123456
|
-D BLE_PIN_CODE=123456
|
||||||
@@ -205,3 +215,23 @@ build_src_filter = ${Station_G2.build_src_filter}
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${Station_G2.lib_deps}
|
${Station_G2.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
|
||||||
|
[env:Station_G2_companion_radio_wifi]
|
||||||
|
extends = Station_G2
|
||||||
|
build_flags =
|
||||||
|
${Station_G2.build_flags}
|
||||||
|
-I examples/companion_radio/ui-new
|
||||||
|
-D MAX_CONTACTS=300
|
||||||
|
-D MAX_GROUP_CHANNELS=8
|
||||||
|
-D WIFI_DEBUG_LOGGING=1
|
||||||
|
-D WIFI_SSID='"myssid"'
|
||||||
|
-D WIFI_PWD='"mypwd"'
|
||||||
|
; -D MESH_PACKET_LOGGING=1
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
build_src_filter = ${Station_G2.build_src_filter}
|
||||||
|
+<helpers/esp32/*.cpp>
|
||||||
|
+<../examples/companion_radio/*.cpp>
|
||||||
|
+<../examples/companion_radio/ui-new/*.cpp>
|
||||||
|
lib_deps =
|
||||||
|
${Station_G2.lib_deps}
|
||||||
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
|||||||
@@ -14,7 +14,14 @@ WRAPPER_CLASS radio_driver(radio, board);
|
|||||||
|
|
||||||
ESP32RTCClock fallback_clock;
|
ESP32RTCClock fallback_clock;
|
||||||
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
SensorManager sensors;
|
|
||||||
|
#if ENV_INCLUDE_GPS
|
||||||
|
#include <helpers/sensors/MicroNMEALocationProvider.h>
|
||||||
|
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1);
|
||||||
|
EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea);
|
||||||
|
#else
|
||||||
|
EnvironmentSensorManager sensors;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
DISPLAY_CLASS display;
|
DISPLAY_CLASS display;
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
#define RADIOLIB_STATIC_ONLY 1
|
#define RADIOLIB_STATIC_ONLY 1
|
||||||
#include <RadioLib.h>
|
#include <RadioLib.h>
|
||||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||||
#include <helpers/StationG2Board.h>
|
#include <StationG2Board.h>
|
||||||
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
||||||
#include <helpers/AutoDiscoverRTCClock.h>
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
#include <helpers/SensorManager.h>
|
#include <helpers/sensors/EnvironmentSensorManager.h>
|
||||||
|
|
||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
#include <helpers/ui/SH1106Display.h>
|
#include <helpers/ui/SH1106Display.h>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
extern StationG2Board board;
|
extern StationG2Board board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
extern AutoDiscoverRTCClock rtc_clock;
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
extern SensorManager sensors;
|
extern EnvironmentSensorManager sensors;
|
||||||
|
|
||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
extern DISPLAY_CLASS display;
|
extern DISPLAY_CLASS display;
|
||||||
|
|||||||
Reference in New Issue
Block a user