mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-06 19:46:54 +03:00
Revert "System instable"
This reverts commit cb84074981339d44266a1a999a7567a722af11f4. Cleanup REST API (#1255) * Replaced URIs: - value.html => value - statusflow.html => statusflow - cputemp.html => cputemp - rssi.html => rssi - statusflow.html => statusflow Removed URLs: - wasserzaehler.html * keep legacy API * . * . * . * . * . * . * updated links Remove ErrorMessage Fix various warnings which become fatal with later gcc versons in esp-idf 5.x (#1268) - we cannot use partial initialisation of structs in C++ files (copied from example C files initially it seems) - IRAM_ATTR uses a COUNTER, do not use the attribute on the implementation - provide missing copy implementations for Rgb and Hsv - one no longer can |= on volatile variables; use = | instead - fix project and header includes - avoid redefining BLINK_GPIO - Remove defined but unused variables - Fix printf formats - Add missing case statement (HTTP_EVENT_REDIRECT) - RMT needs to be updated to new interface (CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is on currently; see https://docs.espressif.com/projects/esp-idf/en/release-v5.0/esp32/api-reference/peripherals/rmt.html) - Adjust tcpip_adpater_* to esp_netif_* - Use buffered versions of *ntoa* functions for IPv4 addresses and not a static on the stack (also fixes warnings) - Whatever I missed Correct spelling of "Hostname" (#1270) Correct sdkonfig Increase max handler due to new handlers Revert "Cleanup REST API (#1255)" This reverts commitf3e73ec64a. Revert "Increase max handler due to new handlers" This reverts commitcbd63ad4bd. System instable Revert "Revert "Cleanup REST API (#1255)"" This reverts commit 2793c761413ffb987ab6a75da372e00e9f2f2cbd. Co-Authored-By: Bjoern A. Zeeb <patch@zabbadoz.net>
This commit is contained in:
@@ -41,19 +41,24 @@ static esp_err_t http_event_handler(esp_http_client_event_t *evt)
|
||||
case HTTP_EVENT_DISCONNECTED:
|
||||
ESP_LOGI(TAG_INTERFACEINFLUXDB, "HTTP Client Disconnected");
|
||||
break;
|
||||
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0))
|
||||
case HTTP_EVENT_REDIRECT:
|
||||
ESP_LOGI(TAG_INTERFACEINFLUXDB, "HTTP Client Redirect");
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
void InfluxDBPublish(std::string _key, std::string _content, std::string _timestamp) {
|
||||
char response_buffer[MAX_HTTP_OUTPUT_BUFFER] = {0};
|
||||
esp_http_client_config_t http_config = {
|
||||
.user_agent = "ESP32 Meter reader",
|
||||
.method = HTTP_METHOD_POST,
|
||||
.event_handler = http_event_handler,
|
||||
.buffer_size = MAX_HTTP_OUTPUT_BUFFER,
|
||||
.user_data = response_buffer
|
||||
};
|
||||
esp_http_client_config_t http_config;
|
||||
|
||||
http_config.user_agent = "ESP32 Meter reader";
|
||||
http_config.method = HTTP_METHOD_POST;
|
||||
http_config.event_handler = http_event_handler;
|
||||
http_config.buffer_size = MAX_HTTP_OUTPUT_BUFFER;
|
||||
http_config.user_data = response_buffer;
|
||||
|
||||
if (_influxDBUser.length() && _influxDBPassword.length()){
|
||||
http_config.username = _influxDBUser.c_str();
|
||||
|
||||
Reference in New Issue
Block a user