Skip to content

Check nina-fw version in code #4

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 2 commits into from
Oct 21, 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
6 changes: 0 additions & 6 deletions adafruit_aws_iot.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ def __init__(self, mmqttclient, keep_alive=30):
else:
raise TypeError("This class requires a preconfigured MiniMQTT object, \
please create one.")
# Verify nina-fw => 1.4.0
fw_semver_maj = bytes(self.client.wifi.esp.firmware_version).decode("utf-8")[2]
assert int(fw_semver_maj) >= 4, "Please update nina-fw to 1.4.0 or above."
# Verify MiniMQTT client object configuration
try:
self.cid = self.client.client_id
Expand All @@ -78,9 +75,6 @@ def __init__(self, mmqttclient, keep_alive=30):
as the Client ID.")
# 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_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
assert 30 <= keep_alive <= 1200, "Keep_Alive timer \
Expand Down
8 changes: 6 additions & 2 deletions examples/aws_iot_shadows.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@

spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
"""Use below for Most Boards"""

# Verify nina-fw version >= 1.4.0
assert int(bytes(esp.firmware_version).decode("utf-8")[2]) >= 4, "Please update nina-fw to >=1.4.0."

# Use below for Most Boards
status_light = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2) # Uncomment for Most Boards
"""Uncomment below for ItsyBitsy M4"""
# Uncomment below for ItsyBitsy M4
# status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
# Uncomment below for an externally defined RGB LED
# import adafruit_rgbled
Expand Down
8 changes: 6 additions & 2 deletions examples/aws_iot_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@

spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
"""Use below for Most Boards"""

# Verify nina-fw version >= 1.4.0
assert int(bytes(esp.firmware_version).decode("utf-8")[2]) >= 4, "Please update nina-fw to >=1.4.0."

# Use below for Most Boards
status_light = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2) # Uncomment for Most Boards
"""Uncomment below for ItsyBitsy M4"""
# Uncomment below for ItsyBitsy M4
# status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
# Uncomment below for an externally defined RGB LED
# import adafruit_rgbled
Expand Down