Skip to content

Commit

Permalink
Fixed bug introduced in latest commit casuing wifi timeout error on
Browse files Browse the repository at this point in the history
onboarding.
  • Loading branch information
carlhampuswall committed Jan 3, 2025
1 parent d4ab9a4 commit afab86a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions firmware/src/root_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,17 +818,26 @@ void RootTask::loadConfiguration()
OSMode os_mode = configuration_->getOSConfiguration()->mode;
#if SK_WIFI
if ((os_mode == OSMode::HASS || os_mode == OSMode::SPOTIFY) && !configuration_->loadWiFiConfiguration())
{
WiFiConfiguration wifi_config = configuration_->getWiFiConfiguration();
// TODO: send event to wifi to start STA part with given credentials
wifi_task_->getNotifier()->requestSTA(wifi_config);
}
else
{
// handle wifi config not loaded.
}
WiFiConfiguration wifi_config = configuration_->getWiFiConfiguration();
// TODO: send event to wifi to start STA part with given credentials
wifi_task_->getNotifier()->requestSTA(wifi_config);
#endif
if (configuration_->getOSConfiguration()->mode == HASS && !configuration_->loadMQTTConfiguration())
#if SK_MQTT
if (configuration_->getOSConfiguration()->mode == HASS && configuration_->loadMQTTConfiguration())
{
}
else
{
// handle mqtt config not loaded.
}
#endif

configuration_loaded_ = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion software/web-preact/src/components/wifi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const WiFiComp = () => {
var json = await response.json();
if (json.redirect == 'spotify') {
// window.location.href = '/?' + json.redirect;
window.location.href = 'http://192.168.2.90/?spotify';
window.location.href = `http://${window.location.hostname}/?spotify`;
} else {
window.location.href = '/?' + json.redirect;
}
Expand Down

0 comments on commit afab86a

Please sign in to comment.