MQTT library for ESP8266
Eclipse Paho
for Espressif RTOS SDK v1.4.0 based onThis project aims to provide an independent MQTT library which can be seamlessly added to any existing ESP8266 project. It is inspired from
- esp_mqtt by tuanpmt
- ESP-RTOS-PAHO by baoshi
Despite being excellent projects, it requires some effort to include MQTT in your own project from these.
Prerequisites
- Xtensa lx106 architecture toolchain to build the library. If you are using Espressif lubuntu VM, this is already installed and added to your path. If you wish to set up your own, use esp-open-sdk.
- ESP8266_RTOS_SDK v1.4.0 Github
Build
- Make sure Xtensa toolchain is added to PATH
- Export SDK_PATH with path to Espressif SDK installation.
$ export SDK_PATH=/path/to/espressif_rtos_sdk_dir
- Build the library and install it in the SDK.
$ make && make install
Usage
- In your project Makefile add -lmqtt to LINKFLAGS_eagle.app.v6
LINKFLAGS_eagle.app.v6 = \
-L$(SDK_PATH)/lib \
...
-lmqtt \
-lcirom \
-lcrypto \
...
and include headers towards the end of Makefile
...
INCLUDES := $(INCLUDES) -I $(PDIR)include
INCLUDES += -I $(SDK_PATH)/include/mqtt
sinclude $(SDK_PATH)/Makefile
...
Todos
- SSL support
- esp-open-rtos supprt
- Add examples
MIT License