GithubHelp home page GithubHelp logo

adafruit / adafruit_circuitpython_aws_iot Goto Github PK

View Code? Open in Web Editor NEW
12.0 22.0 11.0 119 KB

Amazon AWS IoT MQTT Client for CircuitPython

License: MIT License

Python 100.00%
mqtt aws-iot hacktoberfest

adafruit_circuitpython_aws_iot's Introduction

Introduction

Documentation Status

Discord

Build Status

Code Style: Black

Amazon AWS IoT MQTT Client for CircuitPython.

Note: This library requires version >=1.4.0 of the Adafruit fork of the Arduino NINA-W102 firmware

installed on your ESP32 Airlift/WiFi Co-Processor.

If you do not know how to do this, visit the Adafruit Learning System guide for this topic...

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-aws-iot

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-aws-iot

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-aws-iot

Usage Example

Library examples within examples/ folder.

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

adafruit_circuitpython_aws_iot's People

Contributors

bettse avatar brentru avatar dhalbert avatar evaherrada avatar foamyguy avatar justmobilize avatar kattni avatar ladyada avatar mpechner avatar siddacious avatar sommersoft avatar tekktrik avatar zbauman3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_circuitpython_aws_iot's Issues

Missing Type Annotations

There are missing type annotations for some functions in this library.

The typing module does not exist on CircuitPython devices so the import needs to be wrapped in try/except to catch the error for missing import. There is an example of how that is done here:

try:
    from typing import List, Tuple
except ImportError:
    pass

Once imported the typing annotations for the argument type(s), and return type(s) can be added to the function signature. Here is an example of a function that has had this done already:

def wrap_text_to_pixels(
    string: str, max_width: int, font=None, indent0: str = "", indent1: str = ""
) -> List[str]:

If you are new to Git or Github we have a guide about contributing to our projects here: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github

There is also a guide that covers our CI utilities and how to run them locally to ensure they will pass in Github Actions here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code In particular the pages: Sharing docs on ReadTheDocs and Check your code with pre-commit contain the tools to install and commands to run locally to run the checks.

If you are attempting to resolve this issue and need help, you can post a comment on this issue and tag both @FoamyGuy and @kattni or reach out to us on Discord: https://adafru.it/discord in the #circuitpython-dev channel.

The following locations are reported by mypy to be missing type annotations:

  • adafruit_aws_iot.py:49
  • adafruit_aws_iot.py:94
  • adafruit_aws_iot.py:124
  • adafruit_aws_iot.py:137
  • adafruit_aws_iot.py:151
  • adafruit_aws_iot.py:165
  • adafruit_aws_iot.py:176
  • adafruit_aws_iot.py:189
  • adafruit_aws_iot.py:219
  • adafruit_aws_iot.py:230
  • adafruit_aws_iot.py:240
  • adafruit_aws_iot.py:258
  • adafruit_aws_iot.py:265
  • adafruit_aws_iot.py:272

"Invalid broker address defined" error

I'm getting this error. I have log set to true, all credentials and secrets parameters are correct, Adafruit PyPortal on version 5 firmware with the latest bundle, esp firmware version 1.6.0.

I also confirmed the minimqtt and AWS IoT libraries are both at the latest version. I'm using the simpletest example. I tried setting ssl to false as suggested by brentru and that didn't work either.

Traceback (most recent call last):
File "code.py", line 148, in
File "adafruit_aws_iot.py", line 155, in connect
File "adafruit_aws_iot.py", line 155, in connect
AWS_IOT_ERROR: ('Error connecting to AWS IoT: ', MMQTTException('Invalid broker address defined.', RuntimeError('ESP32 not responding',)))

RootCA missing?

Looked through the code, couldnt find where the Root Certificate Authority is being set.

I have intermittent connection issues. Sometimes I have to reload the code several times to get it to connect. Wondering if its related..

RTD Documentation: Build status not successful

The RTD documentation was determined not to have built successfully. This could be the result of one of two reasons:

  1. The documentation truly had an error occur and failed to build
  2. The badge icon and/or link is not correctly formatted or pointing to the correct RTD link

AWS_IOT_ERROR ('Error Connection to AWS IoT: ', MQTTException('Repeated connect failures',))

Hello,
5 months ago, I had build a demo reusing the code in the PyPortal IoT Plant Monitor with AWS IoT and CircuitPython which I had modified.
Everything was working fine.
I was trying to recreate this demo and now the Adafruit Pyportal is not able to connect to AWS IoT. Even when trying to recreate the PyPortal IoT Plant Monitor with AWS IoT and CircuitPython demo instead of my modified demo it fails with the same error:

File "adafruit_aws_iot.py", line 145, in connect
AWS_IOT_ERROR: ('Error connecting to AWS IoT: ', MMQTTException('Repeated connect failures',))

Could it be because of this issue AWS IoT SDK Python V2 Support

Thank you in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.