Tags: pubnub/arduino
Tags
Auto detect Client interface to use on some boards Only boards that have a default, intrinsic way of handling networking (like WiFi boards, such as MKR1000) are recognized. Also, only boards we could test or that have well-known implementation and good documentation are recognized.
Auto detect Client interface to use on some boards Only boards that have a default, intrinsic way of handling networking (like WiFi boards, such as MKR1000) are recognized. Also, only boards we could test or that have well-known implementation and good documentation are recognized.
Do not await disconnect forever (#29) There was a bug in PubSubClient::stop() - a surplus call to `input_state()`. Also, it now waits for data shorter, not the usual "full (default) time" . This time is not yet user settable. Since ESP8266 can, in some weird and as-of-yet-unexplained situations, take a _long_ time (hours, even) to change the state of the `WiFiClient` to "not connected" after a `stop()`, we no longer await this disconnection "forever". There is now a timeout (for now, not user-settable) and we give up after a short while. This might lead to some (probably temporary) leaks, but, we haven't run into problems in our testing.
Remove retries and enable setting TCP/IP port (#26) Retries were not limited, making it possible to have a _long_ blocking call, which is not a nice thing in Arduino `loop()`. Limitting would only partially fix the problem. Removing them altogether works much better and user can retry at her own convenience. Support for setting the TCP/IP port was added, which is needed when using a TLS/SSL (network) client class. Before, we always used HTTP port, which would not work.
Support for ESP32 and 'message crackers' The `WiFiClient` of ESP32 has non-standard behavior. When the (TCP/IP) connection is closed, it will start returning 0 as the result of `available()`, even though not all octets were read, and one can actually still `read()` them. So, we need "a middle-man" to keep track of how many octets are actually available for reading. This is, unfortunately, a slightly incompatible change. You need to use the new class `PubNonSubClient` for this to work. So, even though you don't _have_ to (and then ESP32 will not work, but it didn't work either in v2), it is different and warrants a major version bump. Also, for ease of use, we introduced "message crackers", which should inspire users to avoid the old `Client` based interface, making it easier to do similar upgrades/changes in the future. Examples were also cleaned-up: * Use new high-level API (message crackers) * Use ArduinoJson library in the Josn example * Update comments * Remove not-very-useful examples * Reformat with Clang format
PreviousNext