own wifi module

This commit is contained in:
2024-12-19 18:58:05 +01:00
parent 15b74c91f4
commit 0b9f5e2997
10 changed files with 137 additions and 115 deletions

View File

@ -20,6 +20,7 @@
#include "outputs.h"
#include "inputs.h"
#include "control.h"
#include "wifi.h"
#define I2C_MASTER_SCL 19
#define I2C_MASTER_SDA 18
@ -65,21 +66,22 @@ void app_main(void)
// initOutputs();
// initInputs();
// initSafety();
initWifi();
// initControl();
initMetrics();
// initMetrics();
esp_sntp_setoperatingmode(SNTP_OPMODE_POLL);
esp_sntp_setservername(0, "10.1.0.1"); // Set first NTP server local router
// esp_sntp_setoperatingmode(SNTP_OPMODE_POLL);
// esp_sntp_setservername(0, "10.1.0.1"); // Set first NTP server local router
sntp_set_time_sync_notification_cb(time_sync_notification_cb); // Register the SNTP time sync callback
esp_sntp_init();
// sntp_set_time_sync_notification_cb(time_sync_notification_cb); // Register the SNTP time sync callback
// esp_sntp_init();
while (1)
{
vTaskDelay(pdMS_TO_TICKS(1000));
// Print the current time
print_current_time();
// print_current_time();
ESP_LOGI(TAG, "SNTP Server 0 reachability: %i", esp_sntp_getreachability(0));
// ESP_LOGI(TAG, "SNTP Server 0 reachability: %i", esp_sntp_getreachability(0));
}
}