Skip to content

Commit

Permalink
Merge pull request #1284 from MichaelDvP/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy authored Sep 6, 2023
2 parents 9ebcfe3 + 01f6024 commit 27aa72e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@

- mqtt free mem check 60k
- small cosmetic changes to Searching in Customization web page
- update to [email protected]
11 changes: 10 additions & 1 deletion interface/src/framework/network/NetworkStatusForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ const networkStatusHighlight = ({ status }: NetworkStatus, theme: Theme) => {
}
};

const networkQualityHighlight = ({ rssi }: NetworkStatus, theme: Theme) => {
if (rssi <= -85) {
return theme.palette.error.main;
} else if (rssi <= -75) {
return theme.palette.warning.main;
}
return theme.palette.success.main;
};

export const isWiFi = ({ status }: NetworkStatus) => status === NetworkConnectionStatus.WIFI_STATUS_CONNECTED;
export const isEthernet = ({ status }: NetworkStatus) => status === NetworkConnectionStatus.ETHERNET_STATUS_CONNECTED;

Expand Down Expand Up @@ -110,7 +119,7 @@ const NetworkStatusForm: FC = () => {
<>
<ListItem>
<ListItemAvatar>
<Avatar>
<Avatar sx={{ bgcolor: networkQualityHighlight(data, theme) }}>
<SettingsInputAntennaIcon />
</Avatar>
</ListItemAvatar>
Expand Down
8 changes: 4 additions & 4 deletions lib/framework/NetworkSettingsService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ NetworkSettingsService::NetworkSettingsService(AsyncWebServer * server, FS * fs,
: _httpEndpoint(NetworkSettings::read, NetworkSettings::update, this, server, NETWORK_SETTINGS_SERVICE_PATH, securityManager)
, _fsPersistence(NetworkSettings::read, NetworkSettings::update, this, fs, NETWORK_SETTINGS_FILE)
, _lastConnectionAttempt(0) {
addUpdateHandler([&](const String & originId) { reconfigureWiFiConnection(); }, false);
}

void NetworkSettingsService::begin() {
// We want the device to come up in opmode=0 (WIFI_OFF), when erasing the flash this is not the default.
// If needed, we save opmode=0 before disabling persistence so the device boots with WiFi disabled in the future.
if (WiFi.getMode() != WIFI_OFF) {
Expand All @@ -21,10 +25,6 @@ NetworkSettingsService::NetworkSettingsService(AsyncWebServer * server, FS * fs,

WiFi.onEvent(std::bind(&NetworkSettingsService::WiFiEvent, this, _1));

addUpdateHandler([&](const String & originId) { reconfigureWiFiConnection(); }, false);
}

void NetworkSettingsService::begin() {
_fsPersistence.readFromFS();
reconfigureWiFiConnection();
}
Expand Down
10 changes: 9 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ unbuild_flags =
${common.core_unbuild_flags}

[espressi32_base]
platform = espressif32@6.3.2
platform = espressif32
framework = arduino
build_flags = ${common.build_flags}
build_unflags = ${common.unbuild_flags}
Expand All @@ -65,6 +65,8 @@ check_flags =
; the Web interface is built seperately
[env:ci]
extends = espressi32_base
; stay on platform 6.3.2 until heap issue is solved
platform = [email protected]
extra_scripts = scripts/rename_fw.py
board = esp32dev
board_build.partitions = esp32_partition_4M.csv
Expand All @@ -85,20 +87,26 @@ build_unflags = ${common.unbuild_flags}

[env:esp32_4M]
extends = espressi32_base
; stay on platform 6.3.2 until heap issue is solved
platform = [email protected]
board = esp32dev
board_upload.flash_size = 4MB
board_build.partitions = esp32_partition_4M.csv
build_flags = ${common.build_flags} -Os

[env:esp32_4Mplus]
extends = espressi32_base
; stay on platform 6.3.2 until heap issue is solved
platform = [email protected]
board = esp32dev
board_upload.flash_size = 4MB
board_build.partitions = esp32_asym_partition_4M.csv
build_flags = ${common.build_flags}

[env:esp32_16M]
extends = espressi32_base
; stay on platform 6.3.2 until heap issue is solved
platform = [email protected]
board = esp32dev
board_upload.flash_size = 16MB
board_build.partitions = esp32_partition_16M.csv
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.6.1-dev.0"
#define EMSESP_APP_VERSION "3.6.1-dev.1"

0 comments on commit 27aa72e

Please sign in to comment.