Added basic support for Station G2
This commit is contained in:
43
boards/station-g2.json
Normal file
43
boards/station-g2.json
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"memory_type": "qio_opi"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DBOARD_HAS_PSRAM",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DARDUINO_USB_MODE=0",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=0"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [["0x303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "esp32s3"
|
||||||
|
},
|
||||||
|
"connectivity": [
|
||||||
|
"wifi"
|
||||||
|
],
|
||||||
|
"debug": {
|
||||||
|
"default_tool": "esp-builtin",
|
||||||
|
"onboard_tools": ["esp-builtin"],
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "BQ Station G2",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "16MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 16777216,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://wiki.uniteng.com/en/meshtastic/station-g2",
|
||||||
|
"vendor": "BQ Consulting"
|
||||||
|
}
|
||||||
@@ -76,10 +76,14 @@
|
|||||||
#include <helpers/ESP32Board.h>
|
#include <helpers/ESP32Board.h>
|
||||||
#include <helpers/CustomSX1262Wrapper.h>
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
static ESP32Board board;
|
static ESP32Board board;
|
||||||
#elif defined(LILYGO_TLORA)
|
#elif defined(LILYGO_TLORA)
|
||||||
#include <helpers/LilyGoTLoraBoard.h>
|
#include <helpers/LilyGoTLoraBoard.h>
|
||||||
#include <helpers/CustomSX1276Wrapper.h>
|
#include <helpers/CustomSX1276Wrapper.h>
|
||||||
static LilyGoTLoraBoard board;
|
static LilyGoTLoraBoard board;
|
||||||
|
#elif defined(STATION_G2)
|
||||||
|
#include <helpers/StationG2Board.h>
|
||||||
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
|
static StationG2Board board;
|
||||||
#elif defined(RAK_4631)
|
#elif defined(RAK_4631)
|
||||||
#include <helpers/nrf52/RAK4631Board.h>
|
#include <helpers/nrf52/RAK4631Board.h>
|
||||||
#include <helpers/CustomSX1262Wrapper.h>
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
|
|||||||
@@ -84,6 +84,10 @@
|
|||||||
#include <helpers/LilyGoTLoraBoard.h>
|
#include <helpers/LilyGoTLoraBoard.h>
|
||||||
#include <helpers/CustomSX1276Wrapper.h>
|
#include <helpers/CustomSX1276Wrapper.h>
|
||||||
static LilyGoTLoraBoard board;
|
static LilyGoTLoraBoard board;
|
||||||
|
#elif defined(STATION_G2)
|
||||||
|
#include <helpers/StationG2Board.h>
|
||||||
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
|
static StationG2Board board;
|
||||||
#elif defined(RAK_4631)
|
#elif defined(RAK_4631)
|
||||||
#include <helpers/nrf52/RAK4631Board.h>
|
#include <helpers/nrf52/RAK4631Board.h>
|
||||||
#include <helpers/CustomSX1262Wrapper.h>
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
|
|||||||
303
platformio.ini
303
platformio.ini
@@ -22,7 +22,9 @@ build_flags = -w -DNDEBUG -DRADIOLIB_STATIC_ONLY=1 -DRADIOLIB_GODMODE=1
|
|||||||
-D LORA_FREQ=867.5
|
-D LORA_FREQ=867.5
|
||||||
-D LORA_BW=250
|
-D LORA_BW=250
|
||||||
-D LORA_SF=10
|
-D LORA_SF=10
|
||||||
build_src_filter = +<*.cpp> +<helpers/*.cpp>
|
build_src_filter =
|
||||||
|
+<*.cpp>
|
||||||
|
+<helpers/*.cpp>
|
||||||
|
|
||||||
[esp32_base]
|
[esp32_base]
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
@@ -54,7 +56,8 @@ build_flags =
|
|||||||
-D ADMIN_PASSWORD="\"password\""
|
-D ADMIN_PASSWORD="\"password\""
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Heltec_lora32_v2.build_src_filter} +<../examples/simple_repeater/main.cpp>
|
build_src_filter = ${Heltec_lora32_v2.build_src_filter}
|
||||||
|
+<../examples/simple_repeater/main.cpp>
|
||||||
|
|
||||||
[env:Heltec_v2_terminal_chat]
|
[env:Heltec_v2_terminal_chat]
|
||||||
extends = Heltec_lora32_v2
|
extends = Heltec_lora32_v2
|
||||||
@@ -64,7 +67,8 @@ build_flags =
|
|||||||
-D MAX_GROUP_CHANNELS=1
|
-D MAX_GROUP_CHANNELS=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Heltec_lora32_v2.build_src_filter} +<../examples/simple_secure_chat/main.cpp>
|
build_src_filter = ${Heltec_lora32_v2.build_src_filter}
|
||||||
|
+<../examples/simple_secure_chat/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${Heltec_lora32_v2.lib_deps}
|
${Heltec_lora32_v2.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -77,7 +81,9 @@ build_flags =
|
|||||||
-D MAX_GROUP_CHANNELS=1
|
-D MAX_GROUP_CHANNELS=1
|
||||||
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
||||||
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Heltec_lora32_v2.build_src_filter} +<helpers/esp32/*.cpp> +<../examples/companion_radio/main.cpp>
|
build_src_filter = ${Heltec_lora32_v2.build_src_filter}
|
||||||
|
+<helpers/esp32/*.cpp>
|
||||||
|
+<../examples/companion_radio/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${Heltec_lora32_v2.lib_deps}
|
${Heltec_lora32_v2.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -94,7 +100,9 @@ build_flags =
|
|||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Heltec_lora32_v2.build_src_filter} +<helpers/esp32/*.cpp> +<../examples/companion_radio/main.cpp>
|
build_src_filter = ${Heltec_lora32_v2.build_src_filter}
|
||||||
|
+<helpers/esp32/*.cpp>
|
||||||
|
+<../examples/companion_radio/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${Heltec_lora32_v2.lib_deps}
|
${Heltec_lora32_v2.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -133,11 +141,15 @@ build_flags =
|
|||||||
-D ADMIN_PASSWORD="\"password\""
|
-D ADMIN_PASSWORD="\"password\""
|
||||||
-D MESH_PACKET_LOGGING=1
|
-D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter} +<helpers/ui/*.cpp> +<../examples/simple_repeater>
|
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||||
|
+<helpers/ui/*.cpp>
|
||||||
|
+<../examples/simple_repeater>
|
||||||
|
|
||||||
[env:Heltec_v3_room_server]
|
[env:Heltec_v3_room_server]
|
||||||
extends = Heltec_lora32_v3
|
extends = Heltec_lora32_v3
|
||||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter} +<helpers/ui/*.cpp> +<../examples/simple_room_server>
|
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||||
|
+<helpers/ui/*.cpp>
|
||||||
|
+<../examples/simple_room_server>
|
||||||
build_flags =
|
build_flags =
|
||||||
${Heltec_lora32_v3.build_flags}
|
${Heltec_lora32_v3.build_flags}
|
||||||
-D DISPLAY_CLASS=SSD1306Display
|
-D DISPLAY_CLASS=SSD1306Display
|
||||||
@@ -157,7 +169,8 @@ build_flags =
|
|||||||
-D MAX_GROUP_CHANNELS=1
|
-D MAX_GROUP_CHANNELS=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter} +<../examples/simple_secure_chat/main.cpp>
|
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||||
|
+<../examples/simple_secure_chat/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${Heltec_lora32_v3.lib_deps}
|
${Heltec_lora32_v3.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -173,7 +186,9 @@ build_flags =
|
|||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
||||||
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter} +<helpers/ui/*.cpp> +<../examples/companion_radio>
|
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||||
|
+<helpers/ui/*.cpp>
|
||||||
|
+<../examples/companion_radio>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${Heltec_lora32_v3.lib_deps}
|
${Heltec_lora32_v3.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -191,7 +206,10 @@ build_flags =
|
|||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter} +<helpers/ui/*.cpp> +<helpers/esp32/*.cpp> +<../examples/companion_radio>
|
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||||
|
+<helpers/ui/*.cpp>
|
||||||
|
+<helpers/esp32/*.cpp>
|
||||||
|
+<../examples/companion_radio>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${Heltec_lora32_v3.lib_deps}
|
${Heltec_lora32_v3.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -208,7 +226,9 @@ build_flags =
|
|||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter} +<helpers/esp32/*.cpp> +<../examples/companion_radio>
|
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||||
|
+<helpers/esp32/*.cpp>
|
||||||
|
+<../examples/companion_radio>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${Heltec_lora32_v3.lib_deps}
|
${Heltec_lora32_v3.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -227,7 +247,10 @@ build_flags =
|
|||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter} +<helpers/ui/*.cpp> +<helpers/esp32/*.cpp> +<../examples/companion_radio>
|
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||||
|
+<helpers/ui/*.cpp>
|
||||||
|
+<helpers/esp32/*.cpp>
|
||||||
|
+<../examples/companion_radio>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${Heltec_lora32_v3.lib_deps}
|
${Heltec_lora32_v3.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -253,7 +276,8 @@ build_flags =
|
|||||||
|
|
||||||
[env:Xiao_C3_Repeater_sx1262]
|
[env:Xiao_C3_Repeater_sx1262]
|
||||||
extends = Xiao_esp32_C3
|
extends = Xiao_esp32_C3
|
||||||
build_src_filter = ${Xiao_esp32_C3.build_src_filter} +<../examples/simple_repeater/main.cpp>
|
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
|
||||||
|
+<../examples/simple_repeater/main.cpp>
|
||||||
build_flags =
|
build_flags =
|
||||||
${Xiao_esp32_C3.build_flags}
|
${Xiao_esp32_C3.build_flags}
|
||||||
-D RADIO_CLASS=CustomSX1262
|
-D RADIO_CLASS=CustomSX1262
|
||||||
@@ -268,7 +292,8 @@ build_flags =
|
|||||||
|
|
||||||
[env:Xiao_C3_Repeater_sx1268]
|
[env:Xiao_C3_Repeater_sx1268]
|
||||||
extends = Xiao_esp32_C3
|
extends = Xiao_esp32_C3
|
||||||
build_src_filter = ${Xiao_esp32_C3.build_src_filter} +<../examples/simple_repeater/main.cpp>
|
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
|
||||||
|
+<../examples/simple_repeater/main.cpp>
|
||||||
build_flags =
|
build_flags =
|
||||||
${Xiao_esp32_C3.build_flags}
|
${Xiao_esp32_C3.build_flags}
|
||||||
-D RADIO_CLASS=CustomSX1268
|
-D RADIO_CLASS=CustomSX1268
|
||||||
@@ -305,7 +330,8 @@ build_flags = ${esp32_base.build_flags}
|
|||||||
|
|
||||||
[env:Xiao_S3_WIO_Repeater]
|
[env:Xiao_S3_WIO_Repeater]
|
||||||
extends = Xiao_S3_WIO
|
extends = Xiao_S3_WIO
|
||||||
build_src_filter = ${Xiao_S3_WIO.build_src_filter} +<../examples/simple_repeater/main.cpp>
|
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
|
||||||
|
+<../examples/simple_repeater/main.cpp>
|
||||||
build_flags =
|
build_flags =
|
||||||
${Xiao_S3_WIO.build_flags}
|
${Xiao_S3_WIO.build_flags}
|
||||||
-D ADVERT_NAME="\"XiaoS3 Repeater\""
|
-D ADVERT_NAME="\"XiaoS3 Repeater\""
|
||||||
@@ -323,7 +349,8 @@ build_flags =
|
|||||||
-D MAX_GROUP_CHANNELS=1
|
-D MAX_GROUP_CHANNELS=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Xiao_S3_WIO.build_src_filter} +<../examples/simple_secure_chat/main.cpp>
|
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
|
||||||
|
+<../examples/simple_secure_chat/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${Xiao_S3_WIO.lib_deps}
|
${Xiao_S3_WIO.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -340,7 +367,9 @@ build_flags =
|
|||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Xiao_S3_WIO.build_src_filter} +<helpers/esp32/*.cpp> +<../examples/companion_radio/main.cpp>
|
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
|
||||||
|
+<helpers/esp32/*.cpp>
|
||||||
|
+<../examples/companion_radio/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${Xiao_S3_WIO.lib_deps}
|
${Xiao_S3_WIO.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -370,6 +399,84 @@ build_flags =
|
|||||||
-D WRAPPER_CLASS=CustomSX1276Wrapper
|
-D WRAPPER_CLASS=CustomSX1276Wrapper
|
||||||
-D LORA_TX_POWER=20
|
-D LORA_TX_POWER=20
|
||||||
|
|
||||||
|
; === LILYGO T-LoRa V2.1-1.6 with SX1276 environments ===
|
||||||
|
[env:LilyGo_TLora_V2_1_1_6_Repeater]
|
||||||
|
extends = LilyGo_TLora_V2_1_1_6
|
||||||
|
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
|
||||||
|
+<../examples/simple_repeater/main.cpp>
|
||||||
|
build_flags =
|
||||||
|
${LilyGo_TLora_V2_1_1_6.build_flags}
|
||||||
|
-D ADVERT_NAME="\"TLora-V2.1-1.6 Repeater\""
|
||||||
|
-D ADVERT_LAT=-37.0
|
||||||
|
-D ADVERT_LON=145.0
|
||||||
|
-D ADMIN_PASSWORD="\"password\""
|
||||||
|
; -D MESH_PACKET_LOGGING=1
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
; -D CORE_DEBUG_LEVEL=3
|
||||||
|
|
||||||
|
[env:LilyGo_TLora_V2_1_1_6_terminal_chat]
|
||||||
|
extends = LilyGo_TLora_V2_1_1_6
|
||||||
|
build_flags =
|
||||||
|
${LilyGo_TLora_V2_1_1_6.build_flags}
|
||||||
|
-D MAX_CONTACTS=100
|
||||||
|
-D MAX_GROUP_CHANNELS=1
|
||||||
|
; -D MESH_PACKET_LOGGING=1
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
|
||||||
|
+<../examples/simple_secure_chat/main.cpp>
|
||||||
|
lib_deps =
|
||||||
|
${LilyGo_TLora_V2_1_1_6.lib_deps}
|
||||||
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
|
||||||
|
[env:LilyGo_TLora_V2_1_1_6_companion_radio_usb]
|
||||||
|
extends = LilyGo_TLora_V2_1_1_6
|
||||||
|
build_flags =
|
||||||
|
${LilyGo_TLora_V2_1_1_6.build_flags}
|
||||||
|
-D MAX_CONTACTS=100
|
||||||
|
-D MAX_GROUP_CHANNELS=1
|
||||||
|
; -D ENABLE_PRIVATE_KEY_IMPORT=1
|
||||||
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
|
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
||||||
|
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
||||||
|
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
|
||||||
|
+<../examples/companion_radio/main.cpp>
|
||||||
|
lib_deps =
|
||||||
|
${LilyGo_TLora_V2_1_1_6.lib_deps}
|
||||||
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
|
||||||
|
[env:LilyGo_TLora_V2_1_1_6_companion_radio_ble]
|
||||||
|
extends = LilyGo_TLora_V2_1_1_6
|
||||||
|
build_flags =
|
||||||
|
${LilyGo_TLora_V2_1_1_6.build_flags}
|
||||||
|
-D MAX_CONTACTS=100
|
||||||
|
-D MAX_GROUP_CHANNELS=1
|
||||||
|
-D BLE_PIN_CODE=123456
|
||||||
|
; -D BLE_DEBUG_LOGGING=1
|
||||||
|
; -D ENABLE_PRIVATE_KEY_IMPORT=1
|
||||||
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
|
; -D MESH_PACKET_LOGGING=1
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
|
||||||
|
+<helpers/esp32/*.cpp>
|
||||||
|
+<../examples/companion_radio/main.cpp>
|
||||||
|
lib_deps =
|
||||||
|
${LilyGo_TLora_V2_1_1_6.lib_deps}
|
||||||
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
|
||||||
|
[env:LilyGo_TLora_V2_1_1_6_room_server]
|
||||||
|
extends = LilyGo_TLora_V2_1_1_6
|
||||||
|
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
|
||||||
|
+<../examples/simple_room_server/main.cpp>
|
||||||
|
build_flags =
|
||||||
|
${LilyGo_TLora_V2_1_1_6.build_flags}
|
||||||
|
-D ADVERT_NAME="\"TLora-V2.1-1.6 Room\""
|
||||||
|
-D ADVERT_LAT=-37.0
|
||||||
|
-D ADVERT_LON=145.0
|
||||||
|
-D ADMIN_PASSWORD="\"password\""
|
||||||
|
-D ROOM_PASSWORD="\"hello\""
|
||||||
|
; -D MESH_PACKET_LOGGING=1
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
|
||||||
; =============
|
; =============
|
||||||
[LilyGo_T3S3_sx1262]
|
[LilyGo_T3S3_sx1262]
|
||||||
extends = esp32_base
|
extends = esp32_base
|
||||||
@@ -392,83 +499,11 @@ build_flags = ${esp32_base.build_flags}
|
|||||||
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
||||||
-D LORA_TX_POWER=22
|
-D LORA_TX_POWER=22
|
||||||
|
|
||||||
|
|
||||||
; === LILYGO T-LoRa V2.1-1.6 with SX1276 environments ===
|
|
||||||
[env:LilyGo_TLora_V2_1_1_6_Repeater]
|
|
||||||
extends = LilyGo_TLora_V2_1_1_6
|
|
||||||
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} +<../examples/simple_repeater/main.cpp>
|
|
||||||
build_flags =
|
|
||||||
${LilyGo_TLora_V2_1_1_6.build_flags}
|
|
||||||
-D ADVERT_NAME="\"TLora-V2.1-1.6 Repeater\""
|
|
||||||
-D ADVERT_LAT=-37.0
|
|
||||||
-D ADVERT_LON=145.0
|
|
||||||
-D ADMIN_PASSWORD="\"password\""
|
|
||||||
; -D MESH_PACKET_LOGGING=1
|
|
||||||
; -D MESH_DEBUG=1
|
|
||||||
; -D CORE_DEBUG_LEVEL=3
|
|
||||||
|
|
||||||
[env:LilyGo_TLora_V2_1_1_6_terminal_chat]
|
|
||||||
extends = LilyGo_TLora_V2_1_1_6
|
|
||||||
build_flags =
|
|
||||||
${LilyGo_TLora_V2_1_1_6.build_flags}
|
|
||||||
-D MAX_CONTACTS=100
|
|
||||||
-D MAX_GROUP_CHANNELS=1
|
|
||||||
; -D MESH_PACKET_LOGGING=1
|
|
||||||
; -D MESH_DEBUG=1
|
|
||||||
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} +<../examples/simple_secure_chat/main.cpp>
|
|
||||||
lib_deps =
|
|
||||||
${LilyGo_TLora_V2_1_1_6.lib_deps}
|
|
||||||
densaugeo/base64 @ ~1.4.0
|
|
||||||
|
|
||||||
[env:LilyGo_TLora_V2_1_1_6_companion_radio_usb]
|
|
||||||
extends = LilyGo_TLora_V2_1_1_6
|
|
||||||
build_flags =
|
|
||||||
${LilyGo_TLora_V2_1_1_6.build_flags}
|
|
||||||
-D MAX_CONTACTS=100
|
|
||||||
-D MAX_GROUP_CHANNELS=1
|
|
||||||
; -D ENABLE_PRIVATE_KEY_IMPORT=1
|
|
||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
|
||||||
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
|
||||||
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
|
||||||
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} +<../examples/companion_radio/main.cpp>
|
|
||||||
lib_deps =
|
|
||||||
${LilyGo_TLora_V2_1_1_6.lib_deps}
|
|
||||||
densaugeo/base64 @ ~1.4.0
|
|
||||||
|
|
||||||
[env:LilyGo_TLora_V2_1_1_6_companion_radio_ble]
|
|
||||||
extends = LilyGo_TLora_V2_1_1_6
|
|
||||||
build_flags =
|
|
||||||
${LilyGo_TLora_V2_1_1_6.build_flags}
|
|
||||||
-D MAX_CONTACTS=100
|
|
||||||
-D MAX_GROUP_CHANNELS=1
|
|
||||||
-D BLE_PIN_CODE=123456
|
|
||||||
; -D BLE_DEBUG_LOGGING=1
|
|
||||||
; -D ENABLE_PRIVATE_KEY_IMPORT=1
|
|
||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
|
||||||
; -D MESH_PACKET_LOGGING=1
|
|
||||||
; -D MESH_DEBUG=1
|
|
||||||
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} +<helpers/esp32/*.cpp> +<../examples/companion_radio/main.cpp>
|
|
||||||
lib_deps =
|
|
||||||
${LilyGo_TLora_V2_1_1_6.lib_deps}
|
|
||||||
densaugeo/base64 @ ~1.4.0
|
|
||||||
|
|
||||||
[env:LilyGo_TLora_V2_1_1_6_room_server]
|
|
||||||
extends = LilyGo_TLora_V2_1_1_6
|
|
||||||
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} +<../examples/simple_room_server/main.cpp>
|
|
||||||
build_flags =
|
|
||||||
${LilyGo_TLora_V2_1_1_6.build_flags}
|
|
||||||
-D ADVERT_NAME="\"TLora-V2.1-1.6 Room\""
|
|
||||||
-D ADVERT_LAT=-37.0
|
|
||||||
-D ADVERT_LON=145.0
|
|
||||||
-D ADMIN_PASSWORD="\"password\""
|
|
||||||
-D ROOM_PASSWORD="\"hello\""
|
|
||||||
; -D MESH_PACKET_LOGGING=1
|
|
||||||
; -D MESH_DEBUG=1
|
|
||||||
|
|
||||||
; === LilyGo T3S3 with SX1262 environments ===
|
; === LilyGo T3S3 with SX1262 environments ===
|
||||||
[env:LilyGo_T3S3_sx1262_Repeater]
|
[env:LilyGo_T3S3_sx1262_Repeater]
|
||||||
extends = LilyGo_T3S3_sx1262
|
extends = LilyGo_T3S3_sx1262
|
||||||
build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} +<../examples/simple_repeater/main.cpp>
|
build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter}
|
||||||
|
+<../examples/simple_repeater/main.cpp>
|
||||||
build_flags =
|
build_flags =
|
||||||
${LilyGo_T3S3_sx1262.build_flags}
|
${LilyGo_T3S3_sx1262.build_flags}
|
||||||
-D ADVERT_NAME="\"T3S3-1262 Repeater\""
|
-D ADVERT_NAME="\"T3S3-1262 Repeater\""
|
||||||
@@ -486,7 +521,8 @@ build_flags =
|
|||||||
-D MAX_GROUP_CHANNELS=1
|
-D MAX_GROUP_CHANNELS=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} +<../examples/simple_secure_chat/main.cpp>
|
build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter}
|
||||||
|
+<../examples/simple_secure_chat/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${LilyGo_T3S3_sx1262.lib_deps}
|
${LilyGo_T3S3_sx1262.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -501,7 +537,8 @@ build_flags =
|
|||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
||||||
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
||||||
build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} +<../examples/companion_radio/main.cpp>
|
build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter}
|
||||||
|
+<../examples/companion_radio/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${LilyGo_T3S3_sx1262.lib_deps}
|
${LilyGo_T3S3_sx1262.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -518,11 +555,59 @@ build_flags =
|
|||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} +<helpers/esp32/*.cpp> +<../examples/companion_radio/main.cpp>
|
build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter}
|
||||||
|
+<helpers/esp32/*.cpp>
|
||||||
|
+<../examples/companion_radio/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${LilyGo_T3S3_sx1262.lib_deps}
|
${LilyGo_T3S3_sx1262.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
|
||||||
|
[Station_G2]
|
||||||
|
extends = esp32_base
|
||||||
|
board = station-g2
|
||||||
|
build_flags =
|
||||||
|
${esp32_base.build_flags}
|
||||||
|
-D STATION_G2
|
||||||
|
-D RADIO_CLASS=CustomSX1262
|
||||||
|
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
||||||
|
-D LORA_TX_POWER=7
|
||||||
|
; -D P_LORA_TX_LED=35
|
||||||
|
; -D PIN_BOARD_SDA=5
|
||||||
|
; -D PIN_BOARD_SCL=6
|
||||||
|
-D PIN_USER_BTN=0
|
||||||
|
-D SX126X_DIO2_AS_RF_SWITCH=true
|
||||||
|
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
||||||
|
-D SX126X_CURRENT_LIMIT=130.0f ; for best TX power!
|
||||||
|
build_src_filter = ${esp32_base.build_src_filter}
|
||||||
|
lib_deps =
|
||||||
|
${esp32_base.lib_deps}
|
||||||
|
|
||||||
|
[env:Station_G2_repeater]
|
||||||
|
extends = Station_G2
|
||||||
|
build_flags =
|
||||||
|
${Station_G2.build_flags}
|
||||||
|
-D ADVERT_NAME="\"Station G2 Repeater\""
|
||||||
|
-D ADVERT_LAT=-37.0
|
||||||
|
-D ADVERT_LON=145.0
|
||||||
|
-D ADMIN_PASSWORD="\"password\""
|
||||||
|
-D MESH_PACKET_LOGGING=1
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
build_src_filter = ${Station_G2.build_src_filter}
|
||||||
|
+<../examples/simple_repeater>
|
||||||
|
|
||||||
|
[env:Station_G2_room_server]
|
||||||
|
extends = Station_G2
|
||||||
|
build_src_filter = ${Station_G2.build_src_filter}
|
||||||
|
+<../examples/simple_room_server>
|
||||||
|
build_flags =
|
||||||
|
${Station_G2.build_flags}
|
||||||
|
-D ADVERT_NAME="\"Station G2 Room\""
|
||||||
|
-D ADVERT_LAT=-37.0
|
||||||
|
-D ADVERT_LON=145.0
|
||||||
|
-D ADMIN_PASSWORD="\"password\""
|
||||||
|
-D ROOM_PASSWORD="\"hello\""
|
||||||
|
; -D MESH_PACKET_LOGGING=1
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
|
||||||
; ----------------- NRF52 ---------------------
|
; ----------------- NRF52 ---------------------
|
||||||
[nrf52_base]
|
[nrf52_base]
|
||||||
@@ -544,7 +629,8 @@ extends = nrf52840_base
|
|||||||
platform = https://github.com/maxgerhardt/platform-nordicnrf52.git#rak
|
platform = https://github.com/maxgerhardt/platform-nordicnrf52.git#rak
|
||||||
board = wiscore_rak4631
|
board = wiscore_rak4631
|
||||||
board_check = true
|
board_check = true
|
||||||
build_src_filter = ${nrf52840_base.build_src_filter} +<helpers/nrf52/*.cpp>
|
build_src_filter = ${nrf52840_base.build_src_filter}
|
||||||
|
+<helpers/nrf52/*.cpp>
|
||||||
build_flags = ${nrf52840_base.build_flags}
|
build_flags = ${nrf52840_base.build_flags}
|
||||||
-D RAK_4631
|
-D RAK_4631
|
||||||
-D RADIO_CLASS=CustomSX1262
|
-D RADIO_CLASS=CustomSX1262
|
||||||
@@ -554,7 +640,8 @@ build_flags = ${nrf52840_base.build_flags}
|
|||||||
|
|
||||||
[env:RAK_4631_Repeater]
|
[env:RAK_4631_Repeater]
|
||||||
extends = rak4631
|
extends = rak4631
|
||||||
build_src_filter = ${rak4631.build_src_filter} +<../examples/simple_repeater/main.cpp>
|
build_src_filter = ${rak4631.build_src_filter}
|
||||||
|
+<../examples/simple_repeater/main.cpp>
|
||||||
build_flags =
|
build_flags =
|
||||||
${rak4631.build_flags}
|
${rak4631.build_flags}
|
||||||
-D ADVERT_NAME="\"RAK4631 Repeater\""
|
-D ADVERT_NAME="\"RAK4631 Repeater\""
|
||||||
@@ -566,7 +653,8 @@ build_flags =
|
|||||||
|
|
||||||
[env:RAK_4631_room_server]
|
[env:RAK_4631_room_server]
|
||||||
extends = rak4631
|
extends = rak4631
|
||||||
build_src_filter = ${rak4631.build_src_filter} +<../examples/simple_room_server/main.cpp>
|
build_src_filter = ${rak4631.build_src_filter}
|
||||||
|
+<../examples/simple_room_server/main.cpp>
|
||||||
build_flags =
|
build_flags =
|
||||||
${rak4631.build_flags}
|
${rak4631.build_flags}
|
||||||
-D ADVERT_NAME="\"Test Room\""
|
-D ADVERT_NAME="\"Test Room\""
|
||||||
@@ -585,7 +673,8 @@ build_flags =
|
|||||||
-D MAX_GROUP_CHANNELS=1
|
-D MAX_GROUP_CHANNELS=1
|
||||||
-D MESH_PACKET_LOGGING=1
|
-D MESH_PACKET_LOGGING=1
|
||||||
-D MESH_DEBUG=1
|
-D MESH_DEBUG=1
|
||||||
build_src_filter = ${rak4631.build_src_filter} +<../examples/simple_secure_chat/main.cpp>
|
build_src_filter = ${rak4631.build_src_filter}
|
||||||
|
+<../examples/simple_secure_chat/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${rak4631.lib_deps}
|
${rak4631.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -600,7 +689,8 @@ build_flags =
|
|||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
||||||
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
||||||
build_src_filter = ${rak4631.build_src_filter} +<../examples/companion_radio/main.cpp>
|
build_src_filter = ${rak4631.build_src_filter}
|
||||||
|
+<../examples/companion_radio/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${rak4631.lib_deps}
|
${rak4631.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -617,7 +707,9 @@ build_flags =
|
|||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${rak4631.build_src_filter} +<helpers/nrf52/*.cpp> +<../examples/companion_radio/main.cpp>
|
build_src_filter = ${rak4631.build_src_filter}
|
||||||
|
+<helpers/nrf52/*.cpp>
|
||||||
|
+<../examples/companion_radio/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${rak4631.lib_deps}
|
${rak4631.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -702,7 +794,8 @@ upload_protocol = nrfutil
|
|||||||
|
|
||||||
[env:Heltec_t114_repeater]
|
[env:Heltec_t114_repeater]
|
||||||
extends = Heltec_t114
|
extends = Heltec_t114
|
||||||
build_src_filter = ${Heltec_t114.build_src_filter} +<../examples/simple_repeater/main.cpp>
|
build_src_filter = ${Heltec_t114.build_src_filter}
|
||||||
|
+<../examples/simple_repeater/main.cpp>
|
||||||
build_flags =
|
build_flags =
|
||||||
${Heltec_t114.build_flags}
|
${Heltec_t114.build_flags}
|
||||||
-D ADVERT_NAME="\"Heltec_T114 Repeater\""
|
-D ADVERT_NAME="\"Heltec_T114 Repeater\""
|
||||||
@@ -724,7 +817,9 @@ build_flags =
|
|||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${Heltec_t114.build_src_filter} +<helpers/nrf52/*.cpp> +<../examples/companion_radio/main.cpp>
|
build_src_filter = ${Heltec_t114.build_src_filter}
|
||||||
|
+<helpers/nrf52/*.cpp>
|
||||||
|
+<../examples/companion_radio/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${Heltec_t114.lib_deps}
|
${Heltec_t114.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
@@ -782,7 +877,9 @@ build_flags =
|
|||||||
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
; -D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${LilyGo_Techo.build_src_filter} +<helpers/nrf52/*.cpp> +<../examples/companion_radio/main.cpp>
|
build_src_filter = ${LilyGo_Techo.build_src_filter}
|
||||||
|
+<helpers/nrf52/*.cpp>
|
||||||
|
+<../examples/companion_radio/main.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${LilyGo_Techo.lib_deps}
|
${LilyGo_Techo.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
|||||||
69
src/helpers/StationG2Board.h
Normal file
69
src/helpers/StationG2Board.h
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <Arduino.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>
|
||||||
|
|
||||||
|
class StationG2Board : public ESP32Board {
|
||||||
|
public:
|
||||||
|
void begin() {
|
||||||
|
ESP32Board::begin();
|
||||||
|
|
||||||
|
esp_reset_reason_t reason = esp_reset_reason();
|
||||||
|
if (reason == ESP_RST_DEEPSLEEP) {
|
||||||
|
long wakeup_source = esp_sleep_get_ext1_wakeup_status();
|
||||||
|
if (wakeup_source & (1 << P_LORA_DIO_1)) { // received a LoRa packet (while in deep sleep)
|
||||||
|
startup_reason = BD_STARTUP_RX_PACKET;
|
||||||
|
}
|
||||||
|
|
||||||
|
rtc_gpio_hold_dis((gpio_num_t)P_LORA_NSS);
|
||||||
|
rtc_gpio_deinit((gpio_num_t)P_LORA_DIO_1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1) {
|
||||||
|
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
|
||||||
|
|
||||||
|
// Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep
|
||||||
|
rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_1, RTC_GPIO_MODE_INPUT_ONLY);
|
||||||
|
rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_1);
|
||||||
|
|
||||||
|
rtc_gpio_hold_en((gpio_num_t)P_LORA_NSS);
|
||||||
|
|
||||||
|
if (pin_wake_btn < 0) {
|
||||||
|
esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet
|
||||||
|
} else {
|
||||||
|
esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1) | (1L << pin_wake_btn), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet OR wake btn
|
||||||
|
}
|
||||||
|
|
||||||
|
if (secs > 0) {
|
||||||
|
esp_sleep_enable_timer_wakeup(secs * 1000000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Finally set ESP32 into sleep
|
||||||
|
esp_deep_sleep_start(); // CPU halts here and never returns!
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t getBattMilliVolts() override {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* getManufacturerName() const override {
|
||||||
|
return "Station G2";
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user