项目作者: Enrico204

项目描述 :
An MQTT client with TLS and certificate chain verification for NodeMCU, based on knolleary/PubSubClient
高级语言: C++
项目地址: git://github.com/Enrico204/TLSPubSubClient.git
创建时间: 2018-02-26T22:27:59Z
项目社区:https://github.com/Enrico204/TLSPubSubClient

开源协议:MIT License

下载


TLSPubSubClient

This is a library based on PubSubClient (knolleary) and some modifications made by @diegopx and me.

This library provides an MQTT client that is capable of TLS connection with certificate chain verification (and SNI).

In addition, by using setCertHostName method, the hostname in the certificate can be overridden. This is useful when you need to provide a different SNI other than the hostname written into the server certificate.

Below you can find the original manual. Note: modifications above works only on ESP8266/NodeMCU.

This library is a fork intended for drop-in replacement, so it cannot be used with the official PubSubClient at the same time

Arduino Client for MQTT

This library provides a client for doing simple publish/subscribe messaging with
a server that supports MQTT.

Examples

The library comes with a number of example sketches. See File > Examples > PubSubClient
within the Arduino application.

Full API documentation is available here: http://pubsubclient.knolleary.net

Limitations

  • It can only publish QoS 0 messages. It can subscribe at QoS 0 or QoS 1.
  • The maximum message size, including header, is 128 bytes by default. This
    is configurable via MQTT_MAX_PACKET_SIZE in PubSubClient.h.
  • The keepalive interval is set to 15 seconds by default. This is configurable
    via MQTT_KEEPALIVE in PubSubClient.h.
  • The client uses MQTT 3.1.1 by default. It can be changed to use MQTT 3.1 by
    changing value of MQTT_VERSION in PubSubClient.h.

Compatible Hardware

The library uses the Arduino Ethernet Client api for interacting with the
underlying network hardware. This means it Just Works with a growing number of
boards and shields, including:

  • Arduino Ethernet
  • Arduino Ethernet Shield
  • Arduino YUN – use the included YunClient in place of EthernetClient, and
    be sure to do a Bridge.begin() first
  • Arduino WiFi Shield - if you want to send packets > 90 bytes with this shield,
    enable the MQTT_MAX_TRANSFER_SIZE define in PubSubClient.h.
  • Sparkfun WiFly Shield – library
  • TI CC3000 WiFi - library
  • Intel Galileo/Edison
  • ESP8266

The library cannot currently be used with hardware based on the ENC28J60 chip –
such as the Nanode or the Nuelectronics Ethernet Shield. For those, there is an
alternative library available.

License

This code is released under the MIT License.