Skip to content

Fix incorrect attribute name, rm certificates.py #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adafruit_aws_iot.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(self, mmqttclient, keep_alive=30):
# Shadow-interaction topic
self.shadow_topic = "$aws/things/{}/shadow".format(self.cid)
# Ensure set_certificate and set_private_key were run from ESP32SPI
assert self.client.wifi.esp.set_psk and self.client.wifi.esp.set_cert, "Certificate \
assert self.client.wifi.esp.set_psk and self.client.wifi.esp.set_crt, "Certificate \
and private key must be set to your AWS Device Cert and Private Key."
# keep_alive timer must be between 30 <= keep alive interval <= 1200 seconds
# https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html
Expand Down
47 changes: 0 additions & 47 deletions certificates.py

This file was deleted.

16 changes: 12 additions & 4 deletions examples/aws_iot_shadows.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@
print("WiFi secrets are kept in secrets.py, please add them there!")
raise

# Get device certificate and private key from a certificates.py file
# Get device certificate
try:
from certificates import DEVICE_CERT, DEVICE_KEY
with open("aws_cert.pem.crt", "rb") as f:
DEVICE_CERT = f.read()
except ImportError:
print("Certificate and private key data is kept in certificates.py, \
please add them there!")
print("Certificate (aws_cert.pem.crt) not found on CIRCUITPY filesystem.")
raise

# Get device private key
try:
with open("private.pem.key", "rb") as f:
DEVICE_KEY = f.read()
except ImportError:
print("Certificate (private.pem.key) not found on CIRCUITPY filesystem.")
raise

# If you are using a board with pre-defined ESP32 Pins:
Expand Down
16 changes: 12 additions & 4 deletions examples/aws_iot_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@
print("WiFi secrets are kept in secrets.py, please add them there!")
raise

# Get device certificate and private key from a certificates.py file
# Get device certificate
try:
from certificates import DEVICE_CERT, DEVICE_KEY
with open("aws_cert.pem.crt", "rb") as f:
DEVICE_CERT = f.read()
except ImportError:
print("Certificate and private key data is kept in certificates.py, \
please add them there!")
print("Certificate (aws_cert.pem.crt) not found on CIRCUITPY filesystem.")
raise

# Get device private key
try:
with open("private.pem.key", "rb") as f:
DEVICE_KEY = f.read()
except ImportError:
print("Certificate (private.pem.key) not found on CIRCUITPY filesystem.")
raise

# If you are using a board with pre-defined ESP32 Pins:
Expand Down