This is MQTT client library for ESP8266, using mqtt_msg package from MQTT client library for Contiki and use for ESP8266 NON-OS SDK esp_mqtt
Features:
- Support subscribing, publishing, authentication, will messages, keep alive pings and all 3 QoS levels (it should be a fully functional client).
- ESP8266WiFi
- WiFiClientSecure
- Support 3 type of qos (0, 1, 2) and outbox
- only mqtt over TCP
mqtt://[username][:password@]hostname[:port][#clientId]
mqtt
for MQTT over TCPws
for MQTT over Websocket
- Example:
- Full
mqtt://username:[email protected]:1883#my_client_id
- Websocket
ws://username:[email protected]:1883/mqtt#my_client_id
- Minimal
mqtt://test.mosquitto.org
, withuser
,pass
= NULL, port = 1883, client id = "ESP_" + ESP.getChipId()
- Full
- bool begin(String uri);
- bool begin(String uri, int keepalive, bool clean_session);
- bool begin(String uri, LwtOptions lwt);
- bool begin(String uri, LwtOptions lwt, int keepalive, bool clean_session)
- void onConnect(THandlerFunction fn);
- void onDisconnect(THandlerFunction fn);
- void onSubscribe(THandlerFunction_PubSub fn);
- void onPublish(THandlerFunction_PubSub fn);
- void onData(THandlerFunction_Data fn);
- int subscribe(String topic);
- int subscribe(String topic, uint8_t qos);
- int publish(String topic, String data);
- int publish(String topic, String data, int qos, int retain);
Copyright (c) 2016 Tuan PM (https://twitter.com/tuanpmt) ESP8266 port (c) 2016 Ivan Grokhotkov ([email protected])
License Apache License