Просмотр исходного кода

added room server roles to t114 and t-echo; added repeater and room server roles to WSL3; unified json intendations in /boards

Rastislav Vysoky 1 год назад
Родитель
Сommit
b1a5badf98
4 измененных файлов с 171 добавлено и 110 удалено
  1. 60 60
      boards/t-echo.json
  2. 41 41
      boards/t3_s3_v1_x.json
  3. 8 0
      examples/simple_room_server/main.cpp
  4. 62 9
      platformio.ini

+ 60 - 60
boards/t-echo.json

@@ -1,62 +1,62 @@
 {
-	"build": {
-	  "arduino": {
-		"ldscript": "nrf52840_s140_v6.ld"
-	  },
-	  "core": "nRF5",
-	  "cpu": "cortex-m4",
-	  "extra_flags": "-DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAA",
-	  "f_cpu": "64000000L",
-	  "hwids": [
-		[
-		  "0x239A",
-		  "0x8029"
-		]
-	  ],
-	  "usb_product": "NRF52 DK",
-	  "mcu": "nrf52840",
-	  "variant": "pca10056",
-	  "bsp": {
-		"name": "adafruit"
-	  },
-	  "softdevice": {
-		"sd_flags": "-DS140",
-		"sd_name": "s140",
-		"sd_version": "6.1.1",
-		"sd_fwid": "0x00B6"
-	  },
-	  "bootloader": {
-		"settings_addr": "0xFF000"
-	  }
-	},
-	"connectivity": [
-	  "bluetooth"
-	],
-	"debug": {
-	  "jlink_device": "nRF52840_xxAA",
-	  "onboard_tools": [
-		"jlink"
-	  ],
-	  "svd_path": "nrf52840.svd"
-	},
-	"frameworks": [
-	  "arduino"
-	],
-	"name": "LilyGo T-ECHO",
-	"upload": {
-	  "maximum_ram_size": 248832,
-	  "maximum_size": 815104,
-	  "require_upload_port": true,
-	  "speed": 115200,
-	  "protocol": "jlink",
-	  "protocols": [
-		"jlink",
-		"nrfjprog",
-		"stlink",
-		"cmsis-dap",
-		"blackmagic"
-	  ]
-	},
-	"url": "https://os.mbed.com/platforms/Nordic-nRF52840-DK/",
-	"vendor": "Nordic"
+  "build": {
+    "arduino": {
+    "ldscript": "nrf52840_s140_v6.ld"
+    },
+    "core": "nRF5",
+    "cpu": "cortex-m4",
+    "extra_flags": "-DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAA",
+    "f_cpu": "64000000L",
+    "hwids": [
+    [
+      "0x239A",
+      "0x8029"
+    ]
+    ],
+    "usb_product": "NRF52 DK",
+    "mcu": "nrf52840",
+    "variant": "pca10056",
+    "bsp": {
+    "name": "adafruit"
+    },
+    "softdevice": {
+    "sd_flags": "-DS140",
+    "sd_name": "s140",
+    "sd_version": "6.1.1",
+    "sd_fwid": "0x00B6"
+    },
+    "bootloader": {
+    "settings_addr": "0xFF000"
+    }
+  },
+  "connectivity": [
+    "bluetooth"
+  ],
+  "debug": {
+    "jlink_device": "nRF52840_xxAA",
+    "onboard_tools": [
+    "jlink"
+    ],
+    "svd_path": "nrf52840.svd"
+  },
+  "frameworks": [
+    "arduino"
+  ],
+  "name": "LilyGo T-ECHO",
+  "upload": {
+    "maximum_ram_size": 248832,
+    "maximum_size": 815104,
+    "require_upload_port": true,
+    "speed": 115200,
+    "protocol": "jlink",
+    "protocols": [
+    "jlink",
+    "nrfjprog",
+    "stlink",
+    "cmsis-dap",
+    "blackmagic"
+    ]
+  },
+  "url": "https://os.mbed.com/platforms/Nordic-nRF52840-DK/",
+  "vendor": "Nordic"
   }

+ 41 - 41
boards/t3_s3_v1_x.json

@@ -1,45 +1,45 @@
 {
-    "build": {
-        "arduino": {
-            "ldscript": "esp32s3_out.ld",
-            "partitions": "default.csv",
-            "memory_type": "qio_qspi"
-        },
-        "core": "esp32",
-        "extra_flags": [
-            "-DARDUINO_LILYGO_T3_S3_V1_X",
-            "-DBOARD_HAS_PSRAM",
-            "-DARDUINO_USB_CDC_ON_BOOT=1",
-            "-DARDUINO_RUNNING_CORE=1",
-            "-DARDUINO_EVENT_RUNNING_CORE=1",
-            "-DARDUINO_USB_MODE=1"
-        ],
-        "f_cpu": "240000000L",
-        "f_flash": "80000000L",
-        "flash_mode": "qio",
-        "mcu": "esp32s3",
-        "variant": "esp32s3"
+  "build": {
+    "arduino": {
+      "ldscript": "esp32s3_out.ld",
+      "partitions": "default.csv",
+      "memory_type": "qio_qspi"
     },
-    "connectivity": [
-        "wifi"
+    "core": "esp32",
+    "extra_flags": [
+      "-DARDUINO_LILYGO_T3_S3_V1_X",
+      "-DBOARD_HAS_PSRAM",
+      "-DARDUINO_USB_CDC_ON_BOOT=1",
+      "-DARDUINO_RUNNING_CORE=1",
+      "-DARDUINO_EVENT_RUNNING_CORE=1",
+      "-DARDUINO_USB_MODE=1"
     ],
-    "debug": {
-        "openocd_target": "esp32s3.cfg"
-    },
-    "frameworks": [
-        "arduino",
-        "espidf"
-    ],
-    "name": "LilyGo T3-S3 Radio",
-    "upload": {
-        "flash_size": "4MB",
-        "maximum_ram_size": 327680,
-        "maximum_size": 4194304,
-        "use_1200bps_touch": true,
-        "wait_for_upload_port": true,
-        "require_upload_port": true,
-        "speed": 460800
-    },
-    "url": "https://www.lilygo.cc",
-    "vendor": "LilyGo"
+    "f_cpu": "240000000L",
+    "f_flash": "80000000L",
+    "flash_mode": "qio",
+    "mcu": "esp32s3",
+    "variant": "esp32s3"
+  },
+  "connectivity": [
+    "wifi"
+  ],
+  "debug": {
+    "openocd_target": "esp32s3.cfg"
+  },
+  "frameworks": [
+    "arduino",
+    "espidf"
+  ],
+  "name": "LilyGo T3-S3 Radio",
+  "upload": {
+    "flash_size": "4MB",
+    "maximum_ram_size": 327680,
+    "maximum_size": 4194304,
+    "use_1200bps_touch": true,
+    "wait_for_upload_port": true,
+    "require_upload_port": true,
+    "speed": 460800
+  },
+  "url": "https://www.lilygo.cc",
+  "vendor": "LilyGo"
 }

+ 8 - 0
examples/simple_room_server/main.cpp

@@ -92,6 +92,14 @@
   #include <helpers/nrf52/RAK4631Board.h>
   #include <helpers/CustomSX1262Wrapper.h>
   static RAK4631Board board;
+#elif defined(HELTEC_T114)
+  #include <helpers/nrf52/T114Board.h>
+  #include <helpers/CustomSX1262Wrapper.h>
+  static T114Board board;
+#elif defined(LILYGO_TECHO)
+  #include <helpers/nrf52/TechoBoard.h>
+  #include <helpers/CustomSX1262Wrapper.h>
+  static TechoBoard board;
 #else
   #error "need to provide a 'board' object"
 #endif

+ 62 - 9
platformio.ini

@@ -214,41 +214,68 @@ lib_deps =
   ${Heltec_lora32_v3.lib_deps}
   densaugeo/base64 @ ~1.4.0
 
-[env:Heltec_WSL3_companion_radio_ble]
+[env:Heltec_v3_companion_radio_wifi]
 extends = Heltec_lora32_v3
 build_flags =
   ${Heltec_lora32_v3.build_flags}
   -D MAX_CONTACTS=100
   -D MAX_GROUP_CHANNELS=1
-  -D BLE_PIN_CODE=123456
-  -D BLE_DEBUG_LOGGING=1
+  -D DISPLAY_CLASS=SSD1306Display
+  -D WIFI_DEBUG_LOGGING=1
+  -D WIFI_SSID="\"myssid\""
+  -D WIFI_PWD="\"mypwd\""
 ;  -D ENABLE_PRIVATE_KEY_IMPORT=1
 ;  -D ENABLE_PRIVATE_KEY_EXPORT=1
 ;  -D MESH_PACKET_LOGGING=1
 ;  -D MESH_DEBUG=1
 build_src_filter = ${Heltec_lora32_v3.build_src_filter}
+  +<helpers/ui/*.cpp>
   +<helpers/esp32/*.cpp>
   +<../examples/companion_radio>
 lib_deps =
   ${Heltec_lora32_v3.lib_deps}
   densaugeo/base64 @ ~1.4.0
 
-[env:Heltec_v3_companion_radio_wifi]
+[env:Heltec_WSL3_repeater]
+extends = Heltec_lora32_v3
+build_flags =
+  ${Heltec_lora32_v3.build_flags}
+  -D ADVERT_NAME="\"Heltec 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 = ${Heltec_lora32_v3.build_src_filter}
+  +<../examples/simple_repeater>
+
+[env:Heltec_WSL3_room_server]
+extends = Heltec_lora32_v3
+build_src_filter = ${Heltec_lora32_v3.build_src_filter}
+  +<../examples/simple_room_server>
+build_flags =
+  ${Heltec_lora32_v3.build_flags}
+  -D ADVERT_NAME="\"Heltec 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
+
+[env:Heltec_WSL3_companion_radio_ble]
 extends = Heltec_lora32_v3
 build_flags =
   ${Heltec_lora32_v3.build_flags}
   -D MAX_CONTACTS=100
   -D MAX_GROUP_CHANNELS=1
-  -D DISPLAY_CLASS=SSD1306Display
-  -D WIFI_DEBUG_LOGGING=1
-  -D WIFI_SSID="\"myssid\""
-  -D WIFI_PWD="\"mypwd\""
+  -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 = ${Heltec_lora32_v3.build_src_filter}
-  +<helpers/ui/*.cpp>
   +<helpers/esp32/*.cpp>
   +<../examples/companion_radio>
 lib_deps =
@@ -805,6 +832,20 @@ build_flags =
 ;  -D MESH_PACKET_LOGGING=1
 ;  -D MESH_DEBUG=1
 
+[env:Heltec_t114_room_server]
+extends = Heltec_t114
+build_src_filter = ${Heltec_t114.build_src_filter}
+  +<../examples/simple_room_server>
+build_flags =
+  ${Heltec_t114.build_flags}
+  -D ADVERT_NAME="\"Heltec_T114 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
+
 [env:Heltec_t114_companion_radio_ble]
 extends = Heltec_t114
 build_flags =
@@ -865,6 +906,18 @@ build_flags =
 ;  -D MESH_PACKET_LOGGING=1
 ;  -D MESH_DEBUG=1
 
+[env:LilyGo_T-Echo_room_server]
+extends = LilyGo_Techo
+build_src_filter = ${LilyGo_Techo.build_src_filter} +<../examples/simple_room_server/main.cpp>
+build_flags =
+  ${LilyGo_Techo.build_flags}
+  -D ADVERT_NAME="\"T-Echo Room\""
+  -D ADVERT_LAT=-37.0
+  -D ADVERT_LON=145.0
+  -D ADMIN_PASSWORD="\"password\""
+;  -D MESH_PACKET_LOGGING=1
+;  -D MESH_DEBUG=1
+
 [env:LilyGo_T-Echo_companion_radio_ble]
 extends = LilyGo_Techo
 build_flags =