mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-11 09:04:53 +00:00
Merge pull request #5610 from tonhuisman/bugfix/Build-stats-without-chartjs-failed-other-typos
[Build] Fix build for Stats without ChartJS and other typos, update docs
This commit is contained in:
@@ -50,6 +50,32 @@ When using multiple PCF and/or MCP GPIO extenders, they must all be connected to
|
||||
|
||||
NB: If only 1 I2C Bus is configured, this section isn't shown.
|
||||
|
||||
--------------------
|
||||
External I2C EEPROM
|
||||
--------------------
|
||||
|
||||
Added: 2026-08-19
|
||||
|
||||
For persistently storing (numeric) values, an I2C EEPROM (AT24Cxx) or FRAM (MB85RCxx) module can be connected to the ESP, ranging in size from 4kB up to 256kB. This storage is made available as 'slots', where a single numeric value, of type ``double``, can be stored, and of course retrieved. Of each unit there is 128 bytes reserved for future (internal/housekeeping) use, and the remaining space is available for user-values.
|
||||
|
||||
The used module, I2C address (also used as 'enable' setting) and the I2C bus where the module is connected (when multiple I2C buses are available & configured), can be configured.
|
||||
|
||||
.. image:: Hardware_EEPROM.png
|
||||
|
||||
Once setup, a reboot is required to validate the connection to the module, and also a write-protected check is done, as some units come with a write-protect pin, to inhibit writing to the device.
|
||||
|
||||
When the module is enabled, the number of available slots is shown, and a warning if the module is write-protected.
|
||||
|
||||
.. image:: Hardware_EEPROM_WP.png
|
||||
|
||||
Saving a value in a slot is done with command ``WriteEE,<slot>,<value>``, and retrieving the value using the special variable ``[ReadEE#<slot>]``. The max. number of slots can be obtained via ``[ReadEE#max]`` and the write-protect status via ``[ReadEE#wp]`` (1 = write-protected).
|
||||
|
||||
NB: ``<slot>`` is in the range 0 .. (Max.slots - 1) !
|
||||
|
||||
All values can be erased from the module by using the command ``WriteEE,erase,erase``, and re-checking the write-protected status via ``WriteEE,check,wp``.
|
||||
|
||||
See also :ref:`Command-Reference`
|
||||
|
||||
|
||||
-------
|
||||
SD Card
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
@@ -1087,6 +1087,46 @@
|
||||
Force the unit into STA mode.
|
||||
|
||||
``WifiSTAMode``"
|
||||
"
|
||||
WriteEE","
|
||||
:green:`Rules`","
|
||||
Store a value in a 'slot' in an external EEPROM (AT24Cxx) or FRAM (MB85RCxx) I2C module. Numeric values only, using the resolution as used by Rules (``double`` or ``float``). Stored as a ``double`` value.
|
||||
|
||||
The external EEPROM/FRAM module can be configured on the :ref:`Hardware_page`
|
||||
|
||||
Stored values can be read back using the special variable ``[ReadEE#<slot>]``, using the same slot number. The number of slots available is shown once the module is enabled and found working. Some modules support a Write Protect pin. During initialization this feature is checked, and shown on the Hardware page when active.
|
||||
|
||||
Retrieving the max. number of slots available is available in ``[ReadEE#max]``, and the write-protect status via ``[ReadEE#wp]`` (1 = write protected).
|
||||
|
||||
NB: ``<slot>`` is in the range 0 .. (Max.slots - 1) !
|
||||
|
||||
Syntax:
|
||||
|
||||
``WriteEE,<slot>,<value>`` for writing a value to a slot.
|
||||
|
||||
``WriteRTC,erase,erase`` for erasing all data from the module.
|
||||
|
||||
``WriteRTC,check,wp`` for re-checking the write-protect status of the module.
|
||||
"
|
||||
"
|
||||
WriteRTC","
|
||||
:green:`Rules`","
|
||||
Store a value in a 'slot' in an external RTC (Realtime Clock) I2C module that has SRAM available, DS1307, DS3232 and PCF8583. Numeric values only, using the resolution as used by Rules (``double`` or ``float``). Stored as a ``double`` value.
|
||||
|
||||
The RTC module can be configured on the Tools/:ref:`tools-advanced` page in the **Time Source** section.
|
||||
|
||||
Stored values can be read back using the special variable ``[ReadRTC#<slot>]``, using the same slot number. The number of slots available is shown if the module is enabled and SRAM is available.
|
||||
|
||||
Retrieving the max. number of slots available is available in ``[ReadRTC#max]``.
|
||||
|
||||
NB: ``<slot>`` is in the range 0 .. (Max.slots - 1) !
|
||||
|
||||
Syntax:
|
||||
|
||||
``WriteRTC,<slot>,<value>`` for writing a value to a slot.
|
||||
|
||||
``WriteRTC,erase,erase`` for erasing all data from the module.
|
||||
"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions.repl
|
||||
|
||||
.. _command-reference:
|
||||
|
||||
Command Reference
|
||||
*****************
|
||||
|
||||
|
||||
@@ -240,6 +240,8 @@ Showing detailed information about the flash chip and used file system.
|
||||
* **Maximum open files**: Configured maximum number of simultaneous open files. Example: ``5``
|
||||
* **Maximum path length**: Maximum length of file name + path. Example: ``32``
|
||||
|
||||
.. _tools-advanced:
|
||||
|
||||
Advanced
|
||||
========
|
||||
|
||||
@@ -265,8 +267,10 @@ Supported RTC chips:
|
||||
|
||||
* `DS1307 <https://datasheets.maximintegrated.com/en/ds/DS1307.pdf>`_
|
||||
* `DS3231 <https://datasheets.maximintegrated.com/en/ds/DS3231.pdf>`_
|
||||
* `DS3232 <https://datasheets.maximintegrated.com/en/ds/DS3232.pdf>`_ (added: 2026-08-19)
|
||||
* `PCF8523 <https://www.nxp.com/docs/en/data-sheet/PCF8523.pdf>`_
|
||||
* `PCF8563 <https://www.nxp.com/docs/en/data-sheet/PCF8563.pdf>`_
|
||||
* `PCF8583 <https://www.nxp.com/docs/en/data-sheet/PCF8583.pdf>`_ (added: 2026-08-19 Not available in ``LIMIT_BUILD_SIZE`` builds)
|
||||
|
||||
Most modules sold with one of these RTC chips also have a battery socket to keep track of time while the rest is not powered.
|
||||
This allows ESPEasy to know the correct date and time after been powered off for a while, or deep sleep, without the need for working network to query a NTP server.
|
||||
@@ -281,6 +285,19 @@ When multiple I2C Buses are configured (ESP32 only), we need to configure on whi
|
||||
|
||||
NB: If only 1 I2C Bus is configured, this configuration option isn't shown.
|
||||
|
||||
Added: 2026-08-19
|
||||
|
||||
With some RTC chips, there is a battery-backed SRAM option available. This SRAM can be used for persistent storage of numeric values.
|
||||
|
||||
This storage is available in DS1307 (56 bytes = 7 slots), DS3232 (236 bytes = 29 slots) and PCF8583 (240 bytes = 30 slots).
|
||||
|
||||
If one of the supported Time Sources is connected, the number of available SRAM slots is shown.
|
||||
|
||||
Slots can be written using the ``WriteRTC,<slot>,<value>`` command, and read using the special variable ``[ReadRTC#<slot>]``, and the number of slots via ``[ReadRTC#max]``. See also :ref:`Command-Reference`
|
||||
|
||||
NB: ``<slot>`` is in the range 0 .. (Max.slots - 1) !
|
||||
|
||||
|
||||
|
||||
Procedure to configure a real time clock (RTC) chip:
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "../DataStructs/NWPluginData_static_runtime.h"
|
||||
#include "../../../src/DataStructs/ESPEasy_EventStruct.h"
|
||||
#include "../../../src/DataStructs/PluginStats_array.h"
|
||||
#include "../../../src/DataStructs/PluginStats_Config.h"
|
||||
|
||||
#if FEATURE_STORE_NETWORK_INTERFACE_SETTINGS
|
||||
# include "../../../src/Helpers/_ESPEasy_key_value_store.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../_NWPlugin_Helper.h"
|
||||
#ifdef USES_NW001
|
||||
#ifdef USES_NW002
|
||||
|
||||
|
||||
namespace ESPEasy {
|
||||
@@ -54,4 +54,4 @@ private:
|
||||
} // namespace ESPEasy
|
||||
|
||||
|
||||
#endif // ifdef USES_NW001
|
||||
#endif // ifdef USES_NW002
|
||||
|
||||
@@ -46,14 +46,14 @@ void handle_hardware() {
|
||||
if (isFormItem(F("pi2cbuspcf"))) {
|
||||
set3BitToUL(Settings.I2C_peripheral_bus, I2C_PERIPHERAL_BUS_PCFMCP, getFormItemInt(F("pi2cbuspcf")));
|
||||
}
|
||||
#endif // if FEATURE_I2C_MULTIPLE
|
||||
// EEPROM settings
|
||||
# if FEATURE_EEPROM_EXTERNAL
|
||||
const uint8_t i2cBus = getFormItemInt(F("pi2cbuseeprom"), 0);
|
||||
set3BitToUL(Settings.I2C_peripheral_bus, I2C_PERIPHERAL_BUS_EEPROM, i2cBus);
|
||||
# endif // if FEATURE_EEPROM_EXTERNAL
|
||||
|
||||
#if FEATURE_I2CMULTIPLEXER && !FEATURE_I2C_MULTIPLE && FEATURE_EEPROM_EXTERNAL
|
||||
constexpr uint8_t i2cBus = 0;
|
||||
#else // if FEATURE_I2CMULTIPLEXER && !FEATURE_I2C_MULTIPLE && FEATURE_EEPROM_EXTERNAL
|
||||
const uint8_t i2cBus = getFormItemInt(F("pi2cbuseeprom"), 0);
|
||||
set3BitToUL(Settings.I2C_peripheral_bus, I2C_PERIPHERAL_BUS_EEPROM, i2cBus);
|
||||
#endif // if FEATURE_I2CMULTIPLEXER && !FEATURE_I2C_MULTIPLE && FEATURE_EEPROM_EXTERNAL
|
||||
|
||||
#if FEATURE_EEPROM_EXTERNAL
|
||||
@@ -74,7 +74,6 @@ void handle_hardware() {
|
||||
|
||||
#endif // if FEATURE_EEPROM_EXTERNAL
|
||||
|
||||
#endif // if FEATURE_I2C_MULTIPLE
|
||||
#if defined(ESP32) && FEATURE_SD
|
||||
Settings.setSPIBusForSDCard(getFormItemInt(F("sdspibus"), 0));
|
||||
#endif // if defined(ESP32) && FEATURE_SD
|
||||
@@ -217,7 +216,7 @@ void handle_hardware() {
|
||||
if (eepromChecked && ESPEasy::eeprom::isEEPROMExternalWriteProtected()) {
|
||||
addHtml(F(" Write-protected!"));
|
||||
}
|
||||
if (eepromChecked && !ESPEasy::eeprom::isEEPROMExternalWriteProtected()) {
|
||||
if (eepromChecked) {
|
||||
addRowLabel(F("'WriteEE' slots available"));
|
||||
addHtmlInt(ESPEasy::eeprom::getEEPROMMaxSlots());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user