Skip to content

Commit e2455bb

Browse files
committed
Merge branch 'dev'
2 parents 8785587 + 5e3e4c2 commit e2455bb

File tree

20 files changed

+12813
-12628
lines changed

20 files changed

+12813
-12628
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x5000,
3+
otadata, data, ota, 0xe000, 0x2000,
4+
app0, app, ota_0, 0x10000, 0x330000,
5+
app1, app, ota_1, 0x340000,0x330000,
6+
spiffs, data, spiffs, 0x670000,0x180000,
7+
coredump, data, coredump,,64K

docs/system/update.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22

33
<img width="320" src="https://github.com/user-attachments/assets/d7f76c8a-5290-4723-b286-704c574d6beb" />
44

5-
New firmware releases are published on github. They are listed here.
6-
If there is a new release, the app will notify it's availability.
5+
This module supports Over the Air Updates (OTA).
6+
There are 2 ways to update the firmware in this module:
77

88
<img width="362" src="https://github.com/user-attachments/assets/cf72875f-02cf-4c78-97a0-56b2a1723d71" />
9+
* Using GitHub releases
910

11+
* List of firmware releases is showed here
12+
* Select one of the releases to install. In general it is advised to install the most recent version.
13+
* If there is a new release, the app will notify it's availability.
14+
* See here for details on releases: [releases](https://github.com/MoonModules/MoonLight/releases)
1015

11-
Select one of the releases to install. In general it is advised to install the most recent version. 🚧
16+
* Manually via Upload
17+
* Select choose file, Press Upload if asked for Are you sure?.
1218

13-
Firmware can also be uploaded manually. Select choose file, Press Upload if asked for Are you sure you want to overwrite the existing firmware with a new one?. Wait until the connection gets lost and is re-established. Then the new firmare is installed.
19+
When starting the update, a progress indicator is shown, upon completion the device will restart with the new firmware.
20+
21+
!!! warning "Uptate on small devices not possible"
22+
On some devices firmware update using above methods is not possible (yet) due to a limited amount of file size or memory (ESP32-D0 devices). Use the [Installer](https://moonmodules.org/MoonLight/gettingstarted/installation/) procedure instead (without erasing the device)

firmware/esp32-p4.ini

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ lib_deps =
2121
; platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip
2222
; board = ESP32-P4 ; https://github.com/pioarduino/platform-espressif32/blob/565f02434cd38858a59b7a010c950ffb2bec51df/boards/esp32-p4.json#L24
2323
board = esp32-p4-evboard ; https://github.com/pioarduino/platform-espressif32/blob/565f02434cd38858a59b7a010c950ffb2bec51df/boards/esp32-p4-evboard.json
24+
platform_packages = framework-arduinoespressif32 @ https://github.com/troyhacks/arduino-esp32#feature/esp32p4
25+
framework-arduinoespressif32-libs @ https://github.com/troyhacks/esp32-arduino-libs#main
2426
board_build.partitions = default_16MB.csv ;boards/ESP32_8MB.csv
2527
; framework = arduino
2628
; monitor_speed = 115200
@@ -80,3 +82,119 @@ lib_deps = ${esp32-p4-base.lib_deps}
8082
; E (3783) H_SDIO_DRV: sdio card init failed
8183

8284
; FreeRTOS: FreeRTOS Task "sdio_read" should not return, Aborting now!
85+
86+
87+
[env:esp32-p4-8MB_troyhacks_personal]
88+
;; THIS IS PIOARDUINO NOW, NOT PLATFORMIO!
89+
; build_src_filter = +<**/*.c>
90+
; +<**/*.cpp>
91+
; +<**/*.S>
92+
; -<**/dmx*>
93+
; -<**/async-mqtt-client/**>
94+
; -<**/methods/Esp32_i2s*>
95+
; -<**/espalexa/**>
96+
; -<**/DS1307RTC*>
97+
; -<**/dependencies/dmx>
98+
; platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.30-2/platform-espressif32.zip ;; https://github.com/troyhacks/platform-espressif32#Arduino/IDF5
99+
; platform_packages = framework-arduinoespressif32 @ https://github.com/troyhacks/arduino-esp32#feature/esp32p4
100+
; framework-arduinoespressif32-libs @ https://github.com/troyhacks/esp32-arduino-libs#main
101+
; toolchain-riscv32-esp @ https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip
102+
board_build.arduino.upstream_packages = no
103+
board = esp32-p4-evboard
104+
board_build.mcu = esp32p4
105+
board_build.f_cpu = 360000000L
106+
board_build.f_flash = 80000000L
107+
; board_build.arduino.memory_type = qio_opi
108+
build_unflags = -O2
109+
build_flags = ${esp32-p4-base.build_flags}
110+
-Ofast
111+
-ffast-math
112+
-mstrict-align
113+
-fipa-pta
114+
-freorder-blocks
115+
-fno-jump-tables
116+
-fno-tree-switch-conversion
117+
-Wwrite-strings
118+
-fstrict-volatile-bitfields
119+
-D WLEDMM_FASTPATH
120+
-D WLEDMM_REMAP_AT_OUTPUT
121+
-D PARLIO
122+
; -D WLED_DISABLE_LOGGING
123+
; -D PARLIO_TIMER
124+
; -D PARLIO_AUTO_OVERCLOCK
125+
-D WLED_DANGEROUS_OPTIMIZATIONS
126+
-D ARDUINO_EVENT_RUNNING_CORE=0
127+
-D CONFIG_ASYNC_TCP_RUNNING_CORE=0
128+
; If you don't set PARLIO_PINS it's OK, it just sets all pins to disabled. Still "outputs" tho.
129+
-D PARLIO_PINS=2,3,4,5,6,20,21,22,23,26,27,32,33,36,47,48 ;; GPIOs beyond 36 require some special ESP32-P4 LDO code or 47,48 don't work- added to WLED::setup()!
130+
-D IMAGECACHE_BG_PRIORITY=1 ;; 1 is the lowst real priority, least run. 5 slows other things down.
131+
-D CORE_DEBUG_LEVEL=0 ;; ESP_LOG_VERBOSE ;; ESP_LOG_VERBOSE == 5
132+
-D WLED_USE_ETHERNET ;; Coexistence is slower but both work now. Ethernet is preferred automatically.
133+
-D WLED_USE_ETHERNET_ONLY ;; Disable WiFi for performance reasons - on the P4 it needs high priority background tasks to talk to the C6
134+
; -D WLED_DEBUG
135+
-D NDEBUG ;; comment this out if REALLY debugging for things like Parallel IO, PPA, etc
136+
-D ARTNET_TIMER
137+
-D MAX_LEDS=65535 ;; 18432
138+
-D MAX_LEDS_PER_BUS=65535 ;; 18432
139+
-D MAX_LED_MEMORY=64000000 ;; times ONE HUNDRED
140+
-D DEFAULT_LED_TYPE=TYPE_NET_ARTNET_RGB
141+
-D LEDPIN=192 ;; at least get 192.x.x.x set properly for Art-Net
142+
-D BTNPIN=46 ;; Boot button is on GPIO 35 and works as a "button", but polling it messes up Ethernet.
143+
-D CONFIG_ASYNC_TCP_TASK_STACK_SIZE=30000
144+
-D BOARD_HAS_PSRAM
145+
-D WLED_USE_PSRAM
146+
; -D WLED_USE_PSRAM_JSON
147+
; -D ALL_JSON_TO_PSRAM
148+
-Wno-deprecated-declarations
149+
-Wno-attributes
150+
-D ESP_PLATFORM=1
151+
-D WLED_USE_MY_CONFIG
152+
-g
153+
-D FASTLED_NO_FASTLED
154+
-D WLED_RELEASE_NAME=ESP32-P4_16MB
155+
-D WLED_WATCHDOG_TIMEOUT=100 ;; Setting >0 will make the watchdog not panic. Workaround for now.
156+
-D USERMOD_AUDIOREACTIVE
157+
-D USERMOD_AUTO_PLAYLIST
158+
-D UM_AUDIOREACTIVE_USE_ESPDSP_FFT
159+
-D SR_DMTYPE=9 ;; 9 = ES8311 (new) which is the codec chip on the ESP32-P4 EV board
160+
-D SR_ENABLE_DEFAULT
161+
; -D TROYHACKS_FAILSAFE_BUSSES ;; in case you have a bus type causing resets during testing, turn this on, upload, busses will be removed at boot. Then reflash without this flag.
162+
-D WLED_DISABLE_INFRARED
163+
-D WLED_DISABLE_ESPNOW ;; not working yet due to API changes in v5.3
164+
-D WLED_DISABLE_ALEXA
165+
-D WLED_DISABLE_HUESYNC
166+
-D WLED_DISABLE_MQTT
167+
-D WLED_DISABLE_LOXONE
168+
-D WLED_DISABLE_ADALIGHT ;; this no longer disables serial receive
169+
-D CONFIG_ADC_SUPPRESS_DEPRECATE_WARN
170+
-D CONFIG_I2S_SUPPRESS_DEPRECATE_WARN
171+
-D WLED_DISABLE_IMPROV_WIFISCAN
172+
-D USERMOD_ANIMARTRIX # needs to be changed from int to uint32_t in the base class: virtual void setPixelColor(uint32_t index, rgb pixel) = 0;
173+
; -D WLEDMM_NO_MAP_RESET
174+
; -D WLED_DEBUG_MAPS
175+
; -D ES8311_ADDR=0x18
176+
lib_deps = ${esp32-p4-base.lib_deps}
177+
; https://github.com/Makuna/NeoPixelBus#CORE3 ;; https://github.com/troyhacks/NeoPixelBus#CORE3
178+
; https://github.com/softhack007/FastLED.git#ESP32-C6
179+
; https://github.com/troyhacks/ESPAsyncWebServer ;; #v2.3.0 ;; https://github.com/softhack007/ESPAsyncWebServer.git#ESP32-C6
180+
; https://github.com/netmindz/animartrix.git#e6b7509b391cab97b59b8eb19580e67d4203ae7d # needs to be changed from int to uint32_t in the base class: virtual void setPixelColor(uint32_t index, rgb pixel) = 0;
181+
lib_ignore = IRremoteESP8266
182+
; WebServer
183+
SD
184+
SD_MMC
185+
board_build.partitions = boards/TROYP4_ESP32_8MB_1500KB_FS.csv ;; WLED_ESP32_8MB.csv
186+
board_build.flash_mode = qio
187+
; monitor_filters = esp32_exception_decoder, colorize
188+
; monitor_speed = 115200
189+
upload_speed = 921600
190+
; framework = arduino
191+
; lib_compat_mode = strict
192+
; extra_scripts =
193+
; pre:pio-scripts/set_version.py
194+
; pre:pio-scripts/build-html.py
195+
; post:pio-scripts/output_bins.py
196+
; post:pio-scripts/strip-floats.py
197+
; pre:pio-scripts/user_config_copy.py
198+
; pre:pio-scripts/load_usermods.py
199+
; pre:pio-scripts/build_ui.py
200+
; post:pio-scripts/validate_modules.py ;; double-check the build output usermods

interface/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

interface/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "moonlight",
3-
"version": "0.5.9.1",
3+
"version": "0.5.9.2",
44
"private": true,
55
"scripts": {
66
"dev": "vite dev",

interface/src/lib/stores/telemetry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let telemetry_data = {
1111
restartNeeded: false, // 🌙 restartNeeded Indicates if the system needs to be restarted
1212
safeMode: false, // 🌙 safeMode Indicates if the system is in safe mode
1313
saveNeeded: false, // 🌙 saveNeeded Indicates that changes has been made which need to be saved (or canceled)
14-
hostName: '' // 🌙 to show in title and statusbar
14+
hostName: "MoonLight" // 🌙 to show in title and statusbar
1515
},
1616
battery: {
1717
soc: -1,

interface/src/routes/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
// if (!location.host.includes("captive.apple.com")) // 🌙 dirty workaround to not show this on macOS captive portal...
9999
// notifications.error('Connection to device lost', 5000);
100100
// $telemetry.rssi.disconnected = true; // 🌙
101-
telemetry.setRSSI({ rssi: 0, ssid: '', safeMode: false, restartNeeded: false, saveNeeded: false , hostName: '' });
101+
telemetry.setRSSI({ rssi: 0, ssid: '', safeMode: false, restartNeeded: false, saveNeeded: false , hostName: 'MoonLight' }); // 🌙 add safeMode etc
102102
};
103103
104104
const handleError = (data: any) => console.error(data);

interface/src/routes/menu.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
title: 'Live Scripts',
8484
icon: BulbIcon,
8585
href: '/moonbase/module?module=liveScripts',
86-
feature: page.data.features.moonlight,
86+
feature: page.data.features.livescript,
8787
},
8888
{
8989
title: 'Info',

lib/framework/DownloadFirmwareService.cpp

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313

1414
#include <DownloadFirmwareService.h>
1515

16-
extern const uint8_t rootca_crt_bundle_start[] asm("_binary_src_certs_x509_crt_bundle_bin_start");
17-
extern const uint8_t rootca_crt_bundle_end[] asm("_binary_src_certs_x509_crt_bundle_bin_end");
16+
// 🌙 Temporarily skip cert validation !!!!
17+
// extern const uint8_t rootca_crt_bundle_start[] asm("_binary_src_certs_x509_crt_bundle_bin_start");
18+
// extern const uint8_t rootca_crt_bundle_end[] asm("_binary_src_certs_x509_crt_bundle_bin_end");
1819

19-
static EventSocket *_socket = nullptr;
20+
static EventSocket *_socket2 = nullptr; //🌙 _socket2
2021
static int previousProgress = 0;
2122
JsonDocument doc;
2223

@@ -25,7 +26,7 @@ void update_started()
2526
String output;
2627
doc["status"] = "preparing";
2728
JsonObject jsonObject = doc.as<JsonObject>();
28-
_socket->emitEvent(EVENT_DOWNLOAD_OTA, jsonObject);
29+
_socket2->emitEvent(EVENT_DOWNLOAD_OTA, jsonObject);
2930
}
3031

3132
void update_progress(int currentBytes, int totalBytes)
@@ -36,7 +37,7 @@ void update_progress(int currentBytes, int totalBytes)
3637
{
3738
doc["progress"] = progress;
3839
JsonObject jsonObject = doc.as<JsonObject>();
39-
_socket->emitEvent(EVENT_DOWNLOAD_OTA, jsonObject);
40+
_socket2->emitEvent(EVENT_DOWNLOAD_OTA, jsonObject);
4041
ESP_LOGD(SVK_TAG, "HTTP update process at %d of %d bytes... (%d %%)", currentBytes, totalBytes, progress);
4142
}
4243
previousProgress = progress;
@@ -46,7 +47,7 @@ void update_finished()
4647
{
4748
doc["status"] = "finished";
4849
JsonObject jsonObject = doc.as<JsonObject>();
49-
_socket->emitEvent(EVENT_DOWNLOAD_OTA, jsonObject);
50+
_socket2->emitEvent(EVENT_DOWNLOAD_OTA, jsonObject);
5051

5152
// delay to allow the event to be sent out
5253
vTaskDelay(100 / portTICK_PERIOD_MS);
@@ -56,11 +57,13 @@ void updateTask(void *param)
5657
{
5758
WiFiClientSecure client;
5859

59-
#if ESP_ARDUINO_VERSION_MAJOR == 3
60-
client.setCACertBundle(rootca_crt_bundle_start, rootca_crt_bundle_end - rootca_crt_bundle_start);
61-
#else
62-
client.setCACertBundle(rootca_crt_bundle_start);
63-
#endif
60+
// 🌙 Temporarily skip cert validation !!!!
61+
client.setInsecure();
62+
// #if ESP_ARDUINO_VERSION_MAJOR == 3
63+
// client.setCACertBundle(rootca_crt_bundle_start, rootca_crt_bundle_end - rootca_crt_bundle_start);
64+
// #else
65+
// client.setCACertBundle(rootca_crt_bundle_start);
66+
// #endif
6467

6568
client.setTimeout(10);
6669

@@ -83,7 +86,7 @@ void updateTask(void *param)
8386
doc["status"] = "error";
8487
doc["error"] = httpUpdate.getLastErrorString().c_str();
8588
jsonObject = doc.as<JsonObject>();
86-
_socket->emitEvent(EVENT_DOWNLOAD_OTA, jsonObject);
89+
_socket2->emitEvent(EVENT_DOWNLOAD_OTA, jsonObject);
8790

8891
ESP_LOGE(SVK_TAG, "HTTP Update failed with error (%d): %s", httpUpdate.getLastError(), httpUpdate.getLastErrorString().c_str());
8992
#ifdef SERIAL_INFO
@@ -95,7 +98,7 @@ void updateTask(void *param)
9598
doc["status"] = "error";
9699
doc["error"] = "Update failed, has same firmware version";
97100
jsonObject = doc.as<JsonObject>();
98-
_socket->emitEvent(EVENT_DOWNLOAD_OTA, jsonObject);
101+
_socket2->emitEvent(EVENT_DOWNLOAD_OTA, jsonObject);
99102

100103
ESP_LOGE(SVK_TAG, "HTTP Update failed, has same firmware version");
101104
#ifdef SERIAL_INFO
@@ -154,6 +157,8 @@ esp_err_t DownloadFirmwareService::downloadUpdate(PsychicRequest *request, JsonV
154157
JsonObject jsonObject = doc.as<JsonObject>();
155158
_socket->emitEvent(EVENT_DOWNLOAD_OTA, jsonObject);
156159

160+
_socket2 = _socket;
161+
157162
if (xTaskCreatePinnedToCore(
158163
&updateTask, // Function that should be called
159164
"Update", // Name of the task (for debugging)

0 commit comments

Comments
 (0)