IO News – #AdafruitIO Python Client and Arduino Library Updates!

Hello Adafruit Community from the Adafruit IO Team!

In Adafruit IO News this week – we’ve been focusing development on our Arduino and Python Adafruit IO client libraries in the last couple of weeks and we’re ready to share information about them.

Adafruit IO Python Library

PythonIOLogo

We’ve officialy released version 2.0.0 of the Adafruit IO Python Client Library. This is a major update which not only adds a lot of under-the-hood enhancements, but also a bunch of new requested features. We’re going to support versions =>2.0.0 of this library going forwards. We’ve also switched this library over to Python 3, support for Python 2 has officially been dropped.

Notable Features

  • API-V2 Support: Adafruit IO Python now uses the Adafruit IO REST API v2
  • Location Support: Sending Adafruit IO Feeds locational values is now possible from this library (lat/lon/ele). Usage example for this feature, location.py, added in examples/basics. (#48)
  • MQTT Security: The MQTT Client now establishes a secure connection with Adafruit IO by default. (#45)
    • You can unset this by defining a secure=false boolean in the client initialization: client = MQTTClient(username, key, secure=False)
    • Time Topic Subscriptions:** Want to get the current time, date, or year? We added support for time/seconds, time/milliseconds and time/ISO-8601 topic subscriptions. Usage example for this feature, time_topics.pyadded in examples/basics. (#54)
  • MQTT Error Handling: We added a few verbose error checks for when the mqtt_client.py encounters an error. This means error messages will be easier to understand, and your programs will be easier to troubleshoot as a result. (#44)
  • New Documentation: We gave the documentation previously on the readme some t.l.c and a facelift. Documentation for this project is available on ReadTheDocs.
  • Examples: New examples have been added to /examples/basics, including some usage examples for Adafruit CircuitPython with the Raspberry Pi (more on this soon!)

Breaking Changes

  • Python 2 support has been discontinued. We are only supporting Python Version >=3.6.
  • Adafruit IO REST API v1 support has been discontinued. We are only supporting the API v2.
  • MQTT on_message method no longer requires the retain flag.

We actively maintain, develop and improve this library with the support of the community. If you’d like to see an ehancement or feature to this libary, let us know by filing an issue on the GitHub repository for the IO Python Client.

Adafruit IO Arduino Library

ArduinoIOLib

We’ve also been working on the Adafruit IO Arduino Library.

Features and Notes

  • ESP32 Compatability: We’ve added compatabilty for the Feather HUZZAH32 (and other ESP32-based-boards) to this library.
  • New Documentation: Just like the Python library, the Arduino Library now has a dedicated documentation page on ReadTheDocs
  • Time Topic Subscriptions: Don’t have any available pins to use a RTC? Just poll the Adafruit IO Server’s time feeds instead.
    • Adafruit_IO_Arduino client library updated to support three types of time helpers: time/secondstime/milliseconds, and time/ISO-8601.
    • Example for subscribing to all three of the feed subscriptions added to examples/adafruitio_17_time_subscribe/adafruitio_17_time_subscribe.ino

Get in touch with us on the Adafruit IO forums or ping @adam.io or @brentru on the Adafruit Discord, #adafruit-io channel if you have any questions.