---
title: "Connect Pico LTE to AWS IoT Core"
description: "Connect the Pico LTE to AWS IoT Core over the cellular connection: an HTTPS POST to the device shadow, and MQTT publish and subscribe with certificates."
url: "https://docs.sixfab.com/cellular/pico-lte/micropython-sdk/aws-iot-core/"
last_updated: "2026-10-12"
---

# Connect Pico LTE to AWS IoT Core

Connect the Pico LTE to AWS IoT Core over the cellular connection: an HTTPS POST to the device shadow, and MQTT publish and subscribe with the thing’s certificates.

These examples connect the Pico LTE to AWS IoT Core over the cellular connection: an HTTPS POST to the device shadow, and MQTT publish and subscribe. The board authenticates with the certificates of an AWS IoT thing.

## Before you begin

**Required**

**Hardware**

- **Sixfab Pico LTE or Pico LTE 2**: Registered and active in Sixfab Connect, connected to the computer with the micro USB cable.

**Software**

- **Thonny with MicroPython and the Pico LTE SDK**: Set up as in the [quickstart](https://docs.sixfab.com/cellular/pico-lte/quickstart/).
- **config.json**: In the root of the board: [Prepare the configuration file](https://docs.sixfab.com/cellular/pico-lte/micropython-sdk/configuration-file/).
- **AWS account**: With access to AWS IoT Core: [create and activate an AWS account](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/).

## Set up AWS IoT Core

1. **Open AWS IoT Core.**

   Sign in to the [AWS Management Console](https://signin.aws.amazon.com/), type **IoT Core** in the search bar and select the service.

   ![Animation of the AWS Console Home, searching for IoT Core and opening the service](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-1.gif)

2. **Create policy.**

   Under **Manage** in the side bar, open **Security → Policies** and click **Create policy**.

   ![AWS IoT console home page with the Manage section in the left sidebar](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-2.gif)

   Enter a name, set the policy effect to **Allow** and the policy action and resource to `*` (all), then click **Create**.

   ![AWS IoT Create policy form with Policy name, Policy effect Allow, action, resource fields and Create button](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-3.png)

3. **Create thing.**

   Open **All devices → Things**, click **Create things**, select **Create single thing** and click **Next**.

   ![AWS IoT Policies page with a test policy, leading to All devices > Things to create a thing](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-4.gif)

   Enter the thing’s name, set the device shadow to **Unnamed shadow (classic)** and click **Next**.

   ![AWS IoT Specify thing properties page with Thing name field and Device Shadow options](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-5.gif)

4. **Create its certificate.**

   Select **Auto-generate a new certificate (recommended)** and click **Next**.

   ![AWS IoT Configure device certificate step with Auto-generate a new certificate selected and Next button](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-6.png)

   Select the policy you created and click **Create thing**.

   ![AWS IoT Attach policies to certificate step with the test policy and Create thing button](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-7.gif)

5. **Save certificates with these names.**

   - Device certificate: `client.pem`
   - Private key file: `user_key.pem`
   - Root certificate: `cacert.pem`

   ![AWS IoT Download certificates and keys dialog mapping files to client.pem, user_key.pem and cacert.pem](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-9-1.png)

   Put the three files in a folder named `cert` and upload the folder to the root of the board.

   ![Thonny file browser showing the cert folder with cacert.pem, client.pem and user_key.pem on the Raspberry Pi Pico](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-9-2.png)

On the first run, the SDK moves the certificates into the module’s secure storage and deletes them from the board’s file system.

## Find endpoint and topics

Open **All devices → Things**, select your thing, then the **Device Shadows** tab and **Classic Shadow**.

![AWS IoT console home page, starting point for opening All devices > Things and the thing's Classic Shadow](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-9.gif)

Under **MQTT Topics** are the host address (the endpoint) and the topics: the publish topic ends in `/update`.

![AWS IoT Classic Shadow page with Device Shadow URL and the MQTT topics tab](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-10-1.gif)

![AWS IoT Classic Shadow details with the host address in the Device Shadow URL highlighted](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-MQTT-Connection-Subscribe-1.png)

![AWS IoT MQTT topics table with the /update shadow topic marked as Publish Topic Name](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-MQTT-Connection-Subscribe-2-1.png)

![AWS IoT MQTT topics table with the /get/accepted shadow topic marked as Subscribe Topic Name](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-MQTT-Connection-Subscribe-2.png)

## Run examples

The scripts are in the `examples/aws-iot` folder of the [SDK repository](https://github.com/sixfab/pico_lte_micropython-sdk). AWS needs no username or password: the certificates authenticate the board. The message, `PAYLOAD_JSON` in the script, must be JSON: AWS IoT Core accepts JSON messages.

**HTTPS**

1. **Set endpoint and topic in config.json.**

   ```json
   {
       "aws": {
           "https": {
               "endpoint": "YOUR_AWS_HOST_ADDRESS",
               "topic": "YOUR_AWS_PUBLISH_TOPIC"
           }
       }
   }
   ```

2. **Run http_post.py.**

   Open `examples/aws-iot/http_post.py` in Thonny, change `PAYLOAD_JSON` if you like, and click **Run**.

   ![Thonny running http_post.py with shell output showing a Result with message OK from AWS IoT](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-Test-Code-Example.png)

   ```text
   INFO: Publishing data to AWS IoT...
   INFO: Certificates uploaded secure storage. Deleting from file system...
   INFO: Certificates deleted from file system.
   INFO: Certificates found in PicoLTE.
   INFO: Result {'status': 0, 'response': ['{"message":"OK","traceId":"7c2d4647-0ad6-8426-ab82-647fd45d874"}'], 'interval': 0}
   ```

3. **Check device shadow.**

   The device shadow state on the Classic Shadow page shows `"App": "AWS HTTP Example"`.

   ![AWS IoT Device Shadow state with reported "App": "AWS HTTP Example" highlighted](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-Example-2.png)

**MQTT publish**

1. **Set host and topic in config.json.**

   ```json
   {
       "aws": {
           "mqtts": {
               "host": "YOUR_AWS_HOST_ADDRESS",
               "port": 8883,
               "pub_topic": "YOUR_AWS_PUBLISH_TOPIC"
           }
       }
   }
   ```

2. **Run mqtt_publish.py.**

   Open `examples/aws-iot/mqtt_publish.py` in Thonny, change `PAYLOAD_JSON` if you like, and click **Run**.

   ![Thonny running mqtt_publish.py with shell output Result status 0 and response OK](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-Test-Code-Example-2.png)

   ```text
   INFO: Publishing data to AWS IoT...
   INFO: Result {'status': 0, 'response': ['OK'], 'interval': 0}
   ```

3. **Check device shadow.**

   The device shadow state shows `"App": "AWS MQTT Example"`.

   ![AWS IoT Device Shadow state with reported "App": "AWS MQTT Example" highlighted](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-HTPP-MQTT-Connection-Example-1.png)

**MQTT subscribe**

1. **Set host and topics in config.json.**

   ```json
   {
       "aws": {
           "mqtts": {
               "host": "YOUR_AWS_HOST_ADDRESS",
               "port": 8883,
               "sub_topics": [
                   ["YOUR_MQTT_TOPIC/1", QoS],
                   ["YOUR_MQTT_TOPIC/2", QoS]
               ]
           }
       }
   }
   ```

   For example:

   ```json
   "sub_topics": [ ["$aws/things/test2-2/shadow/get/accepted", 0] ]
   ```

2. **Open MQTT test client.**

   On the same AWS IoT page, click **MQTT test client**, then **Publish to a topic**.

   ![AWS IoT MQTT topics section with the MQTT test client button highlighted](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-MQTT-Connection-Subscribe-3.png)

   ![AWS IoT MQTT test client with the Publish to a topic tab highlighted](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-MQTT-Connection-Subscribe-4.png)

3. **Run mqtt_subscribe.py.**

   Open `examples/aws-iot/mqtt_subscribe.py` in Thonny and click **Run**.

   ![Thonny with mqtt_subscribe.py open showing the config.json sub_topics example](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-MQTT-Connection-Subscribe-5-1.png)

4. **Publish message.**

   In the MQTT test client, enter the topic and a message payload and click **Publish**.

   ![AWS IoT MQTT test client Publish to a topic form with topic name, message payload and Publish button](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-MQTT-Connection-Subscribe-6.png)

   The log shows the message received:

   ![Thonny shell output of mqtt_subscribe.py receiving "Hello from AWS IoT console"](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/PicoLTE-AWS-IoT-MQTT-Connection-Subscribe-7.png)

## Troubleshooting

- `INFO: {'interval': 0, 'status': 1}` with HTTPS and no message in the device shadow: the endpoint in `config.json` is wrong. Copy it again from [MQTT Topics](https://docs.sixfab.com/cellular/pico-lte/micropython-sdk/aws-iot-core/#endpoint).
- Status `0` but the device shadow does not change: the message was sent. Check that the topic in `config.json` is the publish topic ending in `/update`, that the policy allows all actions (`*`), and that `PAYLOAD_JSON` follows the AWS IoT Core message format.
- `MQTT: None 8883 None` and no connection to the broker: `config.json` has no host or topic. Copy the example above and fill in its fields without breaking the JSON.
- `Certificates couldn't find in modem!`: the certificate files do not have the names above, or they are not in the `cert/` folder of the board.
- Status `1` with MQTT and no other error: the certificates do not let the board sign in to the broker. Upload the correct certificates, with the correct names, to `cert/`; if that fails, repeat the AWS IoT Core setup and upload the new certificates.
