Skip to content

Commit e40fbf0

Browse files
jmklixxiazhvera
andauthored
FAQ (#318)
* Add FAQ and create documents folder Co-authored-by: xiazhvera <[email protected]>
1 parent 1381b43 commit e40fbf0

File tree

7 files changed

+100
-30
lines changed

7 files changed

+100
-30
lines changed

README.md

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,18 @@ to Python by the `awscrt` package ([PyPI](https://pypi.org/project/awscrt/)) ([G
2222

2323
*__Jump To:__*
2424
* [Installation](#Installation)
25-
* [Mac-Only TLS Behavior](#Mac-Only-TLS-Behavior)
2625
* [Samples](samples)
2726
* [Getting Help](#Getting-Help)
27+
* [FAQ](./documents/FAQ.md)
2828
* [Giving Feedback and Contributions](#Giving-Feedback-and-Contributions)
29-
* [More Resources](#More-Resources)
3029

3130

3231
## Installation
3332

3433
### Minimum Requirements
3534
* Python 3.6+
3635

37-
[Step-by-step instructions](./PREREQUISITES.md)
36+
[Step-by-step instructions](./documents/PREREQUISITES.md)
3837

3938
### Install from PyPI
4039
```
@@ -56,15 +55,7 @@ python3 -m pip install ./aws-iot-device-sdk-python-v2
5655

5756
`awsiotsdk` depends on [awscrt](https://github.com/awslabs/aws-crt-python), which makes use of C extensions. Precompiled wheels are downloaded when installing on major platforms (Mac, Windows, Linux, Raspberry Pi OS). If wheels are unavailable for your platform, your machine must compile some C libraries.
5857

59-
If you encounter issues, see [Installation Issues](./PREREQUISITES.md#installation-issues) and try again.
60-
61-
## Mac-Only TLS Behavior
62-
63-
Please note that on Mac, once a private key is used with a certificate, that certificate-key pair is imported into the Mac Keychain. All subsequent uses of that certificate will use the stored private key and ignore anything passed in programmatically. Beginning in v1.3.2, when a stored private key from the Keychain is used, the following will be logged at the "info" log level:
64-
65-
```
66-
static: certificate has an existing certificate-key pair that was previously imported into the Keychain. Using key from Keychain instead of the one provided.
67-
```
58+
If you encounter issues, see [Installation Issues](./documents/PREREQUISITES.md#installation-issues) and try again.
6859

6960
## Samples
7061

@@ -76,6 +67,7 @@ The best way to interact with our team is through GitHub. You can [open an issue
7667

7768
Please make sure to check out our resources too before opening an issue:
7869

70+
* Our [FAQ](./documents/FAQ.md)
7971
* [API documentation](https://aws.github.io/aws-iot-device-sdk-python-v2/)
8072
* Our [Developer Guide](https://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html) ([source](https://github.com/awsdocs/aws-iot-docs))
8173
* Check for similar [Issues](https://github.com/aws/aws-iot-device-sdk-python-v2/issues)
@@ -90,24 +82,11 @@ is provided by code that been generated from a model of the service.
9082

9183
We need your help in making this SDK great. Please participate in the community and contribute to this effort by submitting issues, participating in discussion forums and submitting pull requests through the following channels.
9284

93-
* [Contributions Guidelines](/CONTRIBUTING.md)
94-
* Articulate your feature request or upvote existing ones on our [Issues](https://github.com/aws/aws-iot-device-sdk-python-v2/issues?q=is%3Aissue+is%3Aopen+label%3Afeature-request) page.
95-
* Submit [Issues](https://github.com/aws/aws-iot-device-sdk-python-v2/issues)
96-
97-
98-
## More Resources
99-
100-
* [AWS IoT Core Documentation](https://docs.aws.amazon.com/iot/)
101-
* [Developer Guide](https://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html) ([source](https://github.com/awsdocs/aws-iot-docs))
102-
* [Issues](https://github.com/aws/aws-iot-device-sdk-python-v2/issues)
103-
* [Dev Blog](https://aws.amazon.com/blogs/?awsf.blog-master-iot=category-internet-of-things%23amazon-freertos%7Ccategory-internet-of-things%23aws-greengrass%7Ccategory-internet-of-things%23aws-iot-analytics%7Ccategory-internet-of-things%23aws-iot-button%7Ccategory-internet-of-things%23aws-iot-device-defender%7Ccategory-internet-of-things%23aws-iot-device-management%7Ccategory-internet-of-things%23aws-iot-platform)
104-
105-
Integration with AWS IoT Services such as
106-
[Device Shadow](https://docs.aws.amazon.com/iot/latest/developerguide/iot-device-shadows.html)
107-
and [Jobs](https://docs.aws.amazon.com/iot/latest/developerguide/iot-jobs.html)
108-
is provided by code that been generated from a model of the service.
109-
85+
* [Contributions Guidelines](./documents/CONTRIBUTING.md)
86+
* Articulate your feature request or upvote existing ones on our [Issues](https://github.com/aws/aws-iot-device-sdk-python-v2/issues?q=is%3Aissue+is%3Aopen+label%3Afeature-request) page.
87+
* Create discussion questions [here](https://github.com/aws/aws-iot-device-sdk-python-v2/discussions)
88+
* Find a bug open an [issue](https://github.com/aws/aws-iot-device-sdk-python-v2/issues)
11089

11190
## License
11291

113-
This library is licensed under the Apache 2.0 License.
92+
This library is licensed under the [Apache 2.0 License](./documents/LICENSE).
File renamed without changes.
File renamed without changes.

documents/FAQ.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Frequently Asked Questions
2+
3+
### Where should I start?
4+
5+
If you are just getting started make sure you [install this sdk](https://github.com/aws/aws-iot-device-sdk-python-v2#installation) and then build and run the [basic PubSub](https://github.com/aws/aws-iot-device-sdk-python-v2/tree/main/samples#pubsub)
6+
7+
### How do I enable logging?
8+
9+
``` python
10+
io.init_logging(io.LogLevel.Error, 'stderr')
11+
```
12+
You can also enable [CloudWatch logging](https://docs.aws.amazon.com/iot/latest/developerguide/cloud-watch-logs.html) for IoT which will provide you with additional information that is not avaible on the client side sdk.
13+
14+
### I keep getting AWS_ERROR_MQTT_UNEXPECTED_HANGUP
15+
16+
This could be many different things but it most likely is a policy issue. Start with using a super permissive IAM policy called AWSIOTFullAccess which looks like this:
17+
18+
``` json
19+
{
20+
"Version": "2012-10-17",
21+
"Statement": [
22+
{
23+
"Effect": "Allow",
24+
"Action": [
25+
"iot:*"
26+
],
27+
"Resource": "*"
28+
}
29+
]
30+
}
31+
```
32+
33+
After getting it working make sure to only allow the actions and resources that you need. More info about IoT IAM policies can be found [here](https://docs.aws.amazon.com/iot/latest/developerguide/security_iam_service-with-iam.html).
34+
35+
### Mac-Only TLS Behavior
36+
37+
Please note that on Mac, once a private key is used with a certificate, that certificate-key pair is imported into the Mac Keychain. All subsequent uses of that certificate will use the stored private key and ignore anything passed in programmatically. Beginning in v1.7.3, when a stored private key from the Keychain is used, the following will be logged at the "info" log level:
38+
39+
```
40+
static: certificate has an existing certificate-key pair that was previously imported into the Keychain. Using key from Keychain instead of the one provided.
41+
```
42+
43+
### How do debug in VSCode?
44+
45+
Here is an example launch.json file to run the pubsub sample
46+
``` json
47+
{
48+
// Use IntelliSense to learn about possible attributes.
49+
// Hover to view descriptions of existing attributes.
50+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
51+
"version": "0.2.0",
52+
"configurations": [
53+
{
54+
"name": "PubSub",
55+
"type": "python",
56+
"request": "launch",
57+
"program": "${workspaceFolder}/samples/pubsub.py",
58+
"args": [
59+
"--endpoint", "<account-number>-ats.iot.<region>.amazonaws.com",
60+
"--ca_file", "<path to root-CA>",
61+
"--cert", "<path to cert>",
62+
"--key", "<path to key>",
63+
"--client-id", "test-client"
64+
]
65+
}
66+
]
67+
}
68+
```
69+
70+
### What certificates do I need?
71+
72+
* You can download pre-generated certificates from the AWS console (this is the simplest and is recommended for testing)
73+
* You can also generate your own certificates to fit your specific use case. You can find documentation for that [here](https://docs.aws.amazon.com/iot/latest/developerguide/x509-client-certs.html) and [here](https://iot-device-management.workshop.aws/en/provisioning-options.html)
74+
* Certificates that you will need to run the samples
75+
* Root CA Certificates
76+
* Download the root CA certificate file that corresponds to the type of data endpoint and cipher suite you're using (You most likely want Amazon Root CA 1)
77+
* Generated and provided by Amazon. You can download it [here](https://www.amazontrust.com/repository/) or download it when getting the other certificates from the AWS console
78+
* When using samples it can look like this: `--ca_file root-CA.crt`
79+
* Device certificate
80+
* Intermediate device certificate that is used to generate the key below
81+
* When using samples it can look like this: `--cert abcde12345-certificate.pem.crt`
82+
* Key files
83+
* You should have generated/downloaded private and public keys that will be used to verify that communications are coming from you
84+
* When using samples you only need the private key and it will look like this: `--key abcde12345-private.pem.key`
85+
86+
### I still have more questions about the this sdk?
87+
88+
* [Here](https://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html) are the AWS IoT Core docs for more details about IoT Core
89+
* [Here](https://docs.aws.amazon.com/greengrass/v2/developerguide/what-is-iot-greengrass.html) are the AWS IoT Greengrass v2 docs for more details about greengrass
90+
* [Discussion](https://github.com/aws/aws-iot-device-sdk-python-v2/discussions) questions are also a great way to ask other questions about this sdk.
91+
* [Open an issue](https://github.com/aws/aws-iot-device-sdk-python-v2/issues) if you find a bug or have a feature request
File renamed without changes.

NOTICE renamed to documents/NOTICE

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)