Skip to content
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

Tracking dependency changes for ESP32-S2 and CP7 #21

Closed
5 of 7 tasks
askpatrickw opened this issue Aug 25, 2020 · 9 comments · Fixed by #37
Closed
5 of 7 tasks

Tracking dependency changes for ESP32-S2 and CP7 #21

askpatrickw opened this issue Aug 25, 2020 · 9 comments · Fixed by #37
Assignees
Labels
enhancement New feature or request

Comments

@askpatrickw
Copy link
Contributor

askpatrickw commented Aug 25, 2020

I've been trying out each of the underling dependencies for Adafruit_CircuitPython_AzureIoT on ESP32-S2 builds on a FeatherS2 and here are the known issues so far in dependencies.

This isn't a complete list but once these are closed or have workarounds or code in branches I'll keep trying.

I'm no longer sure this is needed

I see NTP in the samples, but not where any time or rtc is being used in the library so maybe it is not needed.

@brentru
Copy link
Member

brentru commented Dec 21, 2020

@askpatrickw Since UDP support has been merged in, are we waiting for the CircuitPython_NTP library to be updated?

Possibly @jimbobbennett could shine some light on the requirement for NTP in Azure IOT.

@askpatrickw
Copy link
Contributor Author

Actually, now I can see where the current time is being used. @jimbobbennett please correct if I'm wrong.

To use this library, you will need to create an ESP32_SPI WifiManager, connected to WiFi. You will also need to set the current time, as this is used to generate time-based authentication keys. One way to do this is via the Adafruit CircuitPython NTP library ..

https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/blob/master/adafruit_azureiot/iotcentral_device.py#L130
uses is to set the token_expiry token_expiry = int(time.time() + self._token_expires)

So the library doesn't need NTP but all the examples use it.

@askpatrickw
Copy link
Contributor Author

I pushed a PR to Tannewt to complete the NTP work he started. not 100% necessary for azure iot library, but the examples will work with it. tannewt/Adafruit_CircuitPython_NTP#1

@jimbobbennett
Copy link
Collaborator

The NTP library is only used in the examples to set the time as that is needed when generating the keys to authenticate with IoT Hub.

@bluejazzCHN
Copy link

Actually, now I can see where the current time is being used. @jimbobbennett please correct if I'm wrong.

To use this library, you will need to create an ESP32_SPI WifiManager, connected to WiFi. You will also need to set the current time, as this is used to generate time-based authentication keys. One way to do this is via the Adafruit CircuitPython NTP library ..

https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/blob/master/adafruit_azureiot/iotcentral_device.py#L130
uses is to set the token_expiry token_expiry = int(time.time() + self._token_expires)

So the library doesn't need NTP but all the examples use it.

yes the library doesn't need NTP directly, just require time to get current time. but in order to keep current time accurately so
call ntp.set_time().

@brentru
Copy link
Member

brentru commented Feb 3, 2021

@askpatrickw MiniMQTT is now compatible with CP6 and ESP32-S2 sockets. Are you going to create a PR to update this library to reflect the new API?

@askpatrickw
Copy link
Contributor Author

@brentru woot!!

I may not get to it this week, but 100% Yes I will give it a go!

@slyons
Copy link

slyons commented Sep 2, 2021

This seems to be an issue still. Any chance someone could take a peek at this again?

@askpatrickw askpatrickw linked a pull request Jan 22, 2022 that will close this issue
1 task
@askpatrickw
Copy link
Contributor Author

@slyons, @jimbobbennett I have a PR in progress on this.
#37

Lots of samples to test, but for ESP32S2 boards (native_networking) IoT Hub and IoT Central simple samples worked.

@askpatrickw askpatrickw self-assigned this Jan 22, 2022
@askpatrickw askpatrickw added the enhancement New feature or request label Jan 22, 2022
@askpatrickw askpatrickw changed the title Tracking dependency changes for ESP32-S2 and CP6 Tracking dependency changes for ESP32-S2 and ~~CP6~~ CP7 Jan 22, 2022
@askpatrickw askpatrickw changed the title Tracking dependency changes for ESP32-S2 and ~~CP6~~ CP7 Tracking dependency changes for ESP32-S2 and ~CP6~ CP7 Jan 22, 2022
@askpatrickw askpatrickw changed the title Tracking dependency changes for ESP32-S2 and ~CP6~ CP7 Tracking dependency changes for ESP32-S2 and CP7 Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants