Skip to content

Commit

Permalink
0.8.134
Browse files Browse the repository at this point in the history
* combined Ethernet and WiFi variants - Ethernet is now always included, but needs to be enabled if needed
* improved statistic data in `/system`
  • Loading branch information
lumapu committed Aug 10, 2024
1 parent c427696 commit a770243
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 98 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/compile_development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ jobs:
matrix:
variant:
- opendtufusion
- opendtufusion-ethernet
- opendtufusion-16MB
- opendtufusion-ethernet-16MB
- esp8266
- esp8266-all
- esp8266-minimal
Expand All @@ -35,7 +33,6 @@ jobs:
- esp32-wroom32
- esp32-wroom32-minimal
- esp32-wroom32-prometheus
- esp32-wroom32-ethernet
- esp32-s2-mini
- esp32-c3-mini
steps:
Expand Down Expand Up @@ -95,16 +92,13 @@ jobs:
matrix:
variant:
- opendtufusion-de
- opendtufusion-ethernet-de
- opendtufusion-16MB-de
- opendtufusion-ethernet-16MB-de
- esp8266-de
- esp8266-all-de
- esp8266-prometheus-de
- esp8285-de
- esp32-wroom32-de
- esp32-wroom32-prometheus-de
- esp32-wroom32-ethernet-de
- esp32-s2-mini-de
- esp32-c3-mini-de
steps:
Expand Down
4 changes: 4 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Development Changes

## 0.8.134 - 2024-08-10
* combined Ethernet and WiFi variants - Ethernet is now always included, but needs to be enabled if needed
* improved statistic data in `/system`

## 0.8.133 - 2024-08-10
* Ethernet variants now support WiFi as fall back / configuration

Expand Down
12 changes: 0 additions & 12 deletions src/config/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,19 +282,7 @@ class settings {
return mLastSaveSucceed;
}

void getInfo(uint32_t *used, uint32_t *size) {
#if !defined(ESP32)
FSInfo info;
LittleFS.info(info);
*used = info.usedBytes;
*size = info.totalBytes;

DPRINTLN(DBG_INFO, F("-- FILESYSTEM INFO --"));
DPRINTLN(DBG_INFO, String(info.usedBytes) + F(" of ") + String(info.totalBytes) + F(" used"));
#else
DPRINTLN(DBG_WARN, F("not supported by ESP32"));
#endif
}

bool readSettings(const char* path) {
loadDefaults();
Expand Down
2 changes: 1 addition & 1 deletion src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 133
#define VERSION_PATCH 134
//-------------------------------------
typedef struct {
uint8_t ch;
Expand Down
89 changes: 20 additions & 69 deletions src/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,24 @@ build_flags = ${env:esp32-wroom32-minimal.build_flags}
-DENABLE_MQTT
-DPLUGIN_DISPLAY
-DENABLE_HISTORY
-DETHERNET
-DDEF_ETH_CS_PIN=15
-DDEF_ETH_SCK_PIN=14
-DDEF_ETH_MISO_PIN=12
-DDEF_ETH_MOSI_PIN=13
-DDEF_ETH_IRQ_PIN=4
-DDEF_ETH_RST_PIN=255
-DDEF_NRF_CS_PIN=5
-DDEF_NRF_CE_PIN=17
-DDEF_NRF_IRQ_PIN=16
-DDEF_NRF_MISO_PIN=19
-DDEF_NRF_MOSI_PIN=23
-DDEF_NRF_SCLK_PIN=18
-DDEF_CMT_CSB=27
-DDEF_CMT_FCSB=26
-DDEF_CMT_IRQ=34
-DDEF_CMT_SDIO=14
-DDEF_CMT_SCLK=12
monitor_filters =
esp32_exception_decoder

Expand Down Expand Up @@ -191,34 +209,6 @@ build_flags = ${env:esp32-wroom32-prometheus.build_flags}
monitor_filters =
esp32_exception_decoder

[env:esp32-wroom32-ethernet]
platform = espressif32
board = lolin_d32
build_flags = ${env:esp32-wroom32.build_flags}
-DETHERNET
-DDEF_ETH_CS_PIN=15
-DDEF_ETH_SCK_PIN=14
-DDEF_ETH_MISO_PIN=12
-DDEF_ETH_MOSI_PIN=13
-DDEF_ETH_IRQ_PIN=4
-DDEF_ETH_RST_PIN=255
-DDEF_NRF_CS_PIN=5
-DDEF_NRF_CE_PIN=17
-DDEF_NRF_IRQ_PIN=16
-DDEF_NRF_MISO_PIN=19
-DDEF_NRF_MOSI_PIN=23
-DDEF_NRF_SCLK_PIN=18
monitor_filters =
esp32_exception_decoder

[env:esp32-wroom32-ethernet-de]
platform = espressif32
board = lolin_d32
build_flags = ${env:esp32-wroom32-ethernet.build_flags}
-DLANG_DE
monitor_filters =
esp32_exception_decoder

[env:esp32-s2-mini]
platform = [email protected]
board = lolin_s2_mini
Expand Down Expand Up @@ -310,26 +300,6 @@ monitor_filters =
platform = [email protected]
board = esp32-s3-devkitc-1
upload_protocol = esp-builtin
build_flags = ${env:opendtufusion-minimal.build_flags}
-DENABLE_MQTT
-DPLUGIN_DISPLAY
-DENABLE_HISTORY
monitor_filters =
esp32_exception_decoder, colorize

[env:opendtufusion-de]
platform = [email protected]
board = esp32-s3-devkitc-1
upload_protocol = esp-builtin
build_flags = ${env:opendtufusion.build_flags}
-DLANG_DE
monitor_filters =
esp32_exception_decoder, colorize

[env:opendtufusion-ethernet]
platform = [email protected]
board = esp32-s3-devkitc-1
upload_protocol = esp-builtin
build_flags = ${env:opendtufusion-minimal.build_flags}
-DETHERNET
-DENABLE_MQTT
Expand All @@ -341,15 +311,14 @@ build_flags = ${env:opendtufusion-minimal.build_flags}
-DDEF_ETH_MOSI_PIN=40
-DDEF_ETH_IRQ_PIN=44
-DDEF_ETH_RST_PIN=43
-DDEF_ETH_ENABLED
monitor_filters =
esp32_exception_decoder, colorize

[env:opendtufusion-ethernet-de]
[env:opendtufusion-de]
platform = [email protected]
board = esp32-s3-devkitc-1
upload_protocol = esp-builtin
build_flags = ${env:opendtufusion-ethernet.build_flags}
build_flags = ${env:opendtufusion.build_flags}
-DLANG_DE
monitor_filters =
esp32_exception_decoder, colorize
Expand All @@ -371,21 +340,3 @@ build_flags = ${env:opendtufusion-16MB.build_flags}
-DLANG_DE
monitor_filters =
esp32_exception_decoder, colorize

[env:opendtufusion-ethernet-16MB]
platform = [email protected]
board = esp32-s3-devkitc-1
board_upload.flash_size = 16MB
upload_protocol = esp-builtin
build_flags = ${env:opendtufusion-ethernet.build_flags}
monitor_filters =
esp32_exception_decoder, colorize

[env:opendtufusion-ethernet-16MB-de]
platform = [email protected]
board = esp32-s3-devkitc-1
upload_protocol = esp-builtin
build_flags = ${env:opendtufusion-ethernet-16MB.build_flags}
-DLANG_DE
monitor_filters =
esp32_exception_decoder, colorize
77 changes: 67 additions & 10 deletions src/web/RestApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ class RestApi {
#ifndef ESP32
mHeapFreeBlk = ESP.getMaxFreeBlockSize();
mHeapFrag = ESP.getHeapFragmentation();
#else
mHeapFreeBlk = heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT);
if(mHeapFree > 0)
mHeapFrag = 100 - ((mHeapFreeBlk * 100) / mHeapFree);
else
mHeapFrag = 0;
#endif

#if defined(ESP32)
Expand Down Expand Up @@ -422,8 +428,6 @@ class RestApi {
obj[F("sdk")] = ESP.getSdkVersion();
obj[F("cpu_freq")] = ESP.getCpuFreqMHz();
obj[F("heap_free")] = mHeapFree;
obj[F("sketch_total")] = ESP.getFreeSketchSpace();
obj[F("sketch_used")] = ESP.getSketchSize() / 1024; // in kb
getGeneric(request, obj);

getRadioNrf(obj.createNestedObject(F("radioNrf")));
Expand All @@ -436,29 +440,82 @@ class RestApi {
getEthernetInfo(obj.createNestedObject(F("eth")));
#endif

obj[F("heap_frag")] = mHeapFrag;
obj[F("max_free_blk")] = mHeapFreeBlk;

#if defined(ESP32)
obj[F("chip_revision")] = ESP.getChipRevision();
obj[F("chip_model")] = ESP.getChipModel();
obj[F("chip_cores")] = ESP.getChipCores();
obj[F("heap_total")] = ESP.getHeapSize();
//obj[F("core_version")] = F("n/a");
//obj[F("flash_size")] = F("n/a");
//obj[F("heap_frag")] = F("n/a");
//obj[F("max_free_blk")] = F("n/a");
//obj[F("reboot_reason")] = F("n/a");

esp_reset_reason_t reason = esp_reset_reason();

// Reboot-Grund ausgeben
switch (reason) {
default:
[[fallthrough]];
case ESP_RST_UNKNOWN:
obj[F("reboot_reason")] = F("Unknown");
break;
case ESP_RST_POWERON:
obj[F("reboot_reason")] = F("Power on");
break;
case ESP_RST_EXT:
obj[F("reboot_reason")] = F("External");
break;
case ESP_RST_SW:
obj[F("reboot_reason")] = F("Software");
break;
case ESP_RST_PANIC:
obj[F("reboot_reason")] = F("Panic");
break;
case ESP_RST_INT_WDT:
obj[F("reboot_reason")] = F("Interrupt Watchdog");
break;
case ESP_RST_TASK_WDT:
obj[F("reboot_reason")] = F("Task Watchdog");
break;
case ESP_RST_WDT:
obj[F("reboot_reason")] = F("Watchdog");
break;
case ESP_RST_DEEPSLEEP:
obj[F("reboot_reason")] = F("Deepsleep");
break;
case ESP_RST_BROWNOUT:
obj[F("reboot_reason")] = F("Brownout");
break;
case ESP_RST_SDIO:
obj[F("reboot_reason")] = F("SDIO");
break;
}

const esp_partition_t *partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_COREDUMP, "coredump");
if (partition != NULL)
obj[F("flash_size")] = partition->address + partition->size;
#else
//obj[F("heap_total")] = F("n/a");
//obj[F("chip_revision")] = F("n/a");
//obj[F("chip_model")] = F("n/a");
//obj[F("chip_cores")] = F("n/a");
obj[F("heap_frag")] = mHeapFrag;
obj[F("max_free_blk")] = mHeapFreeBlk;
obj[F("core_version")] = ESP.getCoreVersion();
obj[F("flash_size")] = ESP.getFlashChipRealSize() / 1024; // in kb
obj[F("reboot_reason")] = ESP.getResetReason();
#endif
//obj[F("littlefs_total")] = LittleFS.totalBytes();
//obj[F("littlefs_used")] = LittleFS.usedBytes();

#if !defined(ESP32)
FSInfo info;
LittleFS.info(info);
obj[F("par_used_spiffs")] = info.usedBytes;
obj[F("par_size_spiffs")] = info.totalBytes;
#else
obj[F("par_size_spiffs")] = LittleFS.totalBytes();
obj[F("par_used_spiffs")] = LittleFS.usedBytes();
#endif

obj[F("par_size_app0")] = ESP.getFreeSketchSpace();
obj[F("par_used_app0")] = ESP.getSketchSize();

/*uint8_t max;
mApp->getSchedulerInfo(&max);
Expand Down

0 comments on commit a770243

Please sign in to comment.