Skip to content

Native Networking Examples missing ssl and adafruit_requests in code from README. #49

Closed
@bgilreath

Description

@bgilreath

https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/blob/main/examples/azureiot_native_networking/azureiot_hub_simpletest.py
Replaced line #66 with this:

pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, ssl.create_default_context())
response = requests.get("https://io.adafruit.com/api/v2/time/seconds")
if response:
if response.status_code == 200:
r = rtc.RTC()
r.datetime = time.localtime(int(response.text))
print(f"System Time: {r.datetime}")
else:
print("Setting time failed")

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions