-
Notifications
You must be signed in to change notification settings - Fork 64
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
Initial commit with azure-sdk-for-c Arduino library #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments. The one thing I care strongly about is moving az_cert.h to each sample instead of the main lib.
library.properties
Outdated
@@ -0,0 +1,10 @@ | |||
name=azure-sdk-for-c | |||
version=1.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To simplify things, can we keep this version in-sync with the SDK version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we talked about this in the meetings we had with Azure SDK team, but I do not find notes about it. Since the versions will be sequential anyway, I don't see why not. I updated the Update-library.ps1 to implement that as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posting conversation we had offline, for reference:
Cris, little problem with the version suggestion you made....
Linking the version of the SDK to the version of the Arduino library makes it impractical for us to make changes to the samples in the Arduino repo itself and update the version. In spite of that, what do you think about doing this:
name=Azure SDK for C
version=1.0.0
author=Microsoft Corporation
maintainer=Microsoft iotcert@microsoft.com
sentence=Azure SDK for C library (1.3.0-beta.2) for Arduino.
instead of
name=Azure SDK for C
version=1.3.0-beta.2
author=Microsoft Corporation
maintainer=Microsoft iotcert@microsoft.com
sentence=Azure SDK for C library for Arduino.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done as suggested above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are your thoughts on trying to keep the major version aligned, even as changes are made to samples/etc. independently of the SDK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I myself think that it makes more sense to keep the versions independent, but I would not oppose keeping the major versions in sync.
category=Communication | ||
url=https://github.com/Azure/azure-sdk-for-c | ||
architectures=* | ||
includes=az_core.h,az_iot.h,azure_ca.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove azure_ca.h from here and, instead, instruct devs to update their devices/modems with the latest CA certificates. For official Arduino boards, the IDE has tools that support the update.
The include can be made by samples for a quick OOB experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cris, that has been discussed before. There is a reason not to do that way.
If someone add the azure-sdk-for-c Arduino library (not using one of the built-in samples, the Root CA cert will be missing. To make the experience easy and match the standard out-of-the-box-smooth way expected from Arduino libraries, the ca cert header must be in the library.
If you are still in favor of doing differently, let's talk offline so we can find the best solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about my proposal to move the include in the samples? Instead of adding the include in the library, you can add it in each of the samples folders. This will automatically bring it in for samples but not for new projects. It will also make it clear that the file is part of the sample, not our SDK.
The include can be made by samples for a quick OOB experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that is exactly the situation the previous comment is addressing.
If you do that, people that include the library on their own projects won't have all the components for an out-of-the-box experience like what's expected when using Arduino.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that is a nice tool they have for the Wifi101 module.
Unfortunately Espressif does not have something similar in Arduino for their boards (nor has Realtek).
With those limitations, we don't have an alternative to work with as of now. I agree with you they should and it would be better, but that's what we have to work with as of now.
I will keep this comment unresolved for tracking purposes.
One aspect to address in a next release of this Arduino library will be to add the other root cas for other regions as well (!).
examples/AzureIoTHub_RealtekAmebaD/AzureIoTHub_RealtekAmebaD.ino
Outdated
Show resolved
Hide resolved
examples/AzureIoTHub_RealtekAmebaD/AzureIoTHub_RealtekAmebaD.ino
Outdated
Show resolved
Hide resolved
examples/AzureIoTHub_RealtekAmebaD/AzureIoTHub_RealtekAmebaD.ino
Outdated
Show resolved
Hide resolved
3565a5f
to
9f3a583
Compare
@ewertons What files and changes within this PR should we explicitly review vs what can we assume are coming verbatim from latest released tag of the Azure SDK for C repo? Can we assume everything under src/ is the same as the main repo (other than header fix-ups)? |
And do we have any plans to do any build verification or basic sanity testing in the CI for this repo? What steps do you currently take to manually test things? It might be a good idea to at least have a step that verifies the repo builds in the CI to catch any typos or accidental changes that might cause it to break. |
The tests I have done are manually using the latest version of Arduino IDE. |
Yes, that's correct. Everything under src/ is coming straight from azure/azure-sdk-for-c, with the files processed to be in a flat structure required for Arduino libraries. All of the files here come almost as-is from the initial repo I created, which had been previously used in our discussions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great, but did some have comments and questions that I was hoping to understand our thinking on, before approving. That said, once addressed, no need to block on my approval :)
Thanks @ewertons. Looking forward to the customer experience and feedback with this!
cc @antkmsft, @vhvb1989 just an FYI (once storage comes online) or in case you have any other thoughts to share.
👍 Unless we automate most of "Ewerton magic", whatever basic manual steps you do take now, or know you plan to take in the future, it might be a good idea to have a quick "what to do" steps documented somewhere accessible, and might even check-it-in somewhere in this repo (which you are probably the best person to decide, so up to you). This way, any new person on the team would know what to do to maintain and test this repo and the syncing mechanism. |
a3b077d
to
d1ea868
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some typos and comment fix-up suggestions. Also, fix-up the contact email/alias. Otherwise, looks good to me :)
Tested all samples one final time. All worked with the latest changes at merge time. |
For reference, this is the PR adding this new library to the official Arduino package manager: |
Updates Nano Connect sample for IoT Hub: - removes x509 cert device authentication (unused) - makes code C++ friendly - removes az_span where not directly used for Embedded C SDK - defines macros to replace magic numbers - refactors functions as needed - combines SAS material together (intentionally fewer functions to not distract from core sample) - fixes logging - fixes C2D messaging - Adds commenting - makes return code printouts consistent
No description provided.