Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/Network/_Network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Network
*******

A Network plugin is compable with a 'driver' for a network adapter.
A Network plugin is comparable with a 'driver' for a network adapter.

The first 2 entries will be the same for every ESPEasy setup and these cannot be removed.

Expand Down
71 changes: 38 additions & 33 deletions docs/source/Participate/PlatformIO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
PlatformIO
**********

ESP easy can be built using the Arduino IDE or PlatformIO (PIO).
Arduino IDE is not being used during development, so it may take some more effort to get it setup for building ESPeasy.
ESP easy can be built using the PlatformIO/pioarduino IDE (PIO).
Arduino IDE is no longer supported for development though it's technically possible to be used. It may take considerable effort to get it setup for building ESPeasy.

We *strongly* advise to use PlatformIO as build environment.
We *strongly* advise to use PIO as build environment.

PlatformIO is just the build, test and upload environment for many micro controllers like the ESP8266 and ESP32 we use.
PIO is just the build, test and upload environment for many micro controllers like the ESP8266 and ESP32 we use.

On top of that you need to use an editor, or so called IDE in which PlatformIO will be used.
On top of that you need to use an editor, or so called IDE in which PIO will be used.

The current choice is:

Expand All @@ -21,10 +21,10 @@ VSCode is free to use and available for Windows, MacOS and Linux.
Apart from VSCode, there are more available, like Eclipse, MS Visual Studio (IDE) and probably more.


PlatformIO Prerequisites
========================
PlatformIO/pioarduino Prerequisites
===================================

PlatformIO does need at least the following:
PIO does need at least the following:

* Python
* Git command line tools (`download <https://git-scm.com/downloads>`_)
Expand Down Expand Up @@ -58,17 +58,18 @@ install Pyton in Windows for PlatformIO.

These steps have been explained in this Youtube video: https://youtu.be/ArqwMcYSMsU though you might want to use the latest version of both the Git tools and Python.

PlatformIO with VSCode
======================
PlatformIO/pioarduino with VSCode
=================================

Install
-------

For development of ESPEasy, a number of extensions has to be installed in VS-Code:
For development of ESPEasy, a number of extensions have to be installed in VS-Code:

* PlatformIO IDE (by PlatformIO)
* C/C++ IntelliSense (by Microsoft)
* pioarduino IDE (by pioarduino)
* C/C++ (by Microsoft)
* C/C++ Extension Pack (by Microsoft)
* C/C++ Themes (by Microsoft)
* Uncrustify (by Zachary Flower, originally by Laurent Tréguier)

Optional, but highly recommended:
Expand All @@ -79,6 +80,7 @@ Optional, but highly recommended:
* All Autocomplete (by Atishay Jain)
* Excel Viewer (by GrapeCity)
* Esbonio - An extension for editing sphinx projects (by Swyddfa)
* reStructuredText (by LeXtudio)
* reStructuredText Syntax highlighting (by Trond Snekvik)
* Extension pack for reStructuredText (by LeXtudio Inc.)
* Markdown All in One (by Yu Zhang)
Expand Down Expand Up @@ -109,17 +111,19 @@ After setting it as the default formatter, the hotkey Alt-Shift-F (Cmd-Shift-F o

There used to be a reference to the Atom editor, but both Atom, and the PlatformIO plugin for Atom, are no longer maintained by their owners, so it was removed from this documentation.

Load a project using PlatformIO
-------------------------------
Load a project using PlatformIO/pioarduino
------------------------------------------

.. note:: PlatformIO has been superceded by the Community-supported **pioarduino** initiative. For simplicity, in most places the abbreviation PIO is throughout this section of the documentation.

If you have PIO installed and the source tree cloned to your hard drive, then you can open the main dir of the repository.
The main directory of the repository is the level with the file platformio.ini in it.

Then in a few moments after opening the directory, on the left there will appear an alien logo, the logo of PlatformIO.
Then in a few moments after opening the directory, on the left there will appear an chip-package logo, the logo of pioarduino.
If you click that one, you will get a tree with lots and lots of project tasks and environments.

It is important to note that PlatformIO does everything based on environments, which are defined in the platformio.ini file.
In the PlatformIO menu (on the left) everything is grouped per environment.
It is important to note that PIO does everything based on environments, which are defined in the platformio.ini file.
In the PIO menu (on the left) everything is grouped per environment.

An environment entry has several tasks, like:

Expand All @@ -130,8 +134,9 @@ An environment entry has several tasks, like:
* Clean
* ... many more.

Some of these options only are available when you have registered with PlatformIO and some are only for paid subscriptions.
At least the basic ones used for almost any user are available with the free account.
.. .. Some of these options only are available when you have registered with PlatformIO and some are only for paid subscriptions.

.. .. At least the basic ones used for almost any user are available with the free account.

The environment definitions all have at least the used micro controller in the name and the amount of flash memory used.

Expand All @@ -144,8 +149,8 @@ For example:
* ..._ESP32_16M8M_LittleFS -> ESP32 with 16 MB flash and a 4 MB partition for the sketch. (8MB LittleFS)
* ..._ESP32_16M1M_ETH -> ESP32 with 16 MB flash and a 4 MB partition for the sketch. (1MB SPIFFS, Wired ethernet support)

Make a custom build using PlatformIO
------------------------------------
Make a custom build using PIO
-----------------------------

The easiest is to go for the environment ``custom_ESP8266_4M1M`` and unfold that one.
Then select ``Build`` to see if it will start building.
Expand Down Expand Up @@ -213,7 +218,7 @@ Now that Linux is installed, it's strongly advised to get it up to date with the

NB: The ``sudo`` command will ask for your current account password once, (and maybe later again after some time has passed). When asked for confirmation, confirm the installation of any needed updates, or add the ``-y`` parameter to the ``upgrade`` command to continue without questions.

Additionally some tools need to be installed so PlatformIO can be properly installed later, and we can use the Uncrustify plugin in VS-Code to format the code nicely:
Additionally some tools need to be installed so PIO can be properly installed later, and we can use the Uncrustify plugin in VS-Code to format the code nicely:

.. highlight::sh

Expand Down Expand Up @@ -307,7 +312,7 @@ Upload to ESP
Linux
-----

For Linux, you may need to install 99-platformio-udev.rules to make PlatformIO upload tools work in vscode.
For Linux, you may need to install 99-platformio-udev.rules to make PIO upload tools work in vscode.


.. highlight::sh
Expand All @@ -317,12 +322,12 @@ Starter guide for (local) development on ESPEasy

For those with less development experience, or less experience in using Github, this chapter is intended as a **How To** guide to get started with development on ESPEasy.

It tries to help setting up Visual Studio Code (VSCode) with the PlatformIO development environment and additional VSCode plugins that aid in easier working on code and documentation.
It tries to help setting up Visual Studio Code (VSCode) with the PIO development environment and additional VSCode plugins that aid in easier working on code and documentation.

The global steps described here are:

- Creating a private copy on Github
- Getting VSCode and PlatformIO set up
- Getting VSCode and PIO set up
- Getting the source code from Github onto your system
- Compiling the source code
- Creating a branch to make your changes
Expand Down Expand Up @@ -366,12 +371,12 @@ After this completes, you can view the fork in your Github dashboard at https://

(You have to replace [your_github_handle] with the name you selected during the Github sign-up procedure)

Install VSCode and PlatformIO
Install VSCode and PIO
------------------------------

Earlier on this page, a complete description has been given on how to install **PlatformIO with VSCode** with the required and advised optional extensions and the git command-line tools.
Earlier on this page, a complete description has been given on how to install **PlatformIO/pioarduino with VSCode** with the required and advised optional extensions and the git command-line tools.

NB: PlatformIO is often shortened to PIO.
NB: PlatformIO/pioarduino is shortened to PIO.

Clone your forked repository to your computer
---------------------------------------------
Expand Down Expand Up @@ -422,7 +427,7 @@ Depending on your usual workflow, the current VSCode environment can be saved as
Compile an ESPEasy PIO environment
----------------------------------

ESPEasy supports several different configurations of ESP units, ESP8266, ESP8285 and ESP32, and also some predefined hardware configurations and sets of plugins & controllers. This has been turned into several different PlatformIO environments, to make managing the different builds as easy as possible.
ESPEasy supports several different configurations of ESP units, ESP8266, ESP8285 and ESP32, and also some predefined hardware configurations and sets of plugins & controllers. This has been turned into several different PIO environments, to make managing the different builds as easy as possible.

To compile such 'environment' (PIO terminology), select the PIO button (it looks like an alien) in VSCode:

Expand Down Expand Up @@ -492,10 +497,10 @@ Especially for new plugins, it is highly recommended to write documentation, as


Using external libraries
~~~~~~~~~~~~~~~~~~~~~~~~
^^^^^^^^^^^^^^^^^^^^^^^^

.. note::
Since November 2022, the PlatformIO configuration for ESPEasy was changed to *require* all libraries to be locally available, to a) prevent unexpected 'surprises' when an external library is updated, and b) greatly improve build output stability and quality.
Since November 2022, the PIO configuration for ESPEasy was changed to *require* all libraries to be locally available, to a) prevent unexpected 'surprises' when an external library is updated, and b) greatly improve build output stability and quality.

While developing a plugin or some other feature, often you use an existing library to re-use that (assumably) proven and tested functionality. To include such library, there is a prerequisite, and some generic steps to take:

Expand All @@ -516,7 +521,7 @@ Writing documentation

Updating, or adding if it does not yet exist, the documentation is a useful activity that should be part of changing or adding to the ESPEasy code. Some of the optional VSCode extensions are specifically aimed at that task.

The documentation is created in the reStructuredText format, using mostly a ``.rst`` extension, and can be built locally by installing the sphinx tool. This can be installed manually by opening a PlatformIO Terminal window in VSCode (an already open PIO Terminal can also be used, when using WSL2 a PlatformIO Terminal is *required* to execute in the correct Python Virtual Environment (venv)) and issuing these commands:
The documentation is created in the reStructuredText format, using mostly a ``.rst`` extension, and can be built locally by installing the sphinx tool. This can be installed manually by opening a PIO Terminal window in VSCode (an already open PIO Terminal can also be used, when using WSL2 a PIO Terminal is *required* to execute in the correct Python Virtual Environment (venv)) and issuing these commands:

.. code-block::

Expand Down
38 changes: 25 additions & 13 deletions docs/source/Plugin/P000_commands.repl
Original file line number Diff line number Diff line change
Expand Up @@ -549,37 +549,49 @@
:green:`Rules`","
Like ``PostToHTTP`` but using a TLS connection, by default on port 443

NB: No certificate validation is done!
NB: No certificate validation is done!"
"
ProvisionConfig","
Provision,Config","
:red:`Internal`","
Fetch ``config.dat`` as configured in the Provisioning configuration (see Settings Archive)

``ProvisionConfig``"
``Provision,Config``"
"
ProvisionSecurity","
Provision,Security","
:red:`Internal`","
Fetch ``security.dat`` as configured in the Provisioning configuration (see Settings Archive)

``ProvisionSecurity``"
``Provision,Security``"
"
ProvisionNotification","
Provision,DevSecurity","
:red:`Internal`","
Fetch ``devsecurity.dat`` as configured in the Provisioning configuration (see Settings Archive)

``Provision,DevSecurity``"
"
Provision,Notification","
:red:`Internal`","
Fetch ``notification.dat`` as configured in the Provisioning configuration (see Settings Archive)

``ProvisionNotification``"
``Provision,Notification``"
"
ProvisionProvision","
Provision,Provision","
:red:`Internal`","
Fetch ``provisioning.dat`` as configured in the Provisioning configuration (see Settings Archive)

``ProvisionProvision``"
``Provision,Provision``"
"
ProvisionRules","
Provision,Rules","
:red:`Internal`","
Fetch ``rulesN.txt`` as configured in the Provisioning configuration (see Settings Archive)

``ProvisionRules,1`` to fetch ``rules1.txt`` "
``Provision,Rules,1`` to fetch ``rules1.txt`` "
"
Provision,Firmware","
:red:`Internal`","
Fetch a new firmware binary, and flash it on the unit, as configured in the Provisioning configuration (see Settings Archive)

``Provision,Firmware,<url-to-firmware-file>`` to fetch and install the specified .bin file from the specified url."
"
Publish","
:green:`Rules`","
Expand Down Expand Up @@ -656,7 +668,7 @@
:green:`Rules`","
Like ``PutToHTTP`` but using a TLS connection, by default on port 443

NB: No certificate validation is done!
NB: No certificate validation is done!"
"
Reboot","
:red:`Internal`","
Expand Down Expand Up @@ -736,7 +748,7 @@
:green:`Rules`","
Like ``SendToHTTP`` but using a TLS connection, by default on port 443

NB: No certificate validation is done!
NB: No certificate validation is done!"
"
SendToUDP","
:green:`Rules`","
Expand Down
16 changes: 8 additions & 8 deletions docs/source/Plugin/P180.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ For each Value1 .. Value4 output, depending on the **Output Data Type** setting,

* **Value x type**: Here you can select a specific output type for each Value. This shows a selection of the **Output Data Type** selector, but only the single-value types. This will also be used for sending to Domoticz controllers and for MQTT Auto-Discovery.

* **Cache-Name x (optional)**: When set to a unique name (for this task), the parsed & pre-processed command sequence will be stored in a memory-cache, to *significantly* improve the speed of the plugin in runtime. When not set, the command sequence will be parsed every time the task is run (**Interval** setting or ``taskRun`` command). To be able to use event processing for 1ps, 10ps of 50ps, setting a Cache-Name is required!
* **Cache-Name x**: Should be set to a unique name (for this task), so the parsed & pre-processed command sequence will be stored in a memory-cache, to *significantly* improve the speed of the plugin in runtime. Initially the Cache-name is set to ``c1`` .. ``c4`` (depending on the number of values selected) and can be changed as desired. When empty it will be reset to ``cX`` again.

* **I2C Commands x**: The sequence of commands to execute for this value. Nothing will be done if this is empty. The corresponding Value output can be set from another I2C Commands sequence. The currently used vs. the available space is shown next to the field. I2C Commands are explained below.

Expand Down Expand Up @@ -373,7 +373,7 @@ The plugin should be configured with these settings:

* **Output Data Type**: ``Single``

* **Cache-Name 1 (optional)**: Fill with a useable name, f.e. ``qrsize``, so the I2C Command sequence is cached for much improved execution-performance. And the additional de-duplication uses the ``1ps`` event-interval, and the sequence must be cached for that event to work.
* **Cache-Name 1**: Fill with a useable name, f.e. ``qrsize``, so the I2C Command sequence is cached for much improved execution-performance. And the additional de-duplication uses the ``1ps`` event-interval, and the sequence must be cached for that event to work.

* **I2C Commands 1**:

Expand Down Expand Up @@ -455,7 +455,7 @@ The plugin should be configured with these settings:

``put.b.2.0x3f.0xf9``: Stop continuous measurement.

* **Cache-Name 1 (optional)**: Fill with a useable name, f.e. ``sdp``, so the I2C Command sequence is cached for much improved execution-performance.
* **Cache-Name 1**: Fill with a useable name, f.e. ``sdp``, so the I2C Command sequence is cached for much improved execution-performance.

* **I2C Commands 1**:

Expand Down Expand Up @@ -517,7 +517,7 @@ The plugin should be configured with these settings:

* **Values**: the name can be changed to Distance, and the number of decimals 0. Stats can be enabled, as desired. The Unit of Measure should he set to ``cm``, and the Value Type to ``Distance``

* **Cache-Name 1 (optional)**: Fill with a useable name, f.e. ``distance``, so the I2C Command sequence is cached for much improved execution-performance.
* **Cache-Name 1**: Fill with a useable name, f.e. ``distance``, so the I2C Command sequence is cached for much improved execution-performance.

* **I2C Commands 1**:

Expand All @@ -544,7 +544,7 @@ The plugin should be configured with these settings:

* **Values**: the first name can be changed to ``Distance``, and the number of decimals 0. Stats can be enabled, as desired. The Unit of Measure should he set to ``cm``, and the Value Type to ``Distance``, the second name can be changed to f.e. ``SignalStrength``, and number of decimals to 0. Stats can be enabled, as desired. No further settings for this value, as it has an undefined unit and value type.

* **Cache-Name 1 (optional)**: Fill with a useable name, f.e. ``distance``, so the I2C Command sequence is cached for much improved execution-performance.
* **Cache-Name 1**: Fill with a useable name, f.e. ``distance``, so the I2C Command sequence is cached for much improved execution-performance.

* **I2C Commands 1**:

Expand Down Expand Up @@ -590,15 +590,15 @@ The plugin should be configured with these settings:

``write.u8.0x0A.0x00``: Set sensor in Suspend mode.

* **Cache-Name 1 (optional)**: Fill with a useable name, f.e. ``x``, so the I2C Command sequence is cached for much improved execution-performance.
* **Cache-Name 1**: Fill with a useable name, f.e. ``x``, so the I2C Command sequence is cached for much improved execution-performance.

* **I2C Commands 1**: ``read.16le.0x01`` Read 2 bytes starting at register 1, the ``x`` value, and store in first Value field.

* **Cache-Name 2 (optional)**: Fill with a useable name, f.e. ``y``.
* **Cache-Name 2**: Fill with a useable name, f.e. ``y``.

* **I2C Commands 2**: ``read.16le.0x03`` Read 2 bytes starting at register 3, the ``y`` value, and store in second Value field.

* **Cache-Name 3 (optional)**: Fill with a useable name, f.e. ``z``.
* **Cache-Name 3**: Fill with a useable name, f.e. ``z``.

* **I2C Commands 3**: ``read.16le.0x05`` Read 2 bytes starting at register 5, the ``z`` value, and store in third Value field.

Expand Down
Binary file modified docs/source/Plugin/P180_DeviceConfiguration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/_P046_VentusW266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ boolean Plugin_046(uint8_t function, struct EventStruct *event, String& string)
FormSelectorOptions selector(NR_ELEMENTS(options), options);
selector.reloadonchange = true;
selector.addFormSelector(F("Plugin function"), F("p046"), choice);
addFormNote(F("Changing the function will reload this page."));
// addFormNote(F("Changing the function will reload this page."));
}

if (choice == 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/_P047_i2c-soil-moisture-sensor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ boolean Plugin_047(uint8_t function, struct EventStruct *event, String& string)
selector.default_index = static_cast<int>(P047_MODEL_CATNIP);
selector.reloadonchange = true;
selector.addFormSelector(F("Sensor model"), F("model"), P047_MODEL);
addFormNote(F("Changing the Sensor model will reload the page."));
// addFormNote(F("Changing the Sensor model will reload the page."));
}

if ((P047_MODEL_CATNIP == static_cast<P047_SensorModels>(P047_MODEL))
Expand Down
Loading