Skip to content

Commit

Permalink
Merge branch 'release/v1.6.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
matteocarnelos committed Apr 29, 2022
2 parents 475f615 + 755dddf commit 130a347
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion include/SailtrackModuleConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
#define STM_MQTT_HOST_ADDR STM_WIFI_GATEWAY_ADDR
#endif
#ifndef STM_MQTT_PORT
#define STM_MQTT_PORT MQTT_TCP_DEFAULT_PORT
#define STM_MQTT_PORT 1883
#endif
#ifndef STM_MQTT_USERNAME
#define STM_MQTT_USERNAME "mosquitto"
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SailtrackModule",
"version": "1.6.0",
"version": "1.6.1",
"description": "Base library required for all SailTrack's ESP32-based modules.",
"keywords": "sailtrack, module, sailing",
"repository": {
Expand Down
18 changes: 9 additions & 9 deletions src/SailtrackModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ void SailtrackModule::beginWifi(IPAddress ip) {

log_i("Successfully connected to '%s'!", STM_WIFI_SSID);

WiFi.onEvent([](WiFiEvent_t event) {
ESP_LOGE("Lost connection to '%s'", STM_WIFI_SSID);
ESP_LOGE("Rebooting...");
WiFi.onEvent([](WiFiEvent_t event, WiFiEventInfo_t info) {
log_e("Lost connection to '%s'", STM_WIFI_SSID);
log_e("Rebooting...");
ESP.restart();
}, SYSTEM_EVENT_STA_DISCONNECTED);
}, arduino_event_id_t::ARDUINO_EVENT_WIFI_STA_DISCONNECTED);
}

void SailtrackModule::beginOTA() {
Expand All @@ -76,7 +76,7 @@ void SailtrackModule::beginOTA() {
log_i("Update successfully completed!");
})
.onProgress([](unsigned int progress, unsigned int total) {
ESP_LOGV("Progress: %u", (progress / (total / 100)));
log_v("Progress: %u", (progress / (total / 100)));
})
.onError([](ota_error_t error) {
if (error == OTA_AUTH_ERROR) log_e("Error[%u]: Auth Failed", error);
Expand Down Expand Up @@ -107,8 +107,8 @@ void SailtrackModule::beginMqtt() {
delay(500);

if (!mqttConnected) {
ESP_LOGE("Impossible to connect to 'mqtt://%s@%s:%d'", STM_MQTT_USERNAME, STM_MQTT_HOST_ADDR, STM_MQTT_PORT);
ESP_LOGE("Rebooting...");
log_e("Impossible to connect to 'mqtt://%s@%s:%d'", STM_MQTT_USERNAME, STM_MQTT_HOST_ADDR, STM_MQTT_PORT);
log_e("Rebooting...");
ESP.restart();
}

Expand Down Expand Up @@ -140,8 +140,8 @@ void SailtrackModule::mqttEventHandler(void * handlerArgs, esp_event_base_t base
if (callbacks) callbacks->onMqttMessage(topic, doc.as<JsonObjectConst>());
} break;
case MQTT_EVENT_DISCONNECTED: {
ESP_LOGE("Lost connection to 'mqtt://%s@%s:%d'...", STM_MQTT_USERNAME, STM_MQTT_HOST_ADDR, STM_MQTT_PORT);
ESP_LOGE("Rebooting...");
log_e("Lost connection to 'mqtt://%s@%s:%d'...", STM_MQTT_USERNAME, STM_MQTT_HOST_ADDR, STM_MQTT_PORT);
log_e("Rebooting...");
ESP.restart();
} break;
case MQTT_EVENT_PUBLISHED: {
Expand Down

0 comments on commit 130a347

Please sign in to comment.