From 0ad5a66574c906ffd0b3b9678a18b7d6bf3dd857 Mon Sep 17 00:00:00 2001 From: Brenton Poke Date: Sun, 3 Nov 2024 00:28:29 -0400 Subject: [PATCH] wireless stick support Signed-off-by: Brenton Poke --- examples/1.Ducks/MamaDuck/platformio.ini | 10 + .../Custom-Mama-Example/platformio.ini | 185 ++++++++++++++++-- platformio.ini | 10 +- src/include/boards/ttgo-t-beam.h | 20 -- src/include/boards/wireless_stick_v3.h | 25 +++ src/include/cdpcfg.h | 1 + 6 files changed, 218 insertions(+), 33 deletions(-) delete mode 100644 src/include/boards/ttgo-t-beam.h create mode 100644 src/include/boards/wireless_stick_v3.h diff --git a/examples/1.Ducks/MamaDuck/platformio.ini b/examples/1.Ducks/MamaDuck/platformio.ini index c9689de4..19a81a1e 100644 --- a/examples/1.Ducks/MamaDuck/platformio.ini +++ b/examples/1.Ducks/MamaDuck/platformio.ini @@ -140,6 +140,16 @@ description = DuckLink CDP examples ${env:esp32.lib_deps} ${env:local_cdp.lib_deps} +[env:local_heltec_wireless_stick] + platform = espressif32 + board = heltec_wifi_lora_32_V3 + framework = arduino + monitor_speed = 115200 + monitor_filters = time + lib_deps = + ${env:esp32.lib_deps} + ${env:local_cdp.lib_deps} + ; LOCAL LILYGO_T_BEAM_SX1262 [env:local_lilygo_t_beam_sx1262] platform = espressif32 diff --git a/examples/3.Custom-Mama-Examples/Custom-Mama-Example/platformio.ini b/examples/3.Custom-Mama-Examples/Custom-Mama-Example/platformio.ini index c74d6e82..44a35451 100644 --- a/examples/3.Custom-Mama-Examples/Custom-Mama-Example/platformio.ini +++ b/examples/3.Custom-Mama-Examples/Custom-Mama-Example/platformio.ini @@ -8,18 +8,181 @@ ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html + +; Some useful platformio CLI commands to build and uplaod the example code. + +; using the released CDP library +; platformio run -e prod_heltec_wifi_lora_32_V3 -t upload + +; using the local CDP library +; platformio run -e local_heltec_wifi_lora_32_V3 -t upload + + [platformio] -src_dir = . + src_dir = . +;; uncomment the line below to build for your board + + default_envs = local_heltec_wifi_lora_32_V3 +; default_envs = local_heltec_wifi_lora_32_V3 +; default_envs = local_heltec_wifi_lora_32_V2 +; default_envs = local_ttgo_t_beam + +; default_envs = prod_heltec_wifi_lora_32_V3 +; default_envs = prod_heltec_wifi_lora_32_V2 +; default_envs = prod_ttgo_t_beam + +description = DuckLink CDP examples + +[env] + lib_deps = + WIRE + SPI + contrem/arduino-timer@^3.0.1 + bblanchon/ArduinoJson@^7.0.3 + +[env:esp32] + lib_deps = + +[env:local_cdp] + lib_deps = symlink://../../../ ; local CDP library + +[env:release_cdp] + lib_deps = + https://github.com/ClusterDuck-Protocol/ClusterDuck-Protocol ; CDP from master branch + + +; ------------------------------------------------------------------------------------------------------- +; ---- PRODUCTION ENVIRONMENTS +; ------------------------------------------------------------------------------------------------------- + + +; PRODUCTION HELTEC_WIFI_LORA_32_V2 +[env:prod_heltec_wifi_lora_32_V2] + platform = espressif32 + board = heltec_wifi_lora_32_V2 + framework = arduino + monitor_speed = 115200 + monitor_filters = time + lib_deps = + ${env:esp32.lib_deps} + ${env:release_cdp.lib_deps} + +; PRODUCTION HELTEC_WIFI_LORA_32_V3 +[env:prod_heltec_wifi_lora_32_V3] + platform = espressif32 + board = heltec_wifi_lora_32_V3 + framework = arduino + monitor_speed = 115200 + monitor_filters = time + lib_deps = + ${env:esp32.lib_deps} + ${env:release_cdp.lib_deps} + +; PRODUCTION LILYGO_T_BEAM_SX1262 +[env:prod_lilygo_t_beam_sx1262] + platform = espressif32 + board = ttgo-t-beam + framework = arduino + monitor_speed = 115200 + monitor_filters = time + lib_deps = + ${env:esp32.lib_deps} + ${env:release_cdp.lib_deps} + +; PRODUCTION TTGO_LORA32_V1 +[env:prod_ttgo_lora32_v1] + platform = espressif32 + board = ttgo-lora32-v1 + framework = arduino + monitor_speed = 115200 + monitor_filters = time + lib_deps = + ${env:esp32.lib_deps} + ${env:release_cdp.lib_deps} + +; PRODUCTION CUBECELL_BOARD_V2 +[env:prod_cubecell_board_v2] + platform = https://github.com/HelTecAutomation/heltec-cubecell.git + board = cubecell_board_v2 + framework = arduino + monitor_speed = 115200 + monitor_filters = time + build_flags = + -DCubeCell_Board + lib_ignore = + ESP Async WebServer + lib_deps = + ${env:release_cdp.lib_deps} + +; ------------------------------------------------------------------------------------------------------- +; ---- LOCAL ENVIRONMENTS +; ------------------------------------------------------------------------------------------------------- + +; LOCAL HELTEC_WIFI_LORA_32_V2 +[env:local_heltec_wifi_lora_32_V2] + platform = espressif32 + board = heltec_wifi_lora_32_V2 + framework = arduino + monitor_speed = 115200 + monitor_filters = time + lib_deps = + ${env:esp32.lib_deps} + ${env:local_cdp.lib_deps} + +; LOCAL HELTEC_WIFI_LORA_32_V3 +[env:local_heltec_wifi_lora_32_V3] + platform = espressif32 + board = heltec_wifi_lora_32_V3 + framework = arduino + monitor_speed = 115200 + monitor_filters = time + lib_deps = + ${env:esp32.lib_deps} + ${env:local_cdp.lib_deps} + +[env:local_heltec_wireless_stick] + platform = espressif32 + board = heltec_wifi_lora_32_V3 + framework = arduino + monitor_speed = 115200 + monitor_filters = time + lib_deps = + ${env:esp32.lib_deps} + ${env:local_cdp.lib_deps} + +; LOCAL LILYGO_T_BEAM_SX1262 +[env:local_lilygo_t_beam_sx1262] + platform = espressif32 + board = ttgo-t-beam + framework = arduino + monitor_speed = 115200 + monitor_filters = time + lib_deps = + ${env:esp32.lib_deps} + ${env:local_cdp.lib_deps} -[env:heltec_wifi_lora_32_V2] -platform = espressif32 -board = heltec_wifi_lora_32_V2 -framework = arduino -monitor_speed = 115200 -monitor_filters = time +; LOCAL TTGO_LORA32_V1 +[env:local_ttgo_lora32_v1] + platform = espressif32 + board = ttgo-lora32-v1 + framework = arduino + monitor_speed = 115200 + monitor_filters = time + lib_deps = + ${env:esp32.lib_deps} + ${env:local_cdp.lib_deps} -lib_deps = - https://github.com/Call-for-Code/ClusterDuck-Protocol +; LOCAL CUBECELL_BOARD_V2 +[env:local_cubecell_board_v2] + platform = https://github.com/HelTecAutomation/heltec-cubecell.git + board = cubecell_board_v2 + framework = arduino + monitor_speed = 115200 + monitor_filters = time + build_flags = + -DCubeCell_Board + lib_ignore = + ESP Async WebServer + lib_deps = + ${env:local_cdp.lib_deps} -; uncomment for OTA update -; upload_port = duck.local diff --git a/platformio.ini b/platformio.ini index ff1fe083..0b0fa5df 100644 --- a/platformio.ini +++ b/platformio.ini @@ -22,9 +22,10 @@ [platformio] -; default_envs = heltec_wifi_lora_32_V3 + default_envs = heltec_wifi_lora_32_V3 ; default_envs = heltec_wifi_lora_32_V2 - default_envs = lilygo_t_beam_sx1262 +; default_envs = heltec_wireless_stick +; default_envs = lilygo_t_beam_sx1262 ; default_envs = cubecell_gps ; default_envs = cubecell_board_v2 ; default_envs = ttgo_lora32_v1 @@ -145,6 +146,11 @@ ${cubecell_base.build_flags} -DCubeCell_Board +[env:heltec_wireless_stick] + extends = esp32_base + board = heltec_wifi_lora_32_V3 + build_flags = + ${env.build_flags} ;;-------------------------------------------------------------------------------- ;; test environments ;;-------------------------------------------------------------------------------- diff --git a/src/include/boards/ttgo-t-beam.h b/src/include/boards/ttgo-t-beam.h deleted file mode 100644 index f30e55ee..00000000 --- a/src/include/boards/ttgo-t-beam.h +++ /dev/null @@ -1,20 +0,0 @@ -#define CDPCFG_PIN_BAT 35 -#define CDPCFG_BAT_MULDIV 200 / 100 - -#define CDPCFG_PIN_LED1 25 - -// LoRa configuration -#define CDPCFG_PIN_LORA_CS 18 -#define CDPCFG_PIN_LORA_DIO0 26 -#define CDPCFG_PIN_LORA_DIO1 -1 -#define CDPCFG_PIN_LORA_RST 14 - -//GPS configuration -#define CDPCFG_GPS_RX 34 -#define CDPCFG_GPS_TX 12 - -// OLED display settings -#define CDPCFG_PIN_OLED_CLOCK 22 -#define CDPCFG_PIN_OLED_DATA 21 -#define CDPCFG_PIN_OLED_RESET 16 -#define CDPCFG_PIN_OLED_ROTATION U8G2_R0 diff --git a/src/include/boards/wireless_stick_v3.h b/src/include/boards/wireless_stick_v3.h new file mode 100644 index 00000000..331e742f --- /dev/null +++ b/src/include/boards/wireless_stick_v3.h @@ -0,0 +1,25 @@ +#pragma once +#ifdef ARDUINO_HELTEC_WIRELESS_STICK +#define CDPCFG_PIN_BAT 1 +//#define CDPCFG_BAT_MULDIV 200 / 100 +#define CDPCFG_PIN_VEXT 36 +#define CDPCFG_PIN_LED1 35 +#define CDPCFG_OLED_64x32 + +// LoRa configuration +#define CDPCFG_PIN_LORA_CS 8 +#define CDPCFG_PIN_LORA_DIO0 14 +#define CDPCFG_PIN_LORA_DIO1 14 +#define CDPCFG_PIN_LORA_RST 12 +#define CDPCFG_PIN_LORA_BUSY 13 + +//GPS configuration +//#define CDPCFG_GPS_RX 34 +//#define CDPCFG_GPS_TX 12 + +// OLED display settings +#define CDPCFG_PIN_OLED_CLOCK 18 +#define CDPCFG_PIN_OLED_DATA 17 +#define CDPCFG_PIN_OLED_RESET 21 +#define CDPCFG_PIN_OLED_ROTATION U8G2_R0 +#endif \ No newline at end of file diff --git a/src/include/cdpcfg.h b/src/include/cdpcfg.h index 3c0e2fc0..c5d3f6ca 100644 --- a/src/include/cdpcfg.h +++ b/src/include/cdpcfg.h @@ -16,6 +16,7 @@ #include "cdp_external_board.h" #else #include "boards/heltec_wifi_lora_32_V3.h" +#include "boards/wireless_stick_v3.h" #include "boards/heltec_wifi_lora_32_V2.h" #include "boards/lilygo_t_beam_sx1262.h" #include "boards/ttgo_t_beam_v1_sx1276.h"