能源管控程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.0 KiB

2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Arduino Client for MQTT
  2. This library provides a client for doing simple publish/subscribe messaging with
  3. a server that supports MQTT.
  4. ## Examples
  5. The library comes with a number of example sketches. See File > Examples > PubSubClient
  6. within the Arduino application.
  7. Full API documentation is available here: https://pubsubclient.knolleary.net
  8. ## Limitations
  9. - It can only publish QoS 0 messages. It can subscribe at QoS 0 or QoS 1.
  10. - The maximum message size, including header, is **256 bytes** by default. This
  11. is configurable via `MQTT_MAX_PACKET_SIZE` in `PubSubClient.h` or can be changed
  12. by calling `PubSubClient::setBufferSize(size)`.
  13. - The keepalive interval is set to 15 seconds by default. This is configurable
  14. via `MQTT_KEEPALIVE` in `PubSubClient.h` or can be changed by calling
  15. `PubSubClient::setKeepAlive(keepAlive)`.
  16. - The client uses MQTT 3.1.1 by default. It can be changed to use MQTT 3.1 by
  17. changing value of `MQTT_VERSION` in `PubSubClient.h`.
  18. ## Compatible Hardware
  19. The library uses the Arduino Ethernet Client api for interacting with the
  20. underlying network hardware. This means it Just Works with a growing number of
  21. boards and shields, including:
  22. - Arduino Ethernet
  23. - Arduino Ethernet Shield
  24. - Arduino YUN – use the included `YunClient` in place of `EthernetClient`, and
  25. be sure to do a `Bridge.begin()` first
  26. - Arduino WiFi Shield - if you want to send packets > 90 bytes with this shield,
  27. enable the `MQTT_MAX_TRANSFER_SIZE` define in `PubSubClient.h`.
  28. - Sparkfun WiFly Shield – [library](https://github.com/dpslwk/WiFly)
  29. - TI CC3000 WiFi - [library](https://github.com/sparkfun/SFE_CC3000_Library)
  30. - Intel Galileo/Edison
  31. - ESP8266
  32. - ESP32
  33. The library cannot currently be used with hardware based on the ENC28J60 chip –
  34. such as the Nanode or the Nuelectronics Ethernet Shield. For those, there is an
  35. [alternative library](https://github.com/njh/NanodeMQTT) available.
  36. ## License
  37. This code is released under the MIT License.