From 2b965302b2d68a5fe7827969d290a53a739a998c Mon Sep 17 00:00:00 2001 From: Taraqur Date: Fri, 14 Jun 2024 15:34:08 -0400 Subject: [PATCH 1/8] updated BMP Signed-off-by: Taraqur --- .DS_Store | Bin 6148 -> 6148 bytes .gitignore | 1 + 2.Sensors/BMP180Example/BMP180Example.ino | 110 +++++++++---- 2.Sensors/BMP180Example/platformio.ini | 184 ++++++++++++++++++++-- 4 files changed, 253 insertions(+), 42 deletions(-) create mode 100644 .gitignore diff --git a/.DS_Store b/.DS_Store index 2458362063fbb74b987907228a689514f1f659b7..7ea09bcfd09fbc93ec81fb0900d9189bdb14f4a5 100644 GIT binary patch delta 167 zcmZoMXfc=|#>B!ku~2NHo}wrV0|Nsi1A_nqLmophLq0cq3L(FF2nJmC0G1-dgI3t*~ lS%;aKX)`+qKL^kmK&!qpPv#eKB)qu~2NHo}wrd0|Nsi1A_nqgFAyigDyh|gA+sQ#=_-{lMO^z7)2-Z zuu2F3gw%FD^mO9z>~S&&1FWn#n5 f&Fmcf96)=4{O`<@`9&N#fU+Q~SvE(AtYHQK51k(x diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/2.Sensors/BMP180Example/BMP180Example.ino b/2.Sensors/BMP180Example/BMP180Example.ino index aa233e3..09d8bbf 100644 --- a/2.Sensors/BMP180Example/BMP180Example.ino +++ b/2.Sensors/BMP180Example/BMP180Example.ino @@ -1,41 +1,46 @@ /** - * @brief Uses the built in Mama Duck with a BMP180 sensor - * - * @date 2020-09-21 - * + * @brief Uses the built in Mama Duck with a DHT11 amd BMP180 sensor + * + * @date 2024-06-14 + * * @copyright Copyright (c) 2020 - * + * */ -#include -#include + #include +#include +#include + +#ifdef SERIAL_PORT_USBVIRTUAL +#define Serial SERIAL_PORT_USBVIRTUAL +#endif // Setup BMP180 #include Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085); -#ifdef SERIAL_PORT_USBVIRTUAL -#define Serial SERIAL_PORT_USBVIRTUAL -#endif +bool sendData(std::vector message); +bool runSensor(void *); // create a built-in mama duck MamaDuck duck; auto timer = timer_create_default(); -const int INTERVAL_MS = 60000; +const int INTERVAL_MS = 10000; + +int counter = 1; +bool setupOK = false; void setup() { - // We are using a hardcoded device id here, but it should be retrieved or - // given during the device provisioning then converted to a byte vector to - // setup the duck NOTE: The Device ID must be exactly 8 bytes otherwise it - // will get rejected - std::string deviceId("MAMA0001"); + + // The Device ID must be exactly 8 bytes otherwise it will get rejected + std::string deviceId("MAMABMP1"); std::vector devId; devId.insert(devId.end(), deviceId.begin(), deviceId.end()); - - // Use the default setup provided by the SDK - duck.setupWithDefaults(devId); - Serial.println("MAMA-DUCK...READY!"); + if (duck.setupWithDefaults(devId) != DUCK_ERR_NONE) { + Serial.println("[MAMA] Failed to setup MamaDuck"); + return; + } // BMP setup if (!bmp.begin()) { @@ -48,30 +53,75 @@ void setup() { Serial.println("BMP on"); } - // initialize the timer. The timer thread runs separately from the main loop - // and will trigger sending a counter message. + // initialize the timer. The timer will trigger sending a counter message. timer.every(INTERVAL_MS, runSensor); + + setupOK = true; + Serial.println("[MAMA] Setup OK!"); } void loop() { timer.tick(); - // Use the default run(). The Mama duck is designed to also forward data it - // receives from other ducks, across the network. It has a basic routing - // mechanism built-in to prevent messages from hoping endlessly. + // Use the default run(). The Mama duck is designed to also forward data it receives + // from other ducks, across the network. It has a basic routing mechanism built-in + // to prevent messages from hoping endlessly. duck.run(); } -bool runSensor(void*) { +std::vector stringToByteVector(const String& str) { + std::vector byteVec; + byteVec.reserve(str.length()); + + for (unsigned int i = 0; i < str.length(); ++i) { + byteVec.push_back(static_cast(str[i])); + } + + return byteVec; +} + +bool runSensor(void *) { + bool result; + + String bmp = getBMP(); + + String message = String("Counter:")+String(counter)+" "+bmp; + + result = sendData(stringToByteVector(message)); + if (result) { + Serial.println("[MAMA] runSensor ok."); + } else { + Serial.println("[MAMA] runSensor failed."); + } + + return result; +} + +String getBMP() { float T, P; bmp.getTemperature(&T); + Serial.print("[SENSOR]: Temperature: "); Serial.println(T); + bmp.getPressure(&P); + Serial.print("[SENSOR]: Pressure: "); Serial.println(P); - String sensorVal = String(T) + "/" + String(P); - - duck.sendData(topics::bmp180, sensorVal); + String sensorVal = "Temp:" + String(T) + " Pres:" + String(P); - return true; + return sensorVal; } + +bool sendData(std::vector message) { + bool sentOk = false; + + int err = duck.sendData(topics::sensor, message); + if (err == DUCK_ERR_NONE) { + counter++; + sentOk = true; + } + if (!sentOk) { + Serial.println("[MAMA] Failed to send data. error = " + String(err)); + } + return sentOk; +} \ No newline at end of file diff --git a/2.Sensors/BMP180Example/platformio.ini b/2.Sensors/BMP180Example/platformio.ini index f407eb8..e403bc3 100644 --- a/2.Sensors/BMP180Example/platformio.ini +++ b/2.Sensors/BMP180Example/platformio.ini @@ -8,19 +8,179 @@ ; 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 + adafruit/DHT sensor library@^1.4.1 + adafruit/Adafruit BMP085 Unified@^1.1.0 + adafruit/Adafruit Unified Sensor@^1.1.14 + +[env:esp32] + lib_deps = + ARDUINOOTA + +[env:local_cdp] + lib_deps = ../../../ ; 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} + adafruit/Adafruit BMP085 Unified@^1.1.0 + adafruit/Adafruit Unified Sensor@^1.1.14 + +; 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} + adafruit/DHT sensor library@^1.4.1 + adafruit/Adafruit BMP085 Unified@^1.1.0 + adafruit/Adafruit Unified Sensor@^1.1.14 + +; 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 +; ------------------------------------------------------------------------------------------------------- -[env:heltec_wifi_lora_32_V2] -platform = espressif32 -board = heltec_wifi_lora_32_V2 -framework = arduino -monitor_speed = 115200 -monitor_filters = time +; 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} -lib_deps = - https://github.com/Call-for-Code/ClusterDuck-Protocol - adafruit/Adafruit BMP085 Library +; 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} -; uncomment for OTA update -; upload_port = duck.local +; 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} + +; 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} \ No newline at end of file From 3df2017fe30a6f0920994e3c3c6606e72a6c4141 Mon Sep 17 00:00:00 2001 From: Charlie Evans Date: Fri, 13 Sep 2024 16:19:04 -0500 Subject: [PATCH 2/8] Removing DS_Store files Signed-off-by: Charlie Evans --- .DS_Store | Bin 6148 -> 0 bytes .gitignore | 1 + 3.TTGO-TBeam/.DS_Store | Bin 6148 -> 0 bytes 3 files changed, 1 insertion(+) delete mode 100644 .DS_Store create mode 100644 .gitignore delete mode 100644 3.TTGO-TBeam/.DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 2458362063fbb74b987907228a689514f1f659b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK!Ab)$5S`SjTSVwV!DGN{)z%h^cv;pKkAhqDpi*~f(Z%hibXzNw!k+bq{1U&% znIsjZdhnpA%)sPLCNoL%rX(8x5Z9)a42GlB3kK)ZYbh0nGdl=Rqwcs}Tsu_BFo=@wKqo|8^2T81wYs{L>IGc%)8DIvOfxpUtJRVE8{$N zWno_^La&Z~sl!3I2DxPhn1S~UESPSQ?*HcJ@BjBn++zlqfq%t-$T$3khg-6D>)ht( vu9c`)s3a7Z8GKDaLtn)hOIPs*suuK1G7w#hnL+fR@P~k=fg5JvM;Ukl-}+L~ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/3.TTGO-TBeam/.DS_Store b/3.TTGO-TBeam/.DS_Store deleted file mode 100644 index 2cc2c56abda416d1f52a957ae04837a899e01553..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~-AcnS6vt1rYNv=36m}W#cH%ZaV0cri!&|XKFH~mBiWa+OtesQFpx63BK8erc zIY|c25A;S+$$^u9n&hO-50dl%0CW58DnJncY;;m<9*cL3`pMtely0$5nVh2o>u>;v z;Gr5b1Pp=SPJs6AGBm-35PW#Ke;aTsTe=WK7!1;G5Q_juKL*`6O0!DkiA_ygGqZE{ zoV{S5dskxMWq#IAUB7oqPfa1>U|jcu<0u@oiYt2}$^0k@domzuhdAWyBud(1;EI0I zPGzj8I_!d7XcbGtVYR+f=C$qWsLY4;TBXdlHg`s&g1x%7v3u0Ijys9CSEw1DMA8Us&ml*GpoNT;gb&X=#E@6Dc7L Date: Fri, 20 Sep 2024 16:36:49 -0400 Subject: [PATCH 3/8] organized files Signed-off-by: Taraqur --- 2.Sensors/BMP280Example/BMP280Example.ino | 76 ------------ 2.Sensors/BMP280Example/libraries.txt | 1 - 2.Sensors/BMP280Example/platformio.ini | 26 ---- 2.Sensors/DHT11Example/DHT11Example.ino | 69 ----------- 2.Sensors/DHT11Example/libraries.txt | 1 - 2.Sensors/DHT11Example/platformio.ini | 26 ---- .../DustSensorExample/DustSensorExample.ino | 72 ----------- 2.Sensors/DustSensorExample/libraries.txt | 1 - 2.Sensors/DustSensorExample/platformio.ini | 26 ---- 2.Sensors/MQ7Example/MQ7Example.ino | 113 ------------------ 2.Sensors/MQ7Example/libraries.txt | 1 - 2.Sensors/MQ7Example/platformio.ini | 26 ---- 6.Ble-Duck-App/Ble-Duck-App/Ble-Duck-App.ino | 68 ----------- 6.Ble-Duck-App/Ble-Duck-App/platformio.ini | 25 ---- .../Serial-PaPiDuckExample.ino | 0 .../Papa-DishDuck-WiFi/Papa-DishDuck-WiFi.ino | 0 .../Papa-DishDuck-WiFi/README.md | 0 .../Papa-DishDuck-WiFi/libraries.txt | 0 .../Papa-DishDuck-WiFi/platformio.ini | 0 .../Papa-DishDuck/Papa-DishDuck.ino | 0 .../Papa-DishDuck/README.md | 0 .../Papa-DishDuck/libraries.txt | 0 .../Papa-DishDuck/platformio.ini | 0 .../Papa-Downtime-Counter.ino | 0 .../Papa-Downtime-Counter/libraries.txt | 0 .../Papa-Downtime-Counter/platformio.ini | 0 .../PapiDuck-DMS-Lite-Serial-Example.ino | 0 .../platformio.ini | 0 .../PapiDuck-DMS-Lite-WiFi-Example.ino | 0 .../libraries.txt | 0 .../platformio.ini | 0 .../DecryptionPapaDuck/DecryptionPapaDuck.ino | 0 .../DecryptionPapaDuck/libraries.txt | 0 .../DecryptionPapaDuck/platformio.ini | 0 .../MamaDecrypt/MamaDecrypt.ino | 0 .../MamaDecrypt/platformio.ini | 0 README.md | 37 +++--- .../BMP180Example/BMP180Example.ino | 0 .../BMP180Example/libraries.txt | 0 .../BMP180Example/platformio.ini | 0 .../WS2812Example/WS2812Example.ino | 0 .../WS2812Example/libraries.txt | 0 .../WS2812Example/platformio.ini | 0 .../TBeam-AXP-Example/TBeam-AXP-Example.ino | 0 .../TBeam-AXP-Example/libraries.txt | 0 .../TBeam-AXP-Example/platformio.ini | 0 .../TBeam-GPS-Example/TBeam-GPS-Example.ino | 0 .../TBeam-GPS-Example/libraries.txt | 0 .../TBeam-GPS-Example/platformio.ini | 0 .../TBeam-Sleep/.gitignore | 0 .../TBeam-Sleep/.vscode/extensions.json | 0 .../TBeam-Telemetry/TBeam-Telemetry.ino | 0 .../TBeam-Telemetry/libraries.txt | 0 .../TBeam-Telemetry/platformio.ini | 0 54 files changed, 14 insertions(+), 554 deletions(-) delete mode 100644 2.Sensors/BMP280Example/BMP280Example.ino delete mode 100644 2.Sensors/BMP280Example/libraries.txt delete mode 100644 2.Sensors/BMP280Example/platformio.ini delete mode 100644 2.Sensors/DHT11Example/DHT11Example.ino delete mode 100644 2.Sensors/DHT11Example/libraries.txt delete mode 100644 2.Sensors/DHT11Example/platformio.ini delete mode 100644 2.Sensors/DustSensorExample/DustSensorExample.ino delete mode 100644 2.Sensors/DustSensorExample/libraries.txt delete mode 100644 2.Sensors/DustSensorExample/platformio.ini delete mode 100644 2.Sensors/MQ7Example/MQ7Example.ino delete mode 100644 2.Sensors/MQ7Example/libraries.txt delete mode 100644 2.Sensors/MQ7Example/platformio.ini delete mode 100644 6.Ble-Duck-App/Ble-Duck-App/Ble-Duck-App.ino delete mode 100644 6.Ble-Duck-App/Ble-Duck-App/platformio.ini rename {4.Custom-Papa => Custom-Papa}/PaPi-DMS-Lite-Examples/Serial-PaPiDuckExample/Serial-PaPiDuckExample.ino (100%) rename {4.Custom-Papa => Custom-Papa}/Papa-DishDuck-WiFi/Papa-DishDuck-WiFi.ino (100%) rename {4.Custom-Papa => Custom-Papa}/Papa-DishDuck-WiFi/README.md (100%) rename {4.Custom-Papa => Custom-Papa}/Papa-DishDuck-WiFi/libraries.txt (100%) rename {4.Custom-Papa => Custom-Papa}/Papa-DishDuck-WiFi/platformio.ini (100%) rename {4.Custom-Papa => Custom-Papa}/Papa-DishDuck/Papa-DishDuck.ino (100%) rename {4.Custom-Papa => Custom-Papa}/Papa-DishDuck/README.md (100%) rename {4.Custom-Papa => Custom-Papa}/Papa-DishDuck/libraries.txt (100%) rename {4.Custom-Papa => Custom-Papa}/Papa-DishDuck/platformio.ini (100%) rename {4.Custom-Papa => Custom-Papa}/Papa-Downtime-Counter/Papa-Downtime-Counter.ino (100%) rename {4.Custom-Papa => Custom-Papa}/Papa-Downtime-Counter/libraries.txt (100%) rename {4.Custom-Papa => Custom-Papa}/Papa-Downtime-Counter/platformio.ini (100%) rename {4.Custom-Papa => Custom-Papa}/PapiDuck-DMS-Lite-Serial-Example/PapiDuck-DMS-Lite-Serial-Example.ino (100%) rename {4.Custom-Papa => Custom-Papa}/PapiDuck-DMS-Lite-Serial-Example/platformio.ini (100%) rename {4.Custom-Papa => Custom-Papa}/PapiDuck-DMS-Lite-WiFi-Example/PapiDuck-DMS-Lite-WiFi-Example.ino (100%) rename {4.Custom-Papa => Custom-Papa}/PapiDuck-DMS-Lite-WiFi-Example/libraries.txt (100%) rename {4.Custom-Papa => Custom-Papa}/PapiDuck-DMS-Lite-WiFi-Example/platformio.ini (100%) rename {5.Encryption => Encryption}/DecryptionPapaDuck/DecryptionPapaDuck.ino (100%) rename {5.Encryption => Encryption}/DecryptionPapaDuck/libraries.txt (100%) rename {5.Encryption => Encryption}/DecryptionPapaDuck/platformio.ini (100%) rename {5.Encryption => Encryption}/MamaDecrypt/MamaDecrypt.ino (100%) rename {5.Encryption => Encryption}/MamaDecrypt/platformio.ini (100%) rename {2.Sensors => Sensors}/BMP180Example/BMP180Example.ino (100%) rename {2.Sensors => Sensors}/BMP180Example/libraries.txt (100%) rename {2.Sensors => Sensors}/BMP180Example/platformio.ini (100%) rename {2.Sensors => Sensors}/WS2812Example/WS2812Example.ino (100%) rename {2.Sensors => Sensors}/WS2812Example/libraries.txt (100%) rename {2.Sensors => Sensors}/WS2812Example/platformio.ini (100%) rename {3.TTGO-TBeam => TTGO-TBeam}/TBeam-AXP-Example/TBeam-AXP-Example.ino (100%) rename {3.TTGO-TBeam => TTGO-TBeam}/TBeam-AXP-Example/libraries.txt (100%) rename {3.TTGO-TBeam => TTGO-TBeam}/TBeam-AXP-Example/platformio.ini (100%) rename {3.TTGO-TBeam => TTGO-TBeam}/TBeam-GPS-Example/TBeam-GPS-Example.ino (100%) rename {3.TTGO-TBeam => TTGO-TBeam}/TBeam-GPS-Example/libraries.txt (100%) rename {3.TTGO-TBeam => TTGO-TBeam}/TBeam-GPS-Example/platformio.ini (100%) rename {3.TTGO-TBeam => TTGO-TBeam}/TBeam-Sleep/.gitignore (100%) rename {3.TTGO-TBeam => TTGO-TBeam}/TBeam-Sleep/.vscode/extensions.json (100%) rename {3.TTGO-TBeam => TTGO-TBeam}/TBeam-Telemetry/TBeam-Telemetry.ino (100%) rename {3.TTGO-TBeam => TTGO-TBeam}/TBeam-Telemetry/libraries.txt (100%) rename {3.TTGO-TBeam => TTGO-TBeam}/TBeam-Telemetry/platformio.ini (100%) diff --git a/2.Sensors/BMP280Example/BMP280Example.ino b/2.Sensors/BMP280Example/BMP280Example.ino deleted file mode 100644 index fe2b11a..0000000 --- a/2.Sensors/BMP280Example/BMP280Example.ino +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @brief Uses the built in Mama Duck with a BMP280 sensor - * - * @date 2020-09-21 - * - * @copyright Copyright (c) 2020 - * - */ - -#include -#include -#include - -#ifdef SERIAL_PORT_USBVIRTUAL -#define Serial SERIAL_PORT_USBVIRTUAL -#endif - -// Setup BMP280 -#include -Adafruit_BMP280 bmp; - -// create a built-in mama duck -MamaDuck duck; - -auto timer = timer_create_default(); -const int INTERVAL_MS = 60000; - - -void setup() { - // We are using a hardcoded device id here, but it should be retrieved or - // given during the device provisioning then converted to a byte vector to - // setup the duck NOTE: The Device ID must be exactly 8 bytes otherwise it - // will get rejected - std::string deviceId("MAMA0001"); - std::vector devId; - devId.insert(devId.end(), deviceId.begin(), deviceId.end()); - - // Use the default setup provided by the SDK - duck.setupWithDefaults(devId); - Serial.println("MAMA-DUCK...READY!"); - - //BMp setup - if(!bmp.begin()) - { - /* There was a problem detecting the BMP085 ... check your connections */ - Serial.print("Ooops, no BMP208 detected ... Check your wiring or I2C ADDR!"); - while(1); - } - - // initialize the timer. The timer thread runs separately from the main loop - // and will trigger sending a counter message. - timer.every(INTERVAL_MS, runSensor); -} - -void loop() { - timer.tick(); - // Use the default run(). The Mama duck is designed to also forward data it receives - // from other ducks, across the network. It has a basic routing mechanism built-in - // to prevent messages from hoping endlessly. - duck.run(); -} - -bool runSensor(void *) { - float T,P; - - T = bmp.readTemperature(); - Serial.println(T); - P = bmp.readPressure(); - Serial.println(P); - - String sensorVal = "Temp: " + String(T) + " Pres: " + String(P); //Store Data - - duck.sendData(topics::bmp280, sensorVal); - - return true; -} diff --git a/2.Sensors/BMP280Example/libraries.txt b/2.Sensors/BMP280Example/libraries.txt deleted file mode 100644 index 3aa3fde..0000000 --- a/2.Sensors/BMP280Example/libraries.txt +++ /dev/null @@ -1 +0,0 @@ -Adafruit BMP280 Library \ No newline at end of file diff --git a/2.Sensors/BMP280Example/platformio.ini b/2.Sensors/BMP280Example/platformio.ini deleted file mode 100644 index 86e8042..0000000 --- a/2.Sensors/BMP280Example/platformio.ini +++ /dev/null @@ -1,26 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[platformio] -src_dir = . - -[env:heltec_wifi_lora_32_V2] -platform = espressif32 -board = heltec_wifi_lora_32_V2 -framework = arduino -monitor_speed = 115200 -monitor_filters = time - -lib_deps = - https://github.com/Call-for-Code/ClusterDuck-Protocol - adafruit/Adafruit BMP280 Library - -; uncomment for OTA update -; upload_port = duck.local diff --git a/2.Sensors/DHT11Example/DHT11Example.ino b/2.Sensors/DHT11Example/DHT11Example.ino deleted file mode 100644 index b34d67b..0000000 --- a/2.Sensors/DHT11Example/DHT11Example.ino +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @brief Uses the built in Mama Duck with a DHT11 sensor - * - * @date 2020-09-21 - * - * @copyright Copyright (c) 2020 - * - */ - -#include -#include -#include - -#ifdef SERIAL_PORT_USBVIRTUAL -#define Serial SERIAL_PORT_USBVIRTUAL -#endif - -// Setup DHT11 -#include -#define DHTTYPE DHT11 -#define DHTPIN 4 -#define TIMEOUT 5000 -DHT dht(DHTPIN, DHTTYPE); - -// create a built-in mama duck -MamaDuck duck; - -auto timer = timer_create_default(); -const int INTERVAL_MS = 10000; - -void setup() { - // We are using a hardcoded device id here, but it should be retrieved or - // given during the device provisioning then converted to a byte vector to - // set up the duck NOTE: The Device ID must be exactly 8 bytes otherwise it - // will get rejected - std::string deviceId("MAMA0001"); - std::vector devId; - devId.insert(devId.end(), deviceId.begin(), deviceId.end()); - - // Use the default setup provided by the SDK - duck.setupWithDefaults(devId); - Serial.println("MAMA-DUCK...READY!"); - - // initialize the timer. The timer thread runs separately from the main loop - // and will trigger sending a counter message. - timer.every(INTERVAL_MS, runSensor); -} - -void loop() { - timer.tick(); - // Use the default run(). The Mama duck is designed to also forward data it receives - // from other ducks, across the network. It has a basic routing mechanism built-in - // to prevent messages from hoping endlessly. - duck.run(); -} - -bool runSensor(void *) { - - String sensorVal = "Temp: "; - sensorVal += dht.readTemperature(); - sensorVal += "Humidity: "; - sensorVal += dht.readHumidity(); - - Serial.println(sensorVal); - - duck.sendData(topics::dht11, sensorVal); - - return true; -} diff --git a/2.Sensors/DHT11Example/libraries.txt b/2.Sensors/DHT11Example/libraries.txt deleted file mode 100644 index 4095d92..0000000 --- a/2.Sensors/DHT11Example/libraries.txt +++ /dev/null @@ -1 +0,0 @@ -DHT sensor library diff --git a/2.Sensors/DHT11Example/platformio.ini b/2.Sensors/DHT11Example/platformio.ini deleted file mode 100644 index f6f71b1..0000000 --- a/2.Sensors/DHT11Example/platformio.ini +++ /dev/null @@ -1,26 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[platformio] -src_dir = . - -[env:heltec_wifi_lora_32_V2] -platform = espressif32 -board = heltec_wifi_lora_32_V2 -framework = arduino -monitor_speed = 115200 -monitor_filters = time - -lib_deps = - https://github.com/Call-for-Code/ClusterDuck-Protocol - adafruit/DHT sensor library - -; uncomment for OTA update -; upload_port = duck.local diff --git a/2.Sensors/DustSensorExample/DustSensorExample.ino b/2.Sensors/DustSensorExample/DustSensorExample.ino deleted file mode 100644 index 0620261..0000000 --- a/2.Sensors/DustSensorExample/DustSensorExample.ino +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @brief Uses the built in Mama Duck with a GP2YDustSensor - * - * @date 2020-09-21 - * - * @copyright Copyright (c) 2020 - * - */ - -#include -#include -#include - -#ifdef SERIAL_PORT_USBVIRTUAL -#define Serial SERIAL_PORT_USBVIRTUAL -#endif - -// Include for DustSensor -#include - -const uint8_t SHARP_LED_PIN = 22; // Sharp Dust/particle sensor Led Pin -const uint8_t SHARP_VO_PIN = 0; // Sharp Dust/particle analog out pin used for reading - -GP2YDustSensor dustSensor(GP2YDustSensorType::GP2Y1010AU0F, SHARP_LED_PIN, SHARP_VO_PIN); - -// create a built-in mama duck -MamaDuck duck; - -auto timer = timer_create_default(); -const int INTERVAL_MS = 60000; -char message[32]; -int counter = 1; - -void setup() { - // We are using a hardcoded device id here, but it should be retrieved or - // given during the device provisioning then converted to a byte vector to - // setup the duck NOTE: The Device ID must be exactly 8 bytes otherwise it - // will get rejected - std::string deviceId("MAMA0001"); - std::vector devId; - devId.insert(devId.end(), deviceId.begin(), deviceId.end()); - - // Use the default setup provided by the SDK - duck.setupWithDefaults(devId); - Serial.println("MAMA-DUCK...READY!"); - - // Dust sensor - dustSensor.begin(); - - // initialize the timer. The timer thread runs separately from the main loop - // and will trigger sending a counter message. - timer.every(INTERVAL_MS, runSensor); -} - -void loop() { - timer.tick(); - // Use the default run(). The Mama duck is designed to also forward data it receives - // from other ducks, across the network. It has a basic routing mechanism built-in - // to prevent messages from hoping endlessly. - duck.run(); -} - -bool runSensor(void *) { - - //Dust sensor - String sensorVal = "Current dust concentration: " + dustSensor.getDustDensity(); - sensorVal += " ug/m3"; - - duck.sendData(topics::gp2y, sensorVal); - - return true; -} diff --git a/2.Sensors/DustSensorExample/libraries.txt b/2.Sensors/DustSensorExample/libraries.txt deleted file mode 100644 index 44ad969..0000000 --- a/2.Sensors/DustSensorExample/libraries.txt +++ /dev/null @@ -1 +0,0 @@ -Sharp GP2Y Dust Sensor diff --git a/2.Sensors/DustSensorExample/platformio.ini b/2.Sensors/DustSensorExample/platformio.ini deleted file mode 100644 index d80f7bb..0000000 --- a/2.Sensors/DustSensorExample/platformio.ini +++ /dev/null @@ -1,26 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[platformio] -src_dir = . - -[env:heltec_wifi_lora_32_V2] -platform = espressif32 -board = heltec_wifi_lora_32_V2 -framework = arduino -monitor_speed = 115200 -monitor_filters = time - -lib_deps = - https://github.com/Call-for-Code/ClusterDuck-Protocol - luciansabo/Sharp GP2Y Dust Sensor - -; uncomment for OTA update -; upload_port = duck.local diff --git a/2.Sensors/MQ7Example/MQ7Example.ino b/2.Sensors/MQ7Example/MQ7Example.ino deleted file mode 100644 index 533ff65..0000000 --- a/2.Sensors/MQ7Example/MQ7Example.ino +++ /dev/null @@ -1,113 +0,0 @@ -/** - * @file MQ7Example.ino - * @brief Uses the built in Mama Duck with a MQ7 sensor attached - * - * @date 2020-09-21 - * - * @copyright Copyright (c) 2020 - * - */ - -#include -#include -#include - -#ifdef SERIAL_PORT_USBVIRTUAL - #define Serial SERIAL_PORT_USBVIRTUAL -#endif - -// Include the MQ7 library -#include - -//Definitions -#define placa "Heltec WiFi LoRa 32(V2)" -#define Voltage_Resolution 5 -#define pin A0 //Analog input 0 of your arduino -#define type "MQ-7" //MQ7 -#define ADC_Bit_Resolution 10 // For arduino UNO/MEGA/NANO -#define RatioMQ7CleanAir 27.5 //RS / R0 = 27.5 ppm -#define PWMPin 5 // Pin connected to mosfet - -//Declare Sensor -MQUnifiedsensor MQ7(placa, Voltage_Resolution, ADC_Bit_Resolution, pin, type); - - -// create a built-in mama duck -MamaDuck duck; - -auto timer = timer_create_default(); -const int INTERVAL_MS = 60000; -char message[32]; -int counter = 1; - -void setup() { - // We are using a hardcoded device id here, but it should be retrieved or - // given during the device provisioning then converted to a byte vector to - // setup the duck NOTE: The Device ID must be exactly 8 bytes otherwise it - // will get rejected - std::string deviceId("MAMA0001"); - std::vector devId; - devId.insert(devId.end(), deviceId.begin(), deviceId.end()); - - // Use the default setup provided by the SDK - duck.setupWithDefaults(devId); - Serial.println("MAMA-DUCK...READY!"); - - //Set math model to calculate the PPM concentration and the value of constants - MQ7.setRegressionMethod(1); //_PPM = a*ratio^b - MQ7.setA(99.042); MQ7.setB(-1.518); // Configurate the ecuation values to get CO concentration - - // init the sensor - /***************************** MQInicializar********************************* - Input: pin, type - Output: - Remarks: This function create the sensor object. - *****************************************************************************/ - MQ7.init(); - /***************************** MQ CAlibration ******************************/ - // Explanation: - // In this routine the sensor will measure the resistance of the sensor supposing before was pre-heated - // and now is on clean air (Calibration conditions), and it will setup R0 value. - // We recomend execute this routine only on setup or on the laboratory and save on the eeprom of your arduino - // This routine not need to execute to every restart, you can load your R0 if you know the value - // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor - Serial.print("Calibrating please wait."); - float calcR0 = 0; - for (int i = 1; i<=10; i ++) { - MQ7.update(); // Update data, the arduino will be read the voltage on the analog pin - calcR0 += MQ7.calibrate(RatioMQ7CleanAir); - Serial.print("."); - } - MQ7.setR0(calcR0/10); - Serial.println(" done!."); - - if(isinf(calcR0)) {Serial.println("Warning: Conection issue founded, R0 is infite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue founded, R0 is zero (Analog pin with short circuit to ground) please check your wiring and supply"); while(1);} - /***************************** MQ CAlibration ******************************/ - MQ7.serialDebug(true); - - // initialize the timer. The timer thread runs separately from the main loop - // and will trigger sending a counter message. - timer.every(INTERVAL_MS, runSensor); -} - -void loop() { - timer.tick(); - // Use the default run(). The Mama duck is designed to also forward data it receives - // from other ducks, across the network. It has a basic routing mechanism built-in - // to prevent messages from hoping endlessly. - duck.run(); -} - -bool runSensor(void *) { - MQ7.update(); // Update data, the arduino will be read the voltage on the analog pin - MQ7.readSensor(); // Sensor will read PPM concentration using the model and a and b values setted before or in the setup - MQ7.serialDebug(); // Will print the table on the serial port - - float sensorRead = MQ7.readSensor(); - String sensorVal = String(sensorRead); - - duck.sendData(topics::mq7, sensorVal); - return true; -} - diff --git a/2.Sensors/MQ7Example/libraries.txt b/2.Sensors/MQ7Example/libraries.txt deleted file mode 100644 index be06075..0000000 --- a/2.Sensors/MQ7Example/libraries.txt +++ /dev/null @@ -1 +0,0 @@ -MQUnifiedsensor diff --git a/2.Sensors/MQ7Example/platformio.ini b/2.Sensors/MQ7Example/platformio.ini deleted file mode 100644 index 6c9a5aa..0000000 --- a/2.Sensors/MQ7Example/platformio.ini +++ /dev/null @@ -1,26 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[platformio] -src_dir = . - -[env:heltec_wifi_lora_32_V2] -platform = espressif32 -board = heltec_wifi_lora_32_V2 -framework = arduino -monitor_speed = 115200 -monitor_filters = time - -lib_deps = - https://github.com/Call-for-Code/ClusterDuck-Protocol - miguel5612/MQUnifiedsensor - -; uncomment for OTA update -; upload_port = duck.local diff --git a/6.Ble-Duck-App/Ble-Duck-App/Ble-Duck-App.ino b/6.Ble-Duck-App/Ble-Duck-App/Ble-Duck-App.ino deleted file mode 100644 index 5823b56..0000000 --- a/6.Ble-Duck-App/Ble-Duck-App/Ble-Duck-App.ino +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file Ble-Duck-App.ino - * @brief Uses the built in Mama Duck with BLE functionality - * - * @date 2020-09-21 - * - * @copyright Copyright (c) 2020 - * - */ - -#include - -#ifdef SERIAL_PORT_USBVIRTUAL -#define Serial SERIAL_PORT_USBVIRTUAL -#endif - - -#include "BluetoothSerial.h" -#include -#include -#include - -#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) -#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it -#endif - -BluetoothSerial SerialBT; - -// create a built-in mama duck -MamaDuck duck; - -char message[32]; -int counter = 1; - -void setup() { - // We are using a hardcoded device id here, but it should be retrieved or - // given during the device provisioning then converted to a byte vector to - // setup the duck NOTE: The Device ID must be exactly 8 bytes otherwise it - // will get rejected - std::string deviceId("MAMA0001"); - std::vector devId; - devId.insert(devId.end(), deviceId.begin(), deviceId.end()); - duck.setDeviceId(devId); - - duck.setupSerial(); - duck.setupRadio(); - - Serial.println("MAMA-DUCK...READY!"); - - // Bluetooth display name - // This is what will be displyed in you Bluetooth settings - SerialBT.begin("MamaDuck1"); - Serial.println("The device started, now you can pair it with bluetooth!"); - -} - -void loop() { - - if (SerialBT.available()) { - String text = SerialBT.readString(); - Serial.println(text); - duck.sendData(topics::status, text); - delay(10); - } - - duck.run(); -} - diff --git a/6.Ble-Duck-App/Ble-Duck-App/platformio.ini b/6.Ble-Duck-App/Ble-Duck-App/platformio.ini deleted file mode 100644 index c74d6e8..0000000 --- a/6.Ble-Duck-App/Ble-Duck-App/platformio.ini +++ /dev/null @@ -1,25 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[platformio] -src_dir = . - -[env:heltec_wifi_lora_32_V2] -platform = espressif32 -board = heltec_wifi_lora_32_V2 -framework = arduino -monitor_speed = 115200 -monitor_filters = time - -lib_deps = - https://github.com/Call-for-Code/ClusterDuck-Protocol - -; uncomment for OTA update -; upload_port = duck.local diff --git a/4.Custom-Papa/PaPi-DMS-Lite-Examples/Serial-PaPiDuckExample/Serial-PaPiDuckExample.ino b/Custom-Papa/PaPi-DMS-Lite-Examples/Serial-PaPiDuckExample/Serial-PaPiDuckExample.ino similarity index 100% rename from 4.Custom-Papa/PaPi-DMS-Lite-Examples/Serial-PaPiDuckExample/Serial-PaPiDuckExample.ino rename to Custom-Papa/PaPi-DMS-Lite-Examples/Serial-PaPiDuckExample/Serial-PaPiDuckExample.ino diff --git a/4.Custom-Papa/Papa-DishDuck-WiFi/Papa-DishDuck-WiFi.ino b/Custom-Papa/Papa-DishDuck-WiFi/Papa-DishDuck-WiFi.ino similarity index 100% rename from 4.Custom-Papa/Papa-DishDuck-WiFi/Papa-DishDuck-WiFi.ino rename to Custom-Papa/Papa-DishDuck-WiFi/Papa-DishDuck-WiFi.ino diff --git a/4.Custom-Papa/Papa-DishDuck-WiFi/README.md b/Custom-Papa/Papa-DishDuck-WiFi/README.md similarity index 100% rename from 4.Custom-Papa/Papa-DishDuck-WiFi/README.md rename to Custom-Papa/Papa-DishDuck-WiFi/README.md diff --git a/4.Custom-Papa/Papa-DishDuck-WiFi/libraries.txt b/Custom-Papa/Papa-DishDuck-WiFi/libraries.txt similarity index 100% rename from 4.Custom-Papa/Papa-DishDuck-WiFi/libraries.txt rename to Custom-Papa/Papa-DishDuck-WiFi/libraries.txt diff --git a/4.Custom-Papa/Papa-DishDuck-WiFi/platformio.ini b/Custom-Papa/Papa-DishDuck-WiFi/platformio.ini similarity index 100% rename from 4.Custom-Papa/Papa-DishDuck-WiFi/platformio.ini rename to Custom-Papa/Papa-DishDuck-WiFi/platformio.ini diff --git a/4.Custom-Papa/Papa-DishDuck/Papa-DishDuck.ino b/Custom-Papa/Papa-DishDuck/Papa-DishDuck.ino similarity index 100% rename from 4.Custom-Papa/Papa-DishDuck/Papa-DishDuck.ino rename to Custom-Papa/Papa-DishDuck/Papa-DishDuck.ino diff --git a/4.Custom-Papa/Papa-DishDuck/README.md b/Custom-Papa/Papa-DishDuck/README.md similarity index 100% rename from 4.Custom-Papa/Papa-DishDuck/README.md rename to Custom-Papa/Papa-DishDuck/README.md diff --git a/4.Custom-Papa/Papa-DishDuck/libraries.txt b/Custom-Papa/Papa-DishDuck/libraries.txt similarity index 100% rename from 4.Custom-Papa/Papa-DishDuck/libraries.txt rename to Custom-Papa/Papa-DishDuck/libraries.txt diff --git a/4.Custom-Papa/Papa-DishDuck/platformio.ini b/Custom-Papa/Papa-DishDuck/platformio.ini similarity index 100% rename from 4.Custom-Papa/Papa-DishDuck/platformio.ini rename to Custom-Papa/Papa-DishDuck/platformio.ini diff --git a/4.Custom-Papa/Papa-Downtime-Counter/Papa-Downtime-Counter.ino b/Custom-Papa/Papa-Downtime-Counter/Papa-Downtime-Counter.ino similarity index 100% rename from 4.Custom-Papa/Papa-Downtime-Counter/Papa-Downtime-Counter.ino rename to Custom-Papa/Papa-Downtime-Counter/Papa-Downtime-Counter.ino diff --git a/4.Custom-Papa/Papa-Downtime-Counter/libraries.txt b/Custom-Papa/Papa-Downtime-Counter/libraries.txt similarity index 100% rename from 4.Custom-Papa/Papa-Downtime-Counter/libraries.txt rename to Custom-Papa/Papa-Downtime-Counter/libraries.txt diff --git a/4.Custom-Papa/Papa-Downtime-Counter/platformio.ini b/Custom-Papa/Papa-Downtime-Counter/platformio.ini similarity index 100% rename from 4.Custom-Papa/Papa-Downtime-Counter/platformio.ini rename to Custom-Papa/Papa-Downtime-Counter/platformio.ini diff --git a/4.Custom-Papa/PapiDuck-DMS-Lite-Serial-Example/PapiDuck-DMS-Lite-Serial-Example.ino b/Custom-Papa/PapiDuck-DMS-Lite-Serial-Example/PapiDuck-DMS-Lite-Serial-Example.ino similarity index 100% rename from 4.Custom-Papa/PapiDuck-DMS-Lite-Serial-Example/PapiDuck-DMS-Lite-Serial-Example.ino rename to Custom-Papa/PapiDuck-DMS-Lite-Serial-Example/PapiDuck-DMS-Lite-Serial-Example.ino diff --git a/4.Custom-Papa/PapiDuck-DMS-Lite-Serial-Example/platformio.ini b/Custom-Papa/PapiDuck-DMS-Lite-Serial-Example/platformio.ini similarity index 100% rename from 4.Custom-Papa/PapiDuck-DMS-Lite-Serial-Example/platformio.ini rename to Custom-Papa/PapiDuck-DMS-Lite-Serial-Example/platformio.ini diff --git a/4.Custom-Papa/PapiDuck-DMS-Lite-WiFi-Example/PapiDuck-DMS-Lite-WiFi-Example.ino b/Custom-Papa/PapiDuck-DMS-Lite-WiFi-Example/PapiDuck-DMS-Lite-WiFi-Example.ino similarity index 100% rename from 4.Custom-Papa/PapiDuck-DMS-Lite-WiFi-Example/PapiDuck-DMS-Lite-WiFi-Example.ino rename to Custom-Papa/PapiDuck-DMS-Lite-WiFi-Example/PapiDuck-DMS-Lite-WiFi-Example.ino diff --git a/4.Custom-Papa/PapiDuck-DMS-Lite-WiFi-Example/libraries.txt b/Custom-Papa/PapiDuck-DMS-Lite-WiFi-Example/libraries.txt similarity index 100% rename from 4.Custom-Papa/PapiDuck-DMS-Lite-WiFi-Example/libraries.txt rename to Custom-Papa/PapiDuck-DMS-Lite-WiFi-Example/libraries.txt diff --git a/4.Custom-Papa/PapiDuck-DMS-Lite-WiFi-Example/platformio.ini b/Custom-Papa/PapiDuck-DMS-Lite-WiFi-Example/platformio.ini similarity index 100% rename from 4.Custom-Papa/PapiDuck-DMS-Lite-WiFi-Example/platformio.ini rename to Custom-Papa/PapiDuck-DMS-Lite-WiFi-Example/platformio.ini diff --git a/5.Encryption/DecryptionPapaDuck/DecryptionPapaDuck.ino b/Encryption/DecryptionPapaDuck/DecryptionPapaDuck.ino similarity index 100% rename from 5.Encryption/DecryptionPapaDuck/DecryptionPapaDuck.ino rename to Encryption/DecryptionPapaDuck/DecryptionPapaDuck.ino diff --git a/5.Encryption/DecryptionPapaDuck/libraries.txt b/Encryption/DecryptionPapaDuck/libraries.txt similarity index 100% rename from 5.Encryption/DecryptionPapaDuck/libraries.txt rename to Encryption/DecryptionPapaDuck/libraries.txt diff --git a/5.Encryption/DecryptionPapaDuck/platformio.ini b/Encryption/DecryptionPapaDuck/platformio.ini similarity index 100% rename from 5.Encryption/DecryptionPapaDuck/platformio.ini rename to Encryption/DecryptionPapaDuck/platformio.ini diff --git a/5.Encryption/MamaDecrypt/MamaDecrypt.ino b/Encryption/MamaDecrypt/MamaDecrypt.ino similarity index 100% rename from 5.Encryption/MamaDecrypt/MamaDecrypt.ino rename to Encryption/MamaDecrypt/MamaDecrypt.ino diff --git a/5.Encryption/MamaDecrypt/platformio.ini b/Encryption/MamaDecrypt/platformio.ini similarity index 100% rename from 5.Encryption/MamaDecrypt/platformio.ini rename to Encryption/MamaDecrypt/platformio.ini diff --git a/README.md b/README.md index f59193c..e100259 100644 --- a/README.md +++ b/README.md @@ -2,36 +2,28 @@ These are few examples to show how someone can build on top of the ClusterDuck Protocol. It works using the master branch of the ClusterDuck Protocol firmware. -## 2. Sensors +## Sensors #### BMP180Example The BMP180 example is a custom MamaDuck that will send sensor data from the BMP 180 (Temperature, Pressure, Altitude) if integrated with the . -#### BMP280Example -The BMP280 example is a custom Mama that will send sensor data from the BMP 280 (Temperature, Pressure, Humidity) inside its own payload into the mesh. - -#### DHT11Example -The DHT example is a custom Mama that will send sensor data from the DHT11 (Temperature and Humidity) inside its own payload into the mesh. - -#### DustSensorExample -The DustSensor example is a custom mama that will send sensor data from a Dust Sensor inside its own payload into the mesh. - -#### MQ7Example -The MQ7 example is a custom mama that will send sensor data from the MQ7 Gas sensor (Carbon Monoxide) inside its own payload into the mesh. - #### WS2812Example The WS2812 example is a Mama Duck, which also brings some light to the world by incorporating some WS2812 LEDs via the FastLED library. -## 3. TTGO T-Beam +## TTGO T-Beam If you have a TTGO T-Beam you can use these custom examples for it. -#### GPS +#### TBeam-GPS-Example This example is a MamaDuck, that uses using TinyGPS++ to get and send GPS data with the GPS topic based on the set timer. -#### Telemetry +#### TBeam-Telemetry-Example Using the TTGO's hardware we can collect all different kinds of live board information such as: onboard temperature, battery voltage (if 18650 installed), and charging. -## 4. Custom Papa +#### TBeam-AXP-Example + +#### TBeam-Sleep-Example + +## Custom Papa #### PaPa-DishDuck and PaPa-DishDuck-WiFi The papa Iridium Example is built to have an extra Iridium Satelite Backhaul when WiFi breakes down. @@ -40,7 +32,7 @@ The papa Iridium Example is built to have an extra Iridium Satelite Backhaul whe This custom PapaDuck keeps track of when it loses access to the internet and for how long. ### PaPi-DMS-Lite-Examples -https://github.com/Project-Owl/dms-lite-docker +[Link to DMS Lite](https://github.com/Project-Owl/dms-lite-docker) #### PapiDuck-Serial-Example The Serial Papi Example is a custom papa that will print the incoming data into the Serial Monitor for the PAPI to read. @@ -48,12 +40,11 @@ The Serial Papi Example is a custom papa that will print the incoming data into #### PapiDuck-WiFi-Example The WiFi Papi Example is a custom papa that will send the incoming data into the Papi. -## 5. Encryption -You can enable encryption. CDP comes with default settings, but set your own IV and AES256 key when in use. +## Encryption +You can enable encryption. CDP comes with default settings, but set your own IV and AES256 key when in use. **NOTE** It is not secure since the keys are hardcoded in the firmware. This is a work in progress. #### DecryptionPapa Decryption is a very fast operation and using this example your messages will be decrypted before sending to the cloud. Remember to set IV and AES256 key to be the same as what you use on other devices. -## 6. Ble-Duck-App -The BLE example is a custom mama that will accept data from the Duck App over bluetooth. -https://github.com/Project-Owl/DuckApp \ No newline at end of file +#### MamaDecrypt +A custom mama example that uses AES256 to encrypt the messages it generates and relays it. Any message it receives from the network, it can decrypt it. \ No newline at end of file diff --git a/2.Sensors/BMP180Example/BMP180Example.ino b/Sensors/BMP180Example/BMP180Example.ino similarity index 100% rename from 2.Sensors/BMP180Example/BMP180Example.ino rename to Sensors/BMP180Example/BMP180Example.ino diff --git a/2.Sensors/BMP180Example/libraries.txt b/Sensors/BMP180Example/libraries.txt similarity index 100% rename from 2.Sensors/BMP180Example/libraries.txt rename to Sensors/BMP180Example/libraries.txt diff --git a/2.Sensors/BMP180Example/platformio.ini b/Sensors/BMP180Example/platformio.ini similarity index 100% rename from 2.Sensors/BMP180Example/platformio.ini rename to Sensors/BMP180Example/platformio.ini diff --git a/2.Sensors/WS2812Example/WS2812Example.ino b/Sensors/WS2812Example/WS2812Example.ino similarity index 100% rename from 2.Sensors/WS2812Example/WS2812Example.ino rename to Sensors/WS2812Example/WS2812Example.ino diff --git a/2.Sensors/WS2812Example/libraries.txt b/Sensors/WS2812Example/libraries.txt similarity index 100% rename from 2.Sensors/WS2812Example/libraries.txt rename to Sensors/WS2812Example/libraries.txt diff --git a/2.Sensors/WS2812Example/platformio.ini b/Sensors/WS2812Example/platformio.ini similarity index 100% rename from 2.Sensors/WS2812Example/platformio.ini rename to Sensors/WS2812Example/platformio.ini diff --git a/3.TTGO-TBeam/TBeam-AXP-Example/TBeam-AXP-Example.ino b/TTGO-TBeam/TBeam-AXP-Example/TBeam-AXP-Example.ino similarity index 100% rename from 3.TTGO-TBeam/TBeam-AXP-Example/TBeam-AXP-Example.ino rename to TTGO-TBeam/TBeam-AXP-Example/TBeam-AXP-Example.ino diff --git a/3.TTGO-TBeam/TBeam-AXP-Example/libraries.txt b/TTGO-TBeam/TBeam-AXP-Example/libraries.txt similarity index 100% rename from 3.TTGO-TBeam/TBeam-AXP-Example/libraries.txt rename to TTGO-TBeam/TBeam-AXP-Example/libraries.txt diff --git a/3.TTGO-TBeam/TBeam-AXP-Example/platformio.ini b/TTGO-TBeam/TBeam-AXP-Example/platformio.ini similarity index 100% rename from 3.TTGO-TBeam/TBeam-AXP-Example/platformio.ini rename to TTGO-TBeam/TBeam-AXP-Example/platformio.ini diff --git a/3.TTGO-TBeam/TBeam-GPS-Example/TBeam-GPS-Example.ino b/TTGO-TBeam/TBeam-GPS-Example/TBeam-GPS-Example.ino similarity index 100% rename from 3.TTGO-TBeam/TBeam-GPS-Example/TBeam-GPS-Example.ino rename to TTGO-TBeam/TBeam-GPS-Example/TBeam-GPS-Example.ino diff --git a/3.TTGO-TBeam/TBeam-GPS-Example/libraries.txt b/TTGO-TBeam/TBeam-GPS-Example/libraries.txt similarity index 100% rename from 3.TTGO-TBeam/TBeam-GPS-Example/libraries.txt rename to TTGO-TBeam/TBeam-GPS-Example/libraries.txt diff --git a/3.TTGO-TBeam/TBeam-GPS-Example/platformio.ini b/TTGO-TBeam/TBeam-GPS-Example/platformio.ini similarity index 100% rename from 3.TTGO-TBeam/TBeam-GPS-Example/platformio.ini rename to TTGO-TBeam/TBeam-GPS-Example/platformio.ini diff --git a/3.TTGO-TBeam/TBeam-Sleep/.gitignore b/TTGO-TBeam/TBeam-Sleep/.gitignore similarity index 100% rename from 3.TTGO-TBeam/TBeam-Sleep/.gitignore rename to TTGO-TBeam/TBeam-Sleep/.gitignore diff --git a/3.TTGO-TBeam/TBeam-Sleep/.vscode/extensions.json b/TTGO-TBeam/TBeam-Sleep/.vscode/extensions.json similarity index 100% rename from 3.TTGO-TBeam/TBeam-Sleep/.vscode/extensions.json rename to TTGO-TBeam/TBeam-Sleep/.vscode/extensions.json diff --git a/3.TTGO-TBeam/TBeam-Telemetry/TBeam-Telemetry.ino b/TTGO-TBeam/TBeam-Telemetry/TBeam-Telemetry.ino similarity index 100% rename from 3.TTGO-TBeam/TBeam-Telemetry/TBeam-Telemetry.ino rename to TTGO-TBeam/TBeam-Telemetry/TBeam-Telemetry.ino diff --git a/3.TTGO-TBeam/TBeam-Telemetry/libraries.txt b/TTGO-TBeam/TBeam-Telemetry/libraries.txt similarity index 100% rename from 3.TTGO-TBeam/TBeam-Telemetry/libraries.txt rename to TTGO-TBeam/TBeam-Telemetry/libraries.txt diff --git a/3.TTGO-TBeam/TBeam-Telemetry/platformio.ini b/TTGO-TBeam/TBeam-Telemetry/platformio.ini similarity index 100% rename from 3.TTGO-TBeam/TBeam-Telemetry/platformio.ini rename to TTGO-TBeam/TBeam-Telemetry/platformio.ini From 069396a895632853f74c6af5d70905f1b7762cd3 Mon Sep 17 00:00:00 2001 From: Taraqur Date: Fri, 20 Sep 2024 16:38:33 -0400 Subject: [PATCH 4/8] maded edits to readme Signed-off-by: Taraqur --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e100259..2e7396b 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ These are few examples to show how someone can build on top of the ClusterDuck Protocol. It works using the master branch of the ClusterDuck Protocol firmware. ## Sensors +These sensors are tested and confirmed that it works by CDP. #### BMP180Example The BMP180 example is a custom MamaDuck that will send sensor data from the BMP 180 (Temperature, Pressure, Altitude) if integrated with the . From bb82cdd0d88c5fca742788130a29b6030bc245ee Mon Sep 17 00:00:00 2001 From: Taraqur Date: Mon, 23 Sep 2024 10:07:22 -0400 Subject: [PATCH 5/8] created sx126 dir for axp Signed-off-by: Taraqur --- .../{ => TBeam-SX126}/TBeam-AXP-Example.ino | 0 .../{ => TBeam-SX126}/libraries.txt | 0 .../{ => TBeam-SX126}/platformio.ini | 0 .../TBeam-SX127/TBeam-AXP-Example.ino | 119 ++++++++++++++++++ .../TBeam-SX127/libraries.txt | 1 + .../TBeam-SX127/platformio.ini | 26 ++++ 6 files changed, 146 insertions(+) rename TTGO-TBeam/TBeam-AXP-Example/{ => TBeam-SX126}/TBeam-AXP-Example.ino (100%) rename TTGO-TBeam/TBeam-AXP-Example/{ => TBeam-SX126}/libraries.txt (100%) rename TTGO-TBeam/TBeam-AXP-Example/{ => TBeam-SX126}/platformio.ini (100%) create mode 100644 TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/TBeam-AXP-Example.ino create mode 100644 TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/libraries.txt create mode 100644 TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/platformio.ini diff --git a/TTGO-TBeam/TBeam-AXP-Example/TBeam-AXP-Example.ino b/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX126/TBeam-AXP-Example.ino similarity index 100% rename from TTGO-TBeam/TBeam-AXP-Example/TBeam-AXP-Example.ino rename to TTGO-TBeam/TBeam-AXP-Example/TBeam-SX126/TBeam-AXP-Example.ino diff --git a/TTGO-TBeam/TBeam-AXP-Example/libraries.txt b/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX126/libraries.txt similarity index 100% rename from TTGO-TBeam/TBeam-AXP-Example/libraries.txt rename to TTGO-TBeam/TBeam-AXP-Example/TBeam-SX126/libraries.txt diff --git a/TTGO-TBeam/TBeam-AXP-Example/platformio.ini b/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX126/platformio.ini similarity index 100% rename from TTGO-TBeam/TBeam-AXP-Example/platformio.ini rename to TTGO-TBeam/TBeam-AXP-Example/TBeam-SX126/platformio.ini diff --git a/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/TBeam-AXP-Example.ino b/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/TBeam-AXP-Example.ino new file mode 100644 index 0000000..a7ba0ba --- /dev/null +++ b/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/TBeam-AXP-Example.ino @@ -0,0 +1,119 @@ +/** + * @file TBeam-AXP-Example.ino + * @brief Uses the built in Mama Duck with some customizations. + * + * This example is a Mama Duck for the TTGO T-Beam that provides feedback and status on the battery and charging of the duck. + * + * @date 2020-11-10 + * + * @copyright Copyright (c) 2020 + * + */ + +#include +#include "arduino-timer.h" +#include +#include + +#ifdef SERIAL_PORT_USBVIRTUAL +#define Serial SERIAL_PORT_USBVIRTUAL +#endif + +// AXP setup +#include +#include + +AXP20X_Class axp; + +const uint8_t i2c_sda = 21; +const uint8_t i2c_scl = 22; + + +DuckDisplay* display = NULL; + + +// Set device ID between "" +String deviceId = "MAMA001"; +MamaDuck duck; + +auto timer = timer_create_default(); +const int INTERVAL_MS = 60000; +char message[32]; +int counter = 1; + +void setup() { + // We are using a hardcoded device id here, but it should be retrieved or + // given during the device provisioning then converted to a byte vector to + // setup the duck NOTE: The Device ID must be exactly 8 bytes otherwise it + // will get rejected + std::string deviceId("MAMA0001"); + std::vector devId; + devId.insert(devId.end(), deviceId.begin(), deviceId.end()); + + // Use the default setup provided by the SDK + duck.setupWithDefaults(devId); + Serial.println("MAMA-DUCK...READY!"); + + // initialize the timer. The timer thread runs separately from the main loop + // and will trigger sending a counter message. + timer.every(INTERVAL_MS, runSensor); + + Wire.begin(i2c_sda, i2c_scl); + + int ret = axp.begin(Wire, AXP192_SLAVE_ADDRESS); + + if (ret == AXP_FAIL) { + Serial.println("AXP Power begin failed"); + while (1); + } +} + +void loop() { + timer.tick(); + // Use the default run(). The Mama duck is designed to also forward data it receives + // from other ducks, across the network. It has a basic routing mechanism built-in + // to prevent messages from hoping endlessly. + duck.run(); + + +} + +bool runSensor(void *) { + + +float isCharging = axp.isChargeing(); +boolean isFullyCharged = axp.isChargingDoneIRQ(); +float batteryVoltage = axp.getBattVoltage(); +float batteryDischarge = axp.getAcinCurrent(); +float getTemp = axp.getTemp(); +int battPercentage = axp.getBattPercentage(); + + Serial.println("--- T-BEAM Power Information ---"); + Serial.print("Duck charging (1 = Yes): "); + Serial.println(isCharging); + Serial.print("Fully Charged: "); + Serial.println(isFullyCharged); + Serial.print("Battery Voltage: "); + Serial.println(batteryVoltage); + Serial.print("Battery Discharge: "); + Serial.println(batteryDischarge); + Serial.print("Board Temperature: "); + Serial.println(getTemp); + Serial.print("battery Percentage: "); + Serial.println(battPercentage); + + + String sensorVal = + "Charging: " + + String(isCharging) ; + " BattFull: " + + String(isFullyCharged)+ + " Voltage " + + String(batteryVoltage) ; + " Temp: " + + String(getTemp); + + + duck.sendData(topics::sensor, sensorVal); + return true; +} diff --git a/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/libraries.txt b/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/libraries.txt new file mode 100644 index 0000000..cd2a7ea --- /dev/null +++ b/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/libraries.txt @@ -0,0 +1 @@ +AXP202X_Library \ No newline at end of file diff --git a/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/platformio.ini b/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/platformio.ini new file mode 100644 index 0000000..4305db4 --- /dev/null +++ b/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/platformio.ini @@ -0,0 +1,26 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[platformio] +src_dir = . + +[env:ttgo-t-beam] +platform = espressif32 +board = ttgo-t-beam +framework = arduino +monitor_speed = 115200 +monitor_filters = time + +lib_deps = + https://github.com/Call-for-Code/ClusterDuck-Protocol + lewisxhe/AXP202X_Library + +; uncomment for OTA update +; upload_port = duck.local From b03da245d5c3511b1639e47f3212b428f27c6951 Mon Sep 17 00:00:00 2001 From: Taraqur Date: Mon, 7 Oct 2024 14:39:53 -0400 Subject: [PATCH 6/8] edited BMP ini Signed-off-by: Taraqur --- Sensors/BMP180Example/platformio.ini | 156 ++++++++++++++++++++++++--- 1 file changed, 144 insertions(+), 12 deletions(-) diff --git a/Sensors/BMP180Example/platformio.ini b/Sensors/BMP180Example/platformio.ini index f407eb8..a71234f 100644 --- a/Sensors/BMP180Example/platformio.ini +++ b/Sensors/BMP180Example/platformio.ini @@ -8,19 +8,151 @@ ; 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 = MamaDuck CDP examples + +[env] + lib_deps = + WIRE + SPI + contrem/arduino-timer@^3.0.1 + adafruit/Adafruit BMP085 Unified@^1.1.0 + ; adafruit/Adafruit Unified Sensor@^1.1.14 + +[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/archive/refs/tags/4.2.0.zip + + +; ------------------------------------------------------------------------------------------------------- +; ---- 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} + adafruit/Adafruit BMP085 Unified@^1.1.0 + +; 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} + adafruit/Adafruit BMP085 Unified@^1.1.0 + +; 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} + adafruit/Adafruit BMP085 Unified@^1.1.0 + +; 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} + adafruit/Adafruit BMP085 Unified@^1.1.0 + +; ------------------------------------------------------------------------------------------------------- +; ---- LOCAL ENVIRONMENTS +; ------------------------------------------------------------------------------------------------------- -[env:heltec_wifi_lora_32_V2] -platform = espressif32 -board = heltec_wifi_lora_32_V2 -framework = arduino -monitor_speed = 115200 -monitor_filters = time +; 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} + adafruit/Adafruit BMP085 Unified@^1.1.0 + +; 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} + adafruit/Adafruit BMP085 Unified@^1.1.0 -lib_deps = - https://github.com/Call-for-Code/ClusterDuck-Protocol - adafruit/Adafruit BMP085 Library +; 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} + adafruit/Adafruit BMP085 Unified@^1.1.0 -; uncomment for OTA update -; upload_port = duck.local +; 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} + adafruit/Adafruit BMP085 Unified@^1.1.0 \ No newline at end of file From 5ecacb3e2c27ad8a48eae3555eaa9e101633221d Mon Sep 17 00:00:00 2001 From: Taraqur Date: Mon, 7 Oct 2024 15:08:48 -0400 Subject: [PATCH 7/8] edit ini for fastled Signed-off-by: Taraqur --- Sensors/WS2812Example/platformio.ini | 163 ++++++++++++++++-- .../TBeam-SX127/platformio.ini | 13 -- 2 files changed, 151 insertions(+), 25 deletions(-) diff --git a/Sensors/WS2812Example/platformio.ini b/Sensors/WS2812Example/platformio.ini index a2b59e8..dd00466 100644 --- a/Sensors/WS2812Example/platformio.ini +++ b/Sensors/WS2812Example/platformio.ini @@ -8,19 +8,158 @@ ; 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 = MamaDuck CDP examples + +[env] + lib_deps = + WIRE + SPI + contrem/arduino-timer@^3.0.1 + FastLED/FastLED@^3.6.0 + +[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/archive/refs/tags/4.2.0.zip + + +; ------------------------------------------------------------------------------------------------------- +; ---- 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} + contrem/arduino-timer@^3.0.1 + FastLED/FastLED@^3.6.0 + +; 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} + contrem/arduino-timer@^3.0.1 + FastLED/FastLED@^3.6.0 + +; 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} + contrem/arduino-timer@^3.0.1 + FastLED/FastLED@^3.6.0 + +; 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} + contrem/arduino-timer@^3.0.1 + FastLED/FastLED@^3.6.0 + +; ------------------------------------------------------------------------------------------------------- +; ---- LOCAL ENVIRONMENTS +; ------------------------------------------------------------------------------------------------------- -[env:heltec_wifi_lora_32_V2] -platform = espressif32 -board = heltec_wifi_lora_32_V2 -framework = arduino -monitor_speed = 115200 -monitor_filters = time +; 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} + contrem/arduino-timer@^3.0.1 + FastLED/FastLED@^3.6.0 + +; 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} + contrem/arduino-timer@^3.0.1 + FastLED/FastLED@^3.6.0 -lib_deps = - https://github.com/Call-for-Code/ClusterDuck-Protocol - fastled/FastLED +; 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} + contrem/arduino-timer@^3.0.1 + FastLED/FastLED@^3.6.0 -; uncomment for OTA update -; upload_port = duck.local +; 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} + contrem/arduino-timer@^3.0.1 + FastLED/FastLED@^3.6.0 \ No newline at end of file diff --git a/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/platformio.ini b/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/platformio.ini index 3501968..e403bc3 100644 --- a/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/platformio.ini +++ b/TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/platformio.ini @@ -22,18 +22,6 @@ src_dir = . ;; uncomment the line below to build for your board -<<<<<<< HEAD:TTGO-TBeam/TBeam-AXP-Example/TBeam-SX127/platformio.ini -[env:ttgo-t-beam] -platform = espressif32 -board = ttgo-t-beam -framework = arduino -monitor_speed = 115200 -monitor_filters = time - -lib_deps = - https://github.com/Call-for-Code/ClusterDuck-Protocol - lewisxhe/AXP202X_Library -======= default_envs = local_heltec_wifi_lora_32_V3 ; default_envs = local_heltec_wifi_lora_32_V3 ; default_envs = local_heltec_wifi_lora_32_V2 @@ -42,7 +30,6 @@ lib_deps = ; default_envs = prod_heltec_wifi_lora_32_V3 ; default_envs = prod_heltec_wifi_lora_32_V2 ; default_envs = prod_ttgo_t_beam ->>>>>>> 2b965302b2d68a5fe7827969d290a53a739a998c:2.Sensors/BMP180Example/platformio.ini description = DuckLink CDP examples From 0f9792cca88b2a8e3be067d72a170eba65068a5b Mon Sep 17 00:00:00 2001 From: Taraqur Date: Sun, 20 Oct 2024 22:35:46 -0400 Subject: [PATCH 8/8] gitignore Signed-off-by: Taraqur --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 496ee2c..df712af 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -.DS_Store \ No newline at end of file +.DS_Store +.pio +.vscode +.vs_code \ No newline at end of file