A brief introduction to the range of functions available. Each Plugin has its own formal API document and is usually introduced and desctribed as part of more general discussion document, which should of course be read before the API document
The Plugins are described in broadly functional areas:
- Basics & GPIO
- Switches and "Things"
- WiFi and networking
- Diagnostics, Logging and development
- Documentation Master Index
-
H4P_SerialCmd: Send commands to control and/or diagnose all other plugins. This is so important, it is automatically included for you and its the first plugin you should get to know.
-
H4P_Signaller: One-line coding of multiple simultaneous LED flashing by Square Wave, PWM, abitrary pattern and Morse code
-
H4P_PinMachine: One-line coding / mangement of a variety of different GPIO strategies, e.g. debouncing, decoding of rotary encoders, etc - there are over 20 covering pretty much any kind of hardware you might want attach to the GPIO pins.
-
H4P_ToneController Buzzer, tones, sirens and...yes, actual music! Can play simultaneous different "voices" (musical parts) and/or chords on multiple buzzers.
-
H4P_Voice Single musical part or "stave" - sends a stream of tones to one single buzzer. Used by H4P_ToneController to play chords, multi-part tunes
Many iot devices have one simple thing to do: switch something on/off on a single GPIO - like a relay for example. If that's all you need, use a plugin with "...Switch" on the end of its name. If you need something a little more fancy, for example to do some other "work" then choose a plugin with "...Thing" on the end of its name. The actual "thing" is a function you write so it can be anything, but whatever it is, sending h4/on
or saying "Alexa...switch on 'thing'" will make it "do its thing" and h4/off
will stop it.
Networking is not required but if you are connected, the webserver will automatically add the "big red switch" and various other options to control the plugin.
-
H4P_BinarySwitch: Allows control by commands from multiple sources to on/off a single GPIO.
-
H4P_BinaryThing: user-defined function that can be controlled by commands from multiple sources
-
H4P_ConditionalSwitch: H4P_BinarySwitch that only operates when user-define function returns true
-
H4P_ConditionalThing: H4P_BinaryThing that only operates when user-define function returns true
-
H4P_WiFi: Automatic Connection / reconnection manager, builtin webserver, AP configuration*, OTA programming. Also uses LED_BUILTIN to signal network state via various flashing patterns.
-
H4P_AsyncMQTT: Automatic Connection to MQTT server, with reconnection on failure (without reboot!) allows remote control of H4 as well as the more usual sensing og e.g. sensor data to "the cloud"
-
H4P_AsyncHTTP Asynchronous remite acces of any http resource e.g. REST API to return any data of users' choice
-
H4P_UPNPServer: provides full UPNP/SSDP device with Alexa voice control, PC Desktop OS integration
-
H4P_RemoteUpdate: OTA update from remote server
-
H4P_Heartbeat: Adds an "Up Time" to the web UI*
-
H4P_LinkMaster: Adds "slaving" of other H4 devices to create simple groups / scenarios. Swicth on/off the master and all slaves also switch on/off.
(* see 🏗️ WiFi AP mode re configuration in AP mode )
-
H4P_Timekeeper: NTP server sync for "clock time" alarms and scheduling
-
H4P_Sunrise EXPERIMENTAL : Gets sunrise / sunset times from public API given Lat/Long
- 🏗️ H4P_GateKeeper Manages creation of "enter" and "leave" events whern specifc roaming devices move in and out of netwrork range. Currently detectable device types are:
Roeaming Device Class | Identified by | Example |
---|---|---|
h4pRoamingDotLocal | MDNS protocol / service attributes | tcp,http |
h4pRoamingH4 | H4 device name | salon |
h4pRoamingIP | IP Address | 192.168.1.31 |
h4pRoamingUPNP | UPNP/SSDP property/value | USN,asds |
-
H4P_HeapWarn: Call user function on low Heap
-
H4P_QueueWarn: Call user function on low Queue
-
H4P_TaskSniffer: Low-level task / queue dumper for H4 + Plugins
-
H4P_EventListener: General-purpose listener calls user-defined function on any selection of events
-
H4P_SerialLogger: Event logging to serial monitor
-
H4P_LocalLogger: Event logging to LittleFS file
-
H4P_MQTTLogger: Event logging to MQTT Server
-
H4P_RemoteLogger: log to remote webserver
-
H4P_EmitHeap: Periodically Send
getFreeHeap()
value to event queue to help hunt memory leaks -
H4P_EmitLoopCount: Send loops/sec to the event queue for diagnosing bottlencks (requires changes to H4 config_plugins.h / compile options)
-
H4P_EmitQ: Periodically Send H4 Q size to event queue to help profling / performance tuning
-
H4P_EmitTick: Send synchronous 1x per second on-the-second heartbeat event.
(c) 2021 Phil Bowles [email protected]