Examples for the HomeDing library
There are some example projects coming with the Homeding library that can be loaded into the IDE by using the Arduino examples menu.
Because the functionality of the target device is mostly defined by the configuration and not by the sketch itself you can find a lot of examples for configuration and recipes combining multiple elements to fulfill a specific need.
The standard example can be used as a good starting point.
Important Notice: Examples will not only require to upload the sketch. It is as also required to upload the files from the data
folder to the filesystem. If you like to see a full start-to-end building a device look into one of the stories.
Examples
These examples that come with the library need the nodeMCU board and no specific external hardware:
-
Standard This example has a sketch and the web site for a NodeMCU or similar board. Most of the recipes work with this sketch.
-
Minimal This example shows how to reduce the number of available elements and use only a bare minimum part of the embedded web site so the whole solution fits into a ESP8266 board with only 1 MByte Flash memory like the ESP-01.
-
Develop This example is very like the standard example but has some add-ons that help during development. It can be used with any board that has a 4MByte Flash memory like the NodeMCU boards.
-
Probe – This example shows how to implement special, local elements that can retrieve sensor data from INA219 and INA266 current and voltage sensors to build a low-voltage power consumption logging device. It can be used with any board that has a 4MByte Flash memory like the NodeMCU boards.
-
RFBridge – This example has a local RFCodes Element to send and receive RF Signals using 433 MHz transmitters and receivers with the RFCodes library. Some more Elements help to automate light and switch processes.
-
Micro The micro firmware for HomeDing enabled devices is not a real example but is used to flash small devices with firmware for specific conditions.
Customizing the Standard Example
Under normal conditions the Standard Example offers a solution where all required elements are compiled and ready to be configured.
In some cases there will not be enough memory to upload or there is the need to add some specific elements for a specific solution. This can be done using the following mechanisms.
Include Elements to a firmware
When a sketch is compiled to a firmware a small, large or a special set of elements can be added. These are then available to be configured.
The HOMEDING_INCLUDE_xxx
definitions control what elements will be registered in the Element Registry.
In the *.ino file of every example you can find a list of HOMEDING_INCLUDE_xxx definitions that can be commented out or activated to specify what elements are later available for configuration. By disabling the definitions you can remove individual elements when they are not required to save program space.
The Minimal Examples is derived from the standard example by just disabling elements this way.
Some elements that require a specific external library that are disables in the Standard Example can be included this way.
Implement local elements.
In the folder of the script you can add some elements that are not part of the library but will also be compiled together with the sketch and therefore are also available for configuration.
The Probe Example and the Radio Example show how to include a very specific elements into the sketch folder.
The DevDing Example is used to implement some additional elements for problem analysis. It is instrumented for using the (limited, software based) remote debugger. New elements can be implemented by using the provided empty MyElement implementation as a boilerplate.