Skip to content

Commit 7e55d29

Browse files
committed
Merge branch 'board-presets-p4'
2 parents 77a31dd + b1db675 commit 7e55d29

File tree

15 files changed

+12754
-12659
lines changed

15 files changed

+12754
-12659
lines changed

docs/moonbase/inputoutput.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Currently the following boards are defined. Not all are supported yet 🚧
1010

1111
For each board the following presets are defined:
1212

13-
* Modded: if any change to the default preset is made.
13+
* Modded: set when any pin differs from the selected board preset. Press off to return to the preset defaults.
1414
* Max Power in Watts: adjust the brightness to approach this max power, depending on the number of LEDs used. Default 10: 5V * 2A = 10W (so it runs fine on USB). Used by LED drivers, see [Drivers](../../moonlight/drivers/)
1515
* Jumper1: If the board contains a jumper, it can define pin behaviour. Eg. select between Infrared and Ethernet.
16-
* Pins: This module is the central place to assign functionality to gpio pins. Other modules and nodes use the pin assignments made here.
16+
* Pins: Assign functionality to gpio pins. Other modules and nodes use the pin assignments made here.
1717
* GPIO = gpio_num;
1818
* Usage: See below
1919
* Index: specify first, second, third, ... usage output, e.g. LED D01 to LED D16
@@ -28,7 +28,7 @@ For each board the following presets are defined:
2828

2929
* Supported
3030
* LEDs: Used by LED drivers to setup LED outputs, see [Drivers](../../moonlight/drivers/)
31-
* Voltage and Current: Sets energy monitoring, see [System status](../../system/status) and , see [System Metrics](../../system/metrics)
31+
* Voltage and Current: Sets energy monitoring, see [System status](../../system/status) and [System Metrics](../../system/metrics)
3232
* Infrared: Used by IR driver, see [Drivers](../../moonlight/drivers/)
3333
* Button LightsOn: sets on/off in [Light Control](../../moonlight/lightscontrol/)
3434
* Relay LightsOn: sets on/off in [Light Control](../../moonlight/lightscontrol/)
@@ -56,14 +56,29 @@ For each board the following presets are defined:
5656
![Dig Quad](https://quinled.info/wp-content/uploads/2021/11/QuinLED-Dig-Quad-AB_v3r1-2048x1154.png){: style="width:100px"}
5757
![Dig Octa](https://quinled.info/wp-content/uploads/2024/10/20240924_141857-2048x1444.png){: style="width:100px"}
5858

59-
* Dig 2Go, Dig Uno, Dig Quad: Choose the esp32-d0 (4MB) board in the [MoonLight Installer](../../gettingstarted/installer/)
60-
* Dig Octa: Choose the esp32-d0-16mb board in the [MoonLight Installer](../../gettingstarted/installer/)
59+
* [Dig 2Go](https://quinled.info/quinled-dig2go/), [Dig Uno](https://quinled.info/pre-assembled-quinled-dig-uno/), [Dig Quad](https://quinled.info/pre-assembled-quinled-dig-quad/): Choose the esp32-d0 (4MB) board in the [MoonLight Installer](../../gettingstarted/installer/)
60+
* [Dig Octa](https://quinled.info/quinled-dig-octa/): Choose the esp32-d0-16mb board in the [MoonLight Installer](../../gettingstarted/installer/)
6161
* On first install, erase flash first (Especially when other firmware like WLED was on it) as MoonLight uses a partition scheme with 3MB of flash (currently no OTA support).
62-
* You might need to reset your router if you first run WLED on the same MCU and no new IP is assigned.
62+
* After install, select the QuinLED board preset to have the pins assigned correctly.
63+
64+
!!! tip "Reset router"
65+
You might need to reset your router if you first run WLED on the same board and no new IP is assigned.
6366

6467
!!! Tip "Dig Uno USB"
6568
Remove fuse to connect USB cable to flash the board.
6669

70+
### MyHome-Control ESP32-P4 shield
71+
72+
![ESP32-P4 shield](https://shop.myhome-control.de/thumbnail/87/41/c2/1762031307/WLED_ESP32_P4_Shield_02_1920x1326.jpg?ts=1762031315){: style="width:320px"}
73+
74+
* See [ESP32-P4 shield](https://shop.myhome-control.de/en/ABC-WLED-ESP32-P4-shield/HW10027). Choose the esp32-p4-nano board in the [MoonLight Installer](../../gettingstarted/installer/)
75+
* On new ESP32-P4 Nano boards, the WiFi coprocessor needs to be updated first to a recent version, currently ESP-Hosted v2.0.17, see the link in the [MoonLight Installer](../../gettingstarted/installer/)
76+
* After install, select the **MHC P4 Nano Shield** board preset to have the pins assigned correctly.
77+
* Assuming 100W LED power; change if needed.
78+
* Jumper1: off (default): 16 LED pins. On: 8 LED pins, 4 RS-485 pins and 4 exposed pins (set also the switches on the board).
79+
* Add the Parallel LED Driver, see [Drivers](../../moonlight/drivers/). It uses [@troyhacks](https://github.com/troyhacks) his parallel IO driver to drive all LED pins configured for the shield.
80+
81+
6782
### SE16 v1
6883

6984
![SE-16p](../firmware/installer/images/esp32-s3-stephanelec-16p.jpg){: style="width:100px"}

docs/moonlight/drivers.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ The Drivers module defines layers and drivers.
1313
* Audio driver
1414
* Sensor drivers (microphone, gyro, MIDI controller)
1515

16+
Layouts need to be defined before drivers as the driver takes the layouts defined before itself, e.g. to define which LEDs to drive on which pins.
17+
1618
## Controls
1719

1820
* Nodes: a list of Layouts and Drivers
@@ -44,7 +46,7 @@ Want to add a Driver to MoonLight, see [develop](../../develop/overview/). See a
4446

4547
### Light Preset
4648

47-
* **Max Power**: 🆕 moved to [IO Module](../../moonbase/inputoutput/) board presets.
49+
* **Max Power**: 🆕 moved to [IO Module](../../moonbase/inputoutput) board presets.
4850

4951
* **Light preset**: Defines the channels per light and color order
5052

@@ -80,7 +82,7 @@ Receives Art-Net data from the network.
8082
!!! tip "Other setup"
8183
* Add a Layout driver to specifify the fixture you are displaying on, e.g. Single Line for Tubes or Panel for Matrices
8284
* Add the Parallel LED Driver to enable connected LEDs
83-
* Go to the [IO Module](../../moonbase/inputoutput/) to define a board preset.
85+
* Go to the [IO Module](../../moonbase/inputoutput) to define a board preset.
8486

8587
!!! tip "Running effects and Art-Net In"
8688
Effects can run at the same time, disable or delete them if you only want to run Art-Net In.

firmware/esp32-p4.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ lib_deps =
1919
; platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip
2020
; board = ESP32-P4 ; https://github.com/pioarduino/platform-espressif32/blob/565f02434cd38858a59b7a010c950ffb2bec51df/boards/esp32-p4.json#L24
2121
board = esp32-p4-evboard ; https://github.com/pioarduino/platform-espressif32/blob/565f02434cd38858a59b7a010c950ffb2bec51df/boards/esp32-p4-evboard.json
22-
platform_packages = framework-arduinoespressif32 @ https://github.com/troyhacks/arduino-esp32#feature/esp32p4
23-
framework-arduinoespressif32-libs @ https://github.com/troyhacks/esp32-arduino-libs#main
22+
; platform_packages = framework-arduinoespressif32 @ https://github.com/troyhacks/arduino-esp32#feature/esp32p4
23+
; framework-arduinoespressif32-libs @ https://github.com/troyhacks/esp32-arduino-libs#main
2424
board_build.partitions = default_16MB.csv ;boards/ESP32_8MB.csv
2525
upload_speed = 921600
2626
; framework = arduino

interface/src/lib/types/models.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ export type StaticSystemInformation = {
140140
flash_chip_size: number;
141141
flash_chip_speed: number;
142142
cpu_reset_reason: string;
143-
heap_info_app: string;
144-
heap_info_dma: string;
143+
heap_info_app: string; // 🌙
144+
heap_info_dma: string; // 🌙
145+
coprocessor?: string; // 🌙 optional as only for ESP32-P4
145146
};
146147

147148
export type SystemInformation = Analytics & StaticSystemInformation;

interface/src/routes/system/status/SystemStatus.svelte

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,21 @@
452452
</div>
453453
</div>
454454

455+
<!-- 🌙 -->
456+
{#if systemInformation.coprocessor}
457+
<div class="rounded-box bg-base-100 flex items-center space-x-3 px-4 py-2">
458+
<div class="mask mask-hexagon bg-primary h-auto w-10 flex-none">
459+
<CPU class="text-primary-content h-auto w-full scale-75" />
460+
</div>
461+
<div>
462+
<div class="font-bold">Coprocessor</div>
463+
<div class="text-sm opacity-75">
464+
{systemInformation.coprocessor}
465+
</div>
466+
</div>
467+
</div>
468+
{/if}
469+
455470
<div class="rounded-box bg-base-100 flex items-center space-x-3 px-4 py-2">
456471
<div class="mask mask-hexagon bg-primary h-auto w-10 flex-none">
457472
<Speed class="text-primary-content h-auto w-full scale-75" />

lib/framework/SystemStatus.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@
3232
#include "esp32c6/rom/rtc.h"
3333
#define ESP_TARGET "ESP32-C6";
3434
#elif CONFIG_IDF_TARGET_ESP32P4 // 🌙
35-
#include "esp32p4/rom/rtc.h"
36-
#define ESP_TARGET "ESP32-P4";
35+
#include "esp32p4/rom/rtc.h"
36+
#define ESP_TARGET "ESP32-P4";
37+
#include "esp_hosted_api_types.h"
38+
#include <esp_hosted.h>
39+
// #include "esp_hosted_host_fw_ver.h"
40+
// #include "esp_hosted_misc.h"
41+
// #include "esp_hosted_ota.h"
3742
#else
3843
#error Target CONFIG_IDF_TARGET is not supported
3944
#endif
@@ -169,6 +174,13 @@ esp_err_t SystemStatus::systemStatus(PsychicRequest *request)
169174
root["core_temp"] = temperatureRead();
170175
root["cpu_reset_reason"] = verbosePrintResetReason(esp_reset_reason());
171176
root["uptime"] = millis() / 1000;
177+
#ifdef CONFIG_IDF_TARGET_ESP32P4
178+
esp_hosted_coprocessor_fwver_t c6_fw_version;
179+
esp_hosted_get_coprocessor_fwversion(&c6_fw_version);
180+
char coprocessor[10];
181+
snprintf(coprocessor, sizeof(coprocessor), "v%d.%d.%d", c6_fw_version.major1, c6_fw_version.minor1, c6_fw_version.patch1);
182+
root["coprocessor"] = coprocessor;
183+
#endif
172184

173185
heapHealth(root["heap_info_app"].to<JsonVariant>(), MALLOC_CAP_INTERNAL);
174186
heapHealth(root["heap_info_dma"].to<JsonVariant>(), MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA);

0 commit comments

Comments
 (0)