Changelog:
- Improved Wifi stability on saturated and low performance networks.
- Improved status LED management.
- Some RAM memory improvements.
- Added I2C bus support:
You can declare up to 2 different I2C buses. To declare them, you must use"ic"
key in configuration section. It contains an array of I2C buses.
Each bus must have these settings:"c":
SCL GPIO."d":
SDA GPIO."q":
Bus frequency in KiloHertz.
First declared bus will be bus 0, and second will be bus 1.
- Added MCP23017 support using I2C bus. Only output mode is supported. MCP23017 GPIOs can be used with digital output actions and status LED.
MCP23017 interfaces must declare in configuration section using"mc"
key. It is an array that contains all connected MCP23017 interfaces. You can connect up to 16 MCP interfaces (8 per I2C bus), having up to 256 extra GPIOs for outputs.
Keys to declare a MCP23017 interface:"b":
I2C Bus."a":
Address. First MCP23017 begins at 32."ca":
from 0 to 255. Initial state of all channel A GPIOs."cb":
from 0 to 255. Initial state of all channel B GPIOs.
"ca"
and"cb"
values are the result of convert 8 bits binary string to decimal. For example, to set all channel A GPIOs to LOW, but second GPIO to HIGH, you must use00000010
in decimal:"ca":2
.
Use of MCP23017 with actions:
To call a GPIO from a MCP23017 interface, you must use normal "g":
key of "r":
array. ESP8266 GPIOs are from 0 to 16, but MCP23017 GPIOs are used in this format: "g":XYY
- X: is the index of MCP interface in JSON declaration.
- YY: is the number of GPIO, from 00 to 15. Channel A GPIOs are from 00 to 07; and channel B, from 08 to 15.
For example, to set to HIGH GPIO 4 of third declared MCP interface:
"r":[{"g":304,"v":1}]
Read Wiki for more info.