|
2 years ago | |
---|---|---|
.vscode | 2 years ago | |
doc | 2 years ago | |
fixtures | 2 years ago | |
src | 2 years ago | |
.gitignore | 2 years ago | |
Makefile | 2 years ago | |
README.md | 2 years ago |
Mqttmcp is a simulator to control MCP23017 output using mqtt through a word state.
Portage to arduino or such platform is easy, just copy paste.
I did portage to esp32 with extensa toolchain and it rocks without changing anything.
make
make clean
make doc
Doc in doc/html folder.
./mqttmcp
There is no C implementation of the mosquitto client in this source.
But there are some bash fixtures to pub sub in fixtures/bash folder.
Install the mosquitto client first :
sudo apt install mosquitto-clients
Edit and change config according to your broker settings.
I use to play with esp32 and esp-idf framework.
To init the mcp I used esp32-mcp23017.
To write the x2 8 bits registers simply use :
mcp23017_write_register (&mcp, MCP23017_GPIO, GPIOA, (uint8_t) value);
mcp23017_write_register (&mcp, MCP23017_GPIO, GPIOB, (uint8_t) value);
Do not forget to pull down reset pin to VCC with 10k resistor.
In some cases, pull up i2c bus is required on sda scl lines uses 4.7k resistors for each.