vaibhav93 / ESP-RTOS-MQTT

ESP8266 MQTT library for Espressif RTOS SDK 1.4 based on Eclipse Paho.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MQTT library for ESP8266

for Espressif RTOS SDK v1.4.0 based on Eclipse Paho

This project aims to provide an independent MQTT library which can be seamlessly added to any existing ESP8266 project. It is inspired from

Despite being excellent projects, it requires some effort to include MQTT in your own project from these.

Prerequisites

  1. 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.
  2. ESP8266_RTOS_SDK v1.4.0 Github

Build

  1. Make sure Xtensa toolchain is added to PATH
  2. Export SDK_PATH with path to Espressif SDK installation.
$ export SDK_PATH=/path/to/espressif_rtos_sdk_dir
  1. Build the library and install it in the SDK.
$ make && make install

Usage

  1. 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

About

ESP8266 MQTT library for Espressif RTOS SDK 1.4 based on Eclipse Paho.

License:MIT License


Languages

Language:C 98.7%Language:Makefile 1.3%