Skip to content
Snippets Groups Projects
Verified Commit fe26453f authored by Zoe Michaela Dietmar Pfister's avatar Zoe Michaela Dietmar Pfister :gay_pride_flag:
Browse files

Minor changes

parent f178846c
No related branches found
No related tags found
3 merge requests!39Merge Develop into Main,!25Minor additions to host,!24Refactor of Host ESP32
...@@ -10,6 +10,7 @@ enum MessageType { dataAck, hostChange }; ...@@ -10,6 +10,7 @@ enum MessageType { dataAck, hostChange };
typedef struct response { typedef struct response {
MessageType type; MessageType type;
uint8_t mac[6]; uint8_t mac[6];
long time; long time; // Clang-Tidy: Narrowing conversion from 'unsigned long' to signed type 'long' is implementation-defined
// (see rtc in main.cpp)
} response; } response;
#endif // HOST_CENTRAL_MAST_MESSAGETYPE_H #endif // HOST_CENTRAL_MAST_MESSAGETYPE_H
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#define LED_PIN 12 #define LED_PIN 12
// See all AT commands, if wanted // See all AT commands, if wanted
//#define DUMP_AT_COMMANDS // #define DUMP_AT_COMMANDS
#define TAG_ESPNOW "ESPNOW" #define TAG_ESPNOW "ESPNOW"
#define TAG_MAIN "MAIN" #define TAG_MAIN "MAIN"
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#define SD_CARD_FAIL_COUNTER 100 #define SD_CARD_FAIL_COUNTER 100
constexpr bool PRINT_TO_SERIAL = true;
// global definition of RTC. Initialised in main // global definition of RTC. Initialised in main
extern ESP32Time rtc; extern ESP32Time rtc;
......
...@@ -23,6 +23,7 @@ namespace SDCardLogger { ...@@ -23,6 +23,7 @@ namespace SDCardLogger {
} }
return 1; return 1;
} }
// write evaluated format string into buffer // write evaluated format string into buffer
int ret = vsnprintf(log_print_buffer, sizeof(log_print_buffer), logstring.c_str(), args); int ret = vsnprintf(log_print_buffer, sizeof(log_print_buffer), logstring.c_str(), args);
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
namespace SDCardLogger { namespace SDCardLogger {
void printDebugToSerial(bool printToSerialAsWell); void printDebugToSerial(bool printToSerialAsWell);
int vprintf_into_sd(const char *szFormat, va_list args); int vprintf_into_sd(const char *szFormat, va_list args);
void sdNotAvailable(bool sdNotAvailable);
}; // namespace SDCardLogger }; // namespace SDCardLogger
#endif // HOST_CENTRAL_MAST_SDCARDLOGGER_H #endif // HOST_CENTRAL_MAST_SDCARDLOGGER_H
...@@ -165,7 +165,7 @@ void setup() { ...@@ -165,7 +165,7 @@ void setup() {
esp_log_write(ESP_LOG_ERROR, TAG_MAIN, "SD Card setup failed: %s\n", e.what()); esp_log_write(ESP_LOG_ERROR, TAG_MAIN, "SD Card setup failed: %s\n", e.what());
} }
SDCardLogger::printDebugToSerial(true); SDCardLogger::printDebugToSerial(PRINT_TO_SERIAL);
// https://stackoverflow.com/questions/60442350/arduinos-esp-log-set-vprintf-does-not-work-on-esp32 // https://stackoverflow.com/questions/60442350/arduinos-esp-log-set-vprintf-does-not-work-on-esp32
esp_log_set_vprintf(&SDCardLogger::vprintf_into_sd); esp_log_set_vprintf(&SDCardLogger::vprintf_into_sd);
...@@ -266,10 +266,11 @@ void loop() { ...@@ -266,10 +266,11 @@ void loop() {
queue.pop(); queue.pop();
xSemaphoreGive(xMutex); xSemaphoreGive(xMutex);
RequestInformation requestInformation{POST, "influxdb.qe-forte.uibk.ac.at",
80, "/api/v2/write?org=QE&bucket=esp32test&precision=s",
data, headers};
try { try {
RequestInformation requestInformation{POST, "influxdb.qe-forte.uibk.ac.at",
80, "/api/v2/write?org=QE&bucket=esp32test&precision=s",
data, headers};
connectionManager.connect(requestInformation); connectionManager.connect(requestInformation);
} catch (const std::exception &e) { } catch (const std::exception &e) {
esp_log_write(ESP_LOG_ERROR, TAG_GSM, "Error sending data: %s\n", e.what()); esp_log_write(ESP_LOG_ERROR, TAG_GSM, "Error sending data: %s\n", e.what());
...@@ -277,10 +278,6 @@ void loop() { ...@@ -277,10 +278,6 @@ void loop() {
esp_log_write(ESP_LOG_DEBUG, TAG_GSM, "Data sent: %s\n", data.c_str()); esp_log_write(ESP_LOG_DEBUG, TAG_GSM, "Data sent: %s\n", data.c_str());
} }
// RequestInformation requestInformation("GET", "vsh.pp.ua", "/TinyGSM/logo.txt", "");
// auto s = connectionManager.connect(80, requestInformation);
// esp_log_write(ESP_LOG_DEBUG, TAG_GSM, "Response: %s\n", s.c_str());
connectionManager.gprsDisconnect(); connectionManager.gprsDisconnect();
delay(5000L); delay(5000L);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment