mirror of
https://github.com/Genaker/LoraSA.git
synced 2026-05-06 21:42:46 +02:00
Harmonize json log, use ArduinoJSON library for all boards
This commit is contained in:
@@ -65,6 +65,7 @@ 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
|
||||
@@ -122,6 +123,7 @@ 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
|
||||
@@ -148,6 +150,7 @@ 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
|
||||
@@ -212,6 +215,7 @@ lib_deps =
|
||||
https://github.com/HelTecAutomation/Heltec_ESP32/
|
||||
adafruit/Adafruit GFX Library@^1.11.10
|
||||
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
|
||||
bblanchon/ArduinoJson@^7.2.0
|
||||
|
||||
[env:vision-master-t190]
|
||||
platform = espressif32
|
||||
@@ -246,6 +250,7 @@ lib_deps =
|
||||
adafruit/Adafruit GFX Library@^1.11.10
|
||||
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
|
||||
adafruit/Adafruit ST7735 and ST7789 Library@^1.10.4
|
||||
bblanchon/ArduinoJson@^7.2.0
|
||||
|
||||
[env:native]
|
||||
platform = native
|
||||
|
||||
17
src/main.cpp
17
src/main.cpp
@@ -23,11 +23,9 @@
|
||||
|
||||
// #define HELTEC_NO_DISPLAY
|
||||
|
||||
#include <Arduino.h>
|
||||
#ifdef HELTEC
|
||||
#include <ArduinoJson.h>
|
||||
#endif
|
||||
#include "FS.h"
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
#include <AsyncTCP.h>
|
||||
#include <ESPAsyncWebServer.h>
|
||||
#include <File.h>
|
||||
@@ -598,11 +596,8 @@ void dumpToCommsTask(void *parameter)
|
||||
|
||||
void logToSerialTask(void *parameter)
|
||||
{
|
||||
#ifdef HELTEC
|
||||
JsonDocument doc;
|
||||
char jsonOutput[200];
|
||||
#endif
|
||||
|
||||
uint64_t last_epoch = frequency_scan_result.last_epoch;
|
||||
frequency_scan_result.rssi = -999;
|
||||
|
||||
@@ -620,20 +615,12 @@ void logToSerialTask(void *parameter)
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef HELTEC
|
||||
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);
|
||||
Serial.println(jsonOutput);
|
||||
#else
|
||||
Serial.printf("{\"low_range_freq\": %" PRIu64
|
||||
", \"high_range_freq\": %" PRIu64 ", "
|
||||
"\"value\": \"%" PRIi16 "\"}\n",
|
||||
frequency_scan_result.begin, frequency_scan_result.end,
|
||||
highest_value_scanned);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user