Skip to content

Commit

Permalink
Make boot faster by skipping portal timeout error
Browse files Browse the repository at this point in the history
  • Loading branch information
PBrunot committed May 18, 2024
1 parent 79f1f78 commit 28d1bf4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
12 changes: 6 additions & 6 deletions conf/conf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ namespace fabomatic

namespace conf::machine
{
static constexpr auto DEFAULT_AUTO_LOGOFF_DELAY{8h}; /* User will be log out after this delay. If 0h, no auto-logout. This may be overriden by backend data */
static constexpr auto BEEP_PERIOD{1min}; /* Device will beep before auto-poweroff. If 0min, no beeping. */
static constexpr auto DEFAULT_GRACE_PERIOD{2min}; /* Idle time before poweroff. If 0min, machine will stay on. */
static constexpr auto DELAY_BETWEEN_BEEPS{30s}; /* Beeps will be heard every 30s when the machine is about to shutdown */
static constexpr bool MAINTENANCE_BLOCK{true}; /* If true, machine needing maintenance will be blocked for normal users */
static constexpr auto LONG_TAP_DURATION{10s}; /* Minimum time to confirm by long tap maintenance*/
static constexpr auto DEFAULT_AUTO_LOGOFF_DELAY{12h}; /* User will be log out after this delay. If 0h, no auto-logout. This may be overriden by backend data */
static constexpr auto BEEP_PERIOD{2min}; /* Device will beep before auto-poweroff. If 0min, no beeping. */
static constexpr auto DEFAULT_GRACE_PERIOD{5min}; /* Idle time before poweroff. If 0min, machine will stay on. */
static constexpr auto DELAY_BETWEEN_BEEPS{30s}; /* Beeps will be heard every 30s when the machine is about to shutdown */
static constexpr bool MAINTENANCE_BLOCK{true}; /* If true, machine needing maintenance will be blocked for normal users */
static constexpr auto LONG_TAP_DURATION{10s}; /* Minimum time to confirm by long tap maintenance*/

} // namespace conf::machine

Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ board = esp32-s3-devkitc-1
board_build.partitions = default.csv
board_upload.flash_size = 4MB
build_type = debug
board_build.f_cpu = 160000000L
board_build.f_cpu = 240000000L
board_build.f_flash = 80000000L
build_flags = ${env.build_flags}
-D ARDUINO_USB_CDC_ON_BOOT
Expand Down
11 changes: 7 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ namespace fabomatic
wifiManager.resetSettings();
wifiManager.setTimeout(10); // fail fast for debugging
#endif

if (disable_portal || config.disablePortal)
auto must_skip = disable_portal || config.disablePortal;
if (must_skip)
{
wifiManager.setTimeout(1);
}
Expand All @@ -396,8 +396,11 @@ namespace fabomatic
}
else
{
Board::logic.changeStatus(Status::PortalFailed);
delay(3000);
if (!must_skip)
{
Board::logic.changeStatus(Status::PortalFailed);
delay(3000);
}
}

if (shouldSaveConfig)
Expand Down

0 comments on commit 28d1bf4

Please sign in to comment.