Skip to content

Commit

Permalink
Enable OTA for all enviroments
Browse files Browse the repository at this point in the history
  • Loading branch information
melkati committed May 14, 2024
1 parent 0ea71cd commit 2137d8c
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 13 deletions.
15 changes: 9 additions & 6 deletions CO2_Gadget_Partitions.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x1E0000,
app1, app, ota_1, 0x1F0000,0x1E0000,
spiffs, data, spiffs, 0x3D0000,0x30000,
# app0 size 1,850,000 bytes
# app1 size 1,850,000 bytes
# spiffs size 300,000 bytes
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x1B0000,
app1, app, ota_1, 0x1C0000, 0x1B0000,
spiffs, data, spiffs, 0x370000, 0x4B000,
1 change: 1 addition & 0 deletions data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<a href="index.html" class="active">Home</a>
<a href="preferences.html">Preferences</a>
<a href="status.html">Status</a>
<a href="ota.html">OTA</a>
</div>
<div class="iconDarkLight" id="iconBulb">
<!-- <input type="checkbox"> -->
Expand Down
Binary file modified data/index.html.gz
Binary file not shown.
29 changes: 29 additions & 0 deletions data/ota.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="./style.css" />
<title>AsyncAElegantOTA Example</title>
<style>
/* Custom styles for the main page if needed */
</style>
</head>
<body>
<!-- Navigation bar -->
<div class="navbar">
<a href="index.html">Home</a>
<a href="preferences.html">Preferences</a>
<a href="status.html">Status</a>
<a href="ota.html" style="margin-left: auto;" class="active">OTA</a>
<!-- <a href="ota.html" class="active">OTA</a> -->
</div>

<!-- Main content -->
<div class="content">
<!-- iframe to load AsyncAElegantOTA -->
<iframe src="update" width="100%" height="600px"
frameborder="0"></iframe>
</div>
</body>
</html>
Binary file added data/ota.html.gz
Binary file not shown.
1 change: 1 addition & 0 deletions data/status.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<a href="index.html">Home</a>
<a href="preferences.html">Preferences</a>
<a href="status.html" class="active">Status</a>
<a href="ota.html">OTA</a>
</div>

<div class="content">
Expand Down
Binary file modified data/status.html.gz
Binary file not shown.
17 changes: 14 additions & 3 deletions data/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ input[type="checkbox"] {
float: right;
/* Alinea los botones a la derecha */
}

button {
background-color: #4caf50;
color: white;
Expand Down Expand Up @@ -303,24 +304,30 @@ button:hover {
top: 0;
width: 100%;
background-color: #f2f2f2;
padding: 10px 0;
padding: 0px 20px;
/* Add padding to space out links */
z-index: 1000; /* Ensure it's on top of other content */
}

.navbar a {
padding: 14px 20px;
text-decoration: none;
color: #333;
padding: 14px 20px;
/* Adjust padding */
}

.navbar a.active {
color: #999;
pointer-events: none; /* Disable pointer events for the active link */
}

#otaLink {
float: right;
}

/* Adjust content area to prevent overlap with navbar */
.content {
margin-top: 60px; /* Adjust the value according to your navbar height */
margin-top: 60px;
}

.status-item {
Expand Down Expand Up @@ -349,3 +356,7 @@ button:hover {
opacity: 0;
}
}

img {
display: none;
}
Binary file modified data/style.css.gz
Binary file not shown.
8 changes: 4 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ build_flags =
-DSUPPORT_MDNS
-DSUPPORT_MQTT
-DSUPPORT_MQTT_DISCOVERY
-DSUPPORT_OTA

;****************************************************************************************
;*** You can dissable debug by commenting the line with a semicolon at the beginning
Expand Down Expand Up @@ -48,8 +49,8 @@ upload_speed = 921600
monitor_speed = 115200
monitor_port = COM12
upload_port = COM12
monitor_filters = time, esp32_exception_decoder
board_build.partitions = CO2_Gadget_Partitions-no_ota.csv ; Others in Windows at C:\Users\%USER%\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\tools\partitions
monitor_filters = time, esp32_exception_decoder, colorize
board_build.partitions = CO2_Gadget_Partitions.csv ; Others in Windows at C:\Users\%USER%\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\tools\partitions
build_cache_dir = .pio/build
extra_scripts =
lib_ldf_mode = chain+
Expand Down Expand Up @@ -77,7 +78,7 @@ build_flags =
'-DWIFI_PW_CREDENTIALS=""'
-D MQTT_BROKER_SERVER="\"192.168.1.145"\"
-D CO2_GADGET_VERSION="\"0.12."\"
-D CO2_GADGET_REV="\"065-development"\"
-D CO2_GADGET_REV="\"070-development"\"
-DCACHE_DIR=".pio/build"
-DBUZZER_PIN=2 ; ESP32 pin GPIO13 connected to piezo buzzer
-DNEOPIXEL_PIN=26 ; Pinnumber for button for down/next and back / exit actions
Expand Down Expand Up @@ -289,7 +290,6 @@ lib_deps =
${common_env_data.lib_deps}
build_flags =
${common_env_data.build_flags}
-DSUPPORT_OTA
-DARDUINO_ESP32_DEV=1
-DBTN_UP=14 ; Pinnumber for button for up/previous and select / enter actions
-DBTN_DWN=0 ; Pinnum
Expand Down

0 comments on commit 2137d8c

Please sign in to comment.