Stability fixes

This commit is contained in:
iranl
2024-04-14 21:54:06 +02:00
parent 8f8666cc75
commit 50b23f2ab2
7 changed files with 22 additions and 82 deletions

View File

@@ -1,6 +1,6 @@
#pragma once
#define NUKI_HUB_VERSION "8.34-pre-2"
#define NUKI_HUB_VERSION "8.34-pre-3"
#define GITHUB_LATEST_RELEASE_URL "https://github.com/technyon/nuki_hub/releases/latest"
#define GITHUB_LATEST_RELEASE_API_URL "https://api.github.com/repos/technyon/nuki_hub/releases/latest"

View File

@@ -592,7 +592,7 @@ void Network::registerMqttReceiver(MqttReceiver* receiver)
void Network::onMqttDataReceivedCallback(const espMqttClientTypes::MessageProperties& properties, const char* topic, const uint8_t* payload, size_t len, size_t index, size_t total)
{
uint8_t value[800] = {0};
uint8_t value[360] = {0};
size_t l = min(len, sizeof(value)-1);
for(int i=0; i<l; i++)

View File

@@ -190,8 +190,7 @@ void NetworkLock::onMqttDataReceived(const char* topic, byte* payload, const uns
if(comparePrefixedPath(topic, mqtt_topic_config_action))
{
if(strcmp(value, "") == 0 || strcmp(value, "--") == 0) return;
Log->print(F("Config action received: "));
Log->println(value);
if(_configUpdateReceivedCallback != NULL)
{
_configUpdateReceivedCallback(value);

View File

@@ -182,8 +182,7 @@ void NetworkOpener::onMqttDataReceived(const char* topic, byte* payload, const u
if(comparePrefixedPath(topic, mqtt_topic_config_action))
{
if(strcmp(value, "") == 0 || strcmp(value, "--") == 0) return;
Log->print(F("Config action received: "));
Log->println(value);
if(_configUpdateReceivedCallback != NULL)
{
_configUpdateReceivedCallback(value);

View File

@@ -706,21 +706,6 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
return;
}
updateConfig();
while ((!_nukiConfigValid || !_nukiAdvancedConfigValid) && _retryConfigCount < 11)
{
updateConfig();
}
if(!_nukiConfigValid || !_nukiAdvancedConfigValid)
{
jsonResult["general"] = "invalidConfig";
serializeJson(jsonResult, _resbuf, sizeof(_resbuf));
_network->publishConfigCommandResult(_resbuf);
return;
}
Nuki::CmdResult cmdResult;
const char *basicKeys[] = {"name", "latitude", "longitude", "pairingEnabled", "buttonEnabled", "ledFlashEnabled", "timeZoneOffset", "dstMode", "fobAction1", "fobAction2", "fobAction3", "operatingMode", "advertisingMode", "timeZone"};
const char *advancedKeys[] = {"intercomID", "busModeSwitch", "shortCircuitDuration", "electricStrikeDelay", "randomElectricStrikeDelay", "electricStrikeDuration", "disableRtoAfterRing", "rtoTimeout", "doorbellSuppression", "doorbellSuppressionDuration", "soundRing", "soundOpen", "soundRto", "soundCm", "soundConfirmation", "soundLevel", "singleButtonPressAction", "doubleButtonPressAction", "batteryType", "automaticBatteryTypeDetection"};
@@ -1341,21 +1326,7 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value)
_network->publishKeypadJsonCommandResult("keypadNotAvailable");
return;
}
updateConfig();
while (!_nukiConfigValid && _retryConfigCount < 11)
{
updateConfig();
}
if(_configRead && _nukiConfigValid)
{
_network->publishKeypadJsonCommandResult("keypadNotAvailable");
return;
}
_network->publishKeypadJsonCommandResult("invalidConfig");
_network->publishKeypadJsonCommandResult("configNotReady");
return;
}

View File

@@ -643,21 +643,6 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
return;
}
updateConfig();
while ((!_nukiConfigValid || !_nukiAdvancedConfigValid) && _retryConfigCount < 11)
{
updateConfig();
}
if(!_nukiConfigValid || !_nukiAdvancedConfigValid)
{
jsonResult["general"] = "invalidConfig";
serializeJson(jsonResult, _resbuf, sizeof(_resbuf));
_network->publishConfigCommandResult(_resbuf);
return;
}
Nuki::CmdResult cmdResult;
const char *basicKeys[] = {"name", "latitude", "longitude", "autoUnlatch", "pairingEnabled", "buttonEnabled", "ledEnabled", "ledBrightness", "timeZoneOffset", "dstMode", "fobAction1", "fobAction2", "fobAction3", "singleLock", "advertisingMode", "timeZone"};
const char *advancedKeys[] = {"unlockedPositionOffsetDegrees", "lockedPositionOffsetDegrees", "singleLockedPositionOffsetDegrees", "unlockedToLockedTransitionOffsetDegrees", "lockNgoTimeout", "singleButtonPressAction", "doubleButtonPressAction", "detachedCylinder", "batteryType", "automaticBatteryTypeDetection", "unlatchDuration", "autoLockTimeOut", "autoUnLockDisabled", "nightModeEnabled", "nightModeStartTime", "nightModeEndTime", "nightModeAutoLockEnabled", "nightModeAutoUnlockDisabled", "nightModeImmediateLockOnStart", "autoLockEnabled", "immediateAutoLockEnabled", "autoUpdateEnabled"};
@@ -1323,21 +1308,7 @@ void NukiWrapper::onKeypadJsonCommandReceived(const char *value)
_network->publishKeypadJsonCommandResult("keypadNotAvailable");
return;
}
updateConfig();
while (!_nukiConfigValid && _retryConfigCount < 11)
{
updateConfig();
}
if(_configRead && _nukiConfigValid)
{
_network->publishKeypadJsonCommandResult("keypadNotAvailable");
return;
}
_network->publishKeypadJsonCommandResult("invalidConfig");
_network->publishKeypadJsonCommandResult("configNotReady");
return;
}

View File

@@ -112,8 +112,8 @@ void setupTasks()
{
// configMAX_PRIORITIES is 25
xTaskCreatePinnedToCore(networkTask, "ntw", 8192, NULL, 3, &networkTaskHandle, 1);
xTaskCreatePinnedToCore(nukiTask, "nuki", 3328, NULL, 2, &nukiTaskHandle, 1);
xTaskCreatePinnedToCore(networkTask, "ntw", 10240, NULL, 3, &networkTaskHandle, 1);
xTaskCreatePinnedToCore(nukiTask, "nuki", 5120, NULL, 2, &nukiTaskHandle, 1);
xTaskCreatePinnedToCore(presenceDetectionTask, "prdet", 896, NULL, 5, &presenceDetectionTaskHandle, 1);
}