Start of seek on mavic:

- Add build targets with LOG_DATA_JSON enabled
- remove json lib
This commit is contained in:
KonradIT
2024-12-11 23:49:42 +01:00
parent 82255fbf37
commit 87240917d9
2 changed files with 69 additions and 23 deletions
+58 -6
View File
@@ -29,7 +29,6 @@ board_build.f_cpu = 240000000
board_build.filesystem = littlefs
lib_deps =
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
bblanchon/ArduinoJson@^7.2.0
ESP Async WebServer
build_flags =
-DHELTEC_POWER_BUTTON
@@ -65,7 +64,6 @@ board_build.f_cpu = 240000000
board_build.filesystem = littlefs
lib_deps =
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
bblanchon/ArduinoJson@^7.2.0
ESP Async WebServer
build_flags =
-DHELTEC_POWER_BUTTON
@@ -84,7 +82,6 @@ board_build.f_cpu = 240000000
board_build.filesystem = littlefs
lib_deps =
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
bblanchon/ArduinoJson@^7.2.0
RadioLib
U8g2
XPowersLib
@@ -114,7 +111,6 @@ lib_deps =
RadioLib
U8g2
XPowersLib
bblanchon/ArduinoJson@^7.2.0
ESP Async WebServer
build_flags =
-DLILYGO
@@ -142,7 +138,6 @@ board_build.f_cpu = 240000000
board_build.filesystem = littlefs
lib_deps =
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
bblanchon/ArduinoJson@^7.2.0
RadioLib
U8g2
XPowersLib
@@ -169,7 +164,6 @@ monitor_speed = 115200
board_build.filesystem = littlefs
lib_deps =
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
bblanchon/ArduinoJson@^7.2.0
RadioLib
U8g2
XPowersLib
@@ -271,5 +265,63 @@ lib_deps =
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
adafruit/Adafruit ST7735 and ST7789 Library@^1.10.4
[env:seek-on-mavic-sx1280]
platform = espressif32
board = t3_s3_v1_x
framework = arduino
upload_speed = 921600
monitor_speed = 115200
board_build.f_cpu = 240000000
board_build.filesystem = littlefs
lib_deps =
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
RadioLib
U8g2
XPowersLib
ESP Async WebServer
build_flags =
-DLILYGO
-DT3_S3_V1_2_SX1280_PA
-DARDUINO_LILYGO_T3S3_SX1280_PA
-DESP32
-DUSING_SX1280PA
-DFREQ_BEGIN=2410
-DFREQ_END=2452
-DARDUINO_ARCH_ESP32
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_LILYGO_T3_S3_V1_X
-DARDUINO_USB_MODE=1
-DLOG_DATA_JSON=1
[env:seek-on-mavic-lr1121]
platform = espressif32
board = t3_s3_v1_x
framework = arduino
upload_speed = 921600
monitor_speed = 115200
board_build.f_cpu = 240000000
board_build.filesystem = littlefs
lib_deps =
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
RadioLib
U8g2
XPowersLib
ESP Async WebServer
build_flags =
-DLILYGO
-DT3_S3_V1_2_LR1121
-DT3_V1_3_SX1262
-DARDUINO_LILYGO_T3S3_LR1121
-DESP32
-DSAMPLES_RSSI=5
-DUSING_LR1121
-DFREQ_BEGIN=2410
-DFREQ_END=2452
-DARDUINO_ARCH_ESP32
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_LILYGO_T3_S3_V1_X
-DARDUINO_USB_MODE=1
-DLOG_DATA_JSON=1
[env:native]
platform = native
+11 -17
View File
@@ -25,9 +25,6 @@
#include "FS.h"
#include <Arduino.h>
#ifdef LOG_DATA_JSON
#include <ArduinoJson.h>
#endif
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <File.h>
@@ -233,10 +230,13 @@ uint64_t scan_time = 0;
uint64_t scan_start_time = 0;
#endif
// Define which UART port to use (0, 1, or 2)
// log data via serial console, JSON format:
// Optionally it can be enabled via this flag, although its recommended to use
// platformio config flag -DLOG_DATA_JSON
// #define LOG_DATA_JSON true
#define SERIAL_PORT 1
// Define which pins to use
#define TX_PIN 12
#define RX_PIN 16 // not used
@@ -778,8 +778,6 @@ void dumpToCommsTask(void *parameter)
#ifdef LOG_DATA_JSON
void logToSerialTask(void *parameter)
{
JsonDocument doc;
char jsonOutput[200];
uint64_t last_epoch = frequency_scan_result.last_epoch;
frequency_scan_result.rssi = -999;
@@ -797,12 +795,11 @@ void logToSerialTask(void *parameter)
continue;
}
doc["low_range_freq"] = frequency_scan_result.begin;
doc["high_range_freq"] = frequency_scan_result.end;
doc["value"] = String(highest_value_scanned);
serializeJson(doc, jsonOutput);
SerialPort.println(jsonOutput);
SerialPort.printf("{\"low_range_freq\": %" PRIu64
", \"high_range_freq\": %" PRIu64 ", "
"\"value\": \"%" PRIi16 "\"}\n",
frequency_scan_result.begin, frequency_scan_result.end,
highest_value_scanned);
}
}
}
@@ -980,10 +977,7 @@ void setup(void)
#ifdef LILYGO
setupBoards(); // true for disable U8g2 display library
delay(500);
Serial.println("Setup LiLybeginSDCardGO board is done");
#else
// Serial0.begin(115200); // Initialize UART0
// Serial0.println("Hello, Serial0 (UART0)!");
Serial.println("Setup LiLyGO board is done");
#endif
// LED brightness