AWS IoT Core Getting Started Guide

Connect an ALPON X5 AI or ALPON X4 to AWS IoT Core: set up the device and your AWS account, provision certificates, build the arm64 demo container, deploy it through ALPON Cloud, and verify MQTT messages in the AWS console.

AWS IoT Core Getting Started on ALPON

Bring your ALPON X5 AI or ALPON X4 online with AWS IoT Core. This guide follows the AWS Partner Device Catalog getting-started format: it walks through the hardware, your AWS account and IoT resources, certificate provisioning, and then builds a small Python MQTT demo as an arm64 container, deploys it through ALPON Cloud, and verifies the messages in the AWS IoT MQTT test client.

ALPON X5 AI ALPON X4 AWS IoT Core MQTT
ALPON · Tutorial · Cloud · AWS IoT Core
How do I connect an ALPON to AWS IoT Core?

Register and activate the device on ALPON Cloud, create a Thing and an IoT policy in the AWS IoT console, and copy the device certificate, private key, and Amazon Root CA to a directory on the ALPON X5 AI or ALPON X4. Build the demo container with docker buildx build --platform=linux/arm64, push it to your registry, and deploy it from the Applications tab with the ENDPOINT, TOPIC, and certificate environment variables plus a volume that mounts the certificate folder to /certs. Messages then appear in the AWS IoT MQTT test client.

Overview

The ALPON X4 is an industrial-grade edge computing device based on the Raspberry Pi platform, designed for reliable IoT deployments. Featuring LTE connectivity, eSIM support, and multi-level network redundancy, it ensures secure data transmission in challenging conditions. Its open architecture supports seamless application integration, while a cloud-based suite enables remote access, device monitoring, and fleet management. Ideal for industrial and IoT applications, the ALPON X4 meets diverse needs across various sectors.

The hardware walkthrough in this guide describes the ALPON X4 kit. The AWS account, provisioning, build, deployment, and verification steps are the same on ALPON X5 AI and ALPON X4: both run arm64 containers managed through ALPON Cloud.

Document information

Version 0.1
Date 2025-02-05
Author FAE
Changes made Document Created
Approved by Okan Saraçoğlu
Status Release
Applicable operating systems This guide is designed for Linux-based operating systems, specifically ALPON OS and Raspberry Pi OS. It may also work with other Linux distributions, but some dependencies and configurations may vary.
Before you start

You need an ALPON X5 AI or ALPON X4 with its power adapter, an account on ALPON Cloud, an AWS account (created in step 3 if you do not have one), and a personal computer with Docker and Docker Buildx installed to build the demo image. New to container deployment? Start with Containerize Apps for ALPON.

Hardware

Datasheet

The datasheet and all information about ALPON X4 can be found in the Sixfab ALPON X4 Product Sheet.

Standard kit contents

The standard ALPON X4 shipping kit includes the following hardware components:

Hardware provided ALPON X4 Edge Computer
Debug hardware Not included.
Cables provided USB-PD Type-C Power Adapters with Universal Plugs
Power source Screw Terminal Male (for Terminal Power Option)
User-provided items None

Third-party purchasable items

The following third-party products for ALPON X4 are available for purchase:

AccessoryProduct page
ALPON DIN Rail Mount Kitsixfab.com/product/alpon-din-rail-mount-kit
ALPON Wall Mount Kitsixfab.com/product/alpon-wall-mount-kit
ALPON Combo Antennasixfab.com/product/alpon-combo-antenna
ALPON GPIO Expansion with Cablesixfab.com/product/alpon-gpio-expansion-with-cable
ALPON GPIO Expansionsixfab.com/product/alpon-gpio-expansion
ALPON Terminal DC Power Adaptersixfab.com/product/alpon-terminal-dc-power-adapter

Additional hardware references

All additional hardware and software related documents are available in the ALPON X4 documentation.

  1. 1

    Set up your development environment

    Tools installations (IDEs, toolchains, SDKs)

    ALPON X4 does not require any specific SDK, IDE, or toolchain for application development. It is designed to operate in a container-based environment, and while containerization is optional, we strongly recommend containerizing applications and deploying them through the ALPON Cloud platform for ease of deployment and management. However, applications can still be developed and run directly on the device without containers if preferred. The only critical requirement is that your application must be properly containerized for the ARM64 architecture and the container must run seamlessly on the target hardware, such as an ARM64-based development board or server.

    IDE-based development · supported IDEs Not applicable, as the device does not require a specific IDE for development.
    IDE-based development · IDE setup instructions Not applicable.
    IDE-based development · SDK integration with IDE Not applicable.
    CLI based (e.g. CMake) Not applicable.
    Required toolchains Not applicable. ALPON X4 does not require a specific toolchain for development.
    Specific compiler options ALPON X4 has the arm64 architecture. Applications must support arm64, and compilers must compile applications for the arm64 architecture.
  2. 2

    Set up the device hardware

    Box content

    1. ALPON X4 Micro Edge Computer
    2. USB Type-C Power Adapter (27W PD) with Plug Adapters (x4)
    3. Screw Terminal Block
    Contents vary by variant

    Please note that contents may vary by product variant, including differences in RAM, storage, PoE availability, and Wi-Fi features.

    ALPON X4 box content: the edge computer, USB Type-C power adapter with plug adapters, and screw terminal block
    ALPON X4 box content.

    Layout

    ALPON X4 front view with numbered callouts for the push button, LEDs, and power inputs
    ALPON X4 layout — front view.
    ALPON X4 side view with numbered callouts for the HDMI port and USB 2.0 ports
    ALPON X4 layout — display and USB side.
    1. User Programmable Push Button (PB1)
    2. 4x LED
    3. USB Type-C PD Power Input
    4. Screw Terminal Power Input (9-30V DC)
    5. Display (HDMI 2.0 port)
    6. 2x USB 2.0 Port
    ALPON X4 rear view with numbered callouts for the switches, second push button, Ethernet ports, and GPIO port
    ALPON X4 layout — Ethernet and GPIO side.
    1. Watchdog, Boot/Burn Switches
    2. User Programmable Push Button (PB2)
    3. 100 Mbps Ethernet Port
    4. 1 Gbps Ethernet Port*
    5. GPIO Port
    * PoE-enabled variants

    On PoE-enabled variants, PoE+ adds power on the same 1 Gbps ETH/G data port; it does not replace Ethernet data. The 100 Mbps ETH port is data-only.

    1. Mounting Hole — Our product features 2x 4mm mounting holes. For industrial applications, these can be used to attach the device to a DIN rail with the appropriate accessories. For other uses, such as wall mounting, the necessary accessories can be purchased, and these holes can be utilized for secure installation. For more details on mounting options, please refer to the Accessories page.
    ALPON X4 bottom view showing the two 4 mm mounting holes
    ALPON X4 layout — mounting holes.
    1. Antennas
    ALPON X4 antenna connectors labelled G for GNSS, W for Wi-Fi, and L for LTE, with the passive cooling case
    On the side of the antennas, G is for GNSS, W is for Wi-Fi, and L (x2) is for LTE.
    1. Passive Cooling Case

    Device registration

    Register the device by scanning the QR code on its bottom label or by entering the serial number manually in ALPON Cloud. Registration links the device to your account; activation is a separate step.

    Scanning the QR code

    • Locate the QR code on the bottom of the ALPON X4 and scan it using your device's camera.
    • After scanning, you will be automatically redirected to the ALPON Cloud website.
    • Log in to ALPON Cloud.
    • After logging in, your device will be automatically registered to your account.

    Manual registration (alternative)

    • Log in to ALPON Cloud.
    • Navigate to Assets → + Register Asset.
    ALPON Cloud Assets page with the Register Asset button highlighted
    Assets → + Register Asset in ALPON Cloud.
    • Enter your ALPON X4's serial number.
    Bottom label of the ALPON X4 showing the serial number and QR code
    The serial number (S/N) is on the bottom of the device.
    • Complete the registration process by clicking the Register button.

    Activating the asset

    • After registering the asset, navigate to the Assets section.
    • Locate the registered device in the list.
    • Click the Details button for that asset.
    • Set the Active / Inactive toggle at the top right to Active.
    ALPON Cloud asset details page with the Active / Inactive toggle set to Active
    Activating the asset from its Details page.

    Power connection

    Connect the supported USB-C PD adapter (15 V, 1.8 A, 27 W). Boot and provisioning time depend on the network; use the Connection LED and ALPON Cloud status rather than a fixed timer.

    USB-C PD power adapter connected to the ALPON X4
    Powering the ALPON X4 from the USB-C PD adapter.

    For more information on the available power options for this device, please refer to the Technical Details — Power section.

    Ready to use

    The Connection LED is green when the device is connected to ALPON Cloud and off when disconnected. The Cellular LED reports modem state. See Physical Layout & I/O for the complete LED reference.

    ALPON X4 status LEDs with the Connection LED lit green
    The Connection LED turns green once the device is online in ALPON Cloud.

    Device update

    After successfully registering your device, it is recommended to check for updates to ensure optimal performance.

    • Log in to your ALPON Cloud account and navigate to the Assets section.
    • Select your device from the list and go to the Device tab.
    • In the Device Maintenance section, click the Update Device button.

    Follow the prompts to install any updates to keep your device running with the latest features and improvements.

    Application deployment on ALPON

    For optimal performance and scalability, we strongly recommend encapsulating your applications within Docker containers and managing them via ALPON Cloud. This approach not only ensures the highest level of reliability but also facilitates seamless scaling. By using Docker containers, you isolate your application environment, streamline deployment processes, and enhance operational consistency across different devices.

    By adopting this method, you benefit from:

    • Enhanced reliability: Containerized applications are less likely to interfere with one another, which significantly reduces the risk of system-wide failures.
    • Scalability: Effortlessly scale your operations by managing multiple container instances across several devices without the need for extensive configuration adjustments.
    • Maintainability: Simplify updates and maintenance with minimal disruption to your existing operations, ensuring continuous service availability.

    We encourage you to leverage the ALPON platform’s capabilities to maximize the effectiveness and efficiency of your application deployments.

    After the device registration, to deploy and manage your own application, go to the Deploy Applications page for instructions. It covers setting up and running container-based applications on the ALPON. Sixfab Field Application Engineers are always open to help you with your software containerization. Please contact our support team if you need assistance.

  3. 3

    Set up your AWS account and permissions

    If you do not have an existing AWS account and user, refer to the online AWS documentation at Set up your AWS Account. To get started, follow the steps outlined in the sections below:

    Pay special attention to the Notes.

  4. 4

    Create resources in AWS IoT

    Refer to the online AWS documentation at Create AWS IoT Resources. Follow the steps outlined in these sections to provision resources for your device:

    Pay special attention to the Notes.

  5. 5

    Provision the device with credentials

    The device can be provisioned using multiple approaches. For AWS IoT Core integration, we recommend downloading only the necessary certificate files specific to AWS IoT Core. After downloading the files to the device, we will use them while deploying through ALPON Cloud. Therefore, make sure to save the full file paths for reference.

    Getting a shell on the device

    To connect to the device, use the Open Remote Terminal button on the relevant asset in ALPON Cloud to obtain an SSH terminal. You can then perform your operations directly from there.

    Obtain AWS IoT Core certificates

    1. Navigate to the AWS IoT Core Console.
    2. Create a new device (Thing) and generate certificates.
    3. Download the following files:
      • Device Certificate (.pem.crt)
      • Private Key (.pem.key)
      • Amazon Root CA Certificate

    Load certificates onto the device

    1. Transfer the downloaded certificate and key files to the device.
    2. Create a directory and store the certificate files in it (e.g., /etc/aws-iot/).
  6. 6

    Build the demo

    This step builds a Docker container that enables the device to communicate with AWS IoT Core. It is run on a personal computer, not on the ALPON. Docker Buildx must be pre-installed on your personal computer.

    Create the example Python file

    Create an example.py file with the following content:

    example.py
    import sys
    import os
    import random
    import time
    import string
    from awscrt import io, mqtt, auth, http
    from awsiot import mqtt_connection_builder
    import uuid
    
    endpoint = os.environ.get("ENDPOINT", "")
    cert_filepath = os.environ.get("CERT_FILENAME", "/certs/certificate.pem.crt")
    key_filepath = os.environ.get("KEY_FILENAME", "/certs/private.pem.key")
    ca_filepath = os.environ.get("CA_FILENAME", "/certs/AmazonRootCA1.pem")
    client_id = os.environ.get("CLIENT_ID", "alponx4_thing")
    
    mqtt_connection = mqtt_connection_builder.mtls_from_path(
        endpoint=endpoint,
        cert_filepath=cert_filepath,
        pri_key_filepath=key_filepath,
        ca_filepath=ca_filepath,
        client_id=client_id,
        clean_session=True,
        keep_alive_secs=60
    )
    
    print(f"Connecting to {endpoint} with client ID '{client_id}'...")
    connect_future = mqtt_connection.connect()
    
    try:
        connect_future.result(10)
        print("Connected!")
    except Exception as e:
        print(f"Connection failed: {e}")
        sys.exit(1)
    
    def generate_random_message():
        message = ''.join(random.choices(string.ascii_letters + string.digits, k=16))
        return '{"random_message":"' + message + '"}'
    
    topic = os.environ.get("TOPIC", "demo/test")
    
    try:
        while True:
            message = generate_random_message()
            print(f"Publishing message: {message}")
    
            publish_future = mqtt_connection.publish(
                topic=topic,
                payload=message,
                qos=mqtt.QoS.AT_LEAST_ONCE
            )
            time.sleep(5)
    except KeyboardInterrupt:
        print("Terminating...")
    except Exception as e:
        print(f"An error occurred: {e}")
    finally:
        # Disconnect
        try:
            disconnect_future = mqtt_connection.disconnect()
            disconnect_future.result()
            print("Disconnected successfully.")
        except Exception as e:
            print(f"Disconnect error: {e}")

    Create the Dockerfile

    Create a Dockerfile with the following content:

    Dockerfile
    FROM alpine:latest
    
    RUN apk update && apk add python3 py3-pip wget
    
    WORKDIR /app
    COPY ./example.py /app
    RUN python3 -m pip install awsiotsdk --break-system-packages
    CMD python3 example.py

    Build the Docker image

    1. Navigate to the directory containing the Dockerfile and example.py file, then build the image for arm64:
    bash · build the image
    cd /path/to/folder
    docker buildx build --platform=linux/arm64 -t aws-iot-demo .
    1. In ALPON Cloud, navigate to the Registry tab of your asset.
    2. Click + Add Container and follow the prompts to add the image you just built to your registry.
  7. 7

    Run the demo

    Access the device interface

    1. Go to ALPON Cloud.
    2. Navigate to the Applications tab of your asset and select Deploy App.

    Deployment configuration

    In the Deploy App window, configure the deployment as follows:

    Container Name awstest
    Image Select the image and tag of the AWS IoT test container you pushed to the registry.
    Environments Add the six variables in the table below. Replace the placeholder values with your own AWS IoT Core endpoint, topic, client ID, and certificate file names.
    Volumes Mount the certificate folder you created in step 5 to /certs (second table below).
    KeyValue
    ENDPOINTAWS_IOT_CORE_ENDPOINT
    TOPICExampleTopicName
    CLIENT_IDALPONX4_Client
    CA_FILENAME/certs/CACertFileName.pem
    CERT_FILENAME/certs/CertFileName.pem.crt
    KEY_FILENAME/certs/PrivateKeyFileName.pem.key
    Read/WriteFromTo
    Read/Write/path/to/your/cert/folder/on/alpon/certs
    Certificate paths are container paths

    example.py reads CA_FILENAME, CERT_FILENAME, and KEY_FILENAME as paths inside the container, so they must start with the volume target /certs/. If you leave them unset, the script falls back to /certs/AmazonRootCA1.pem, /certs/certificate.pem.crt, and /certs/private.pem.key — name your files accordingly or set the variables.

    Click Deploy to start the container on the device.

  8. 8

    Verify messages in AWS IoT Core

    To verify that your demo works successfully by observing the MQTT messages received by AWS IoT Core, use the IoT Core MQTT test client:

    1. Log in to the AWS Management Console
    2. Navigate to the MQTT test client
      • In the left-hand sidebar, under Test, click MQTT test client. This opens the MQTT test interface where you can send and receive MQTT messages.
    3. Get your MQTT client endpoint
      • In the MQTT test client tab, click Connection details.
      • Copy the Endpoint (xxxxxx.iot.<region>.amazonaws.com). This is the value for the ENDPOINT environment variable.
    4. Subscribe to the topic
      • In the Topic field, type the topic name that your demo is using to publish messages (the TOPIC environment variable), for example demo/topic.
      • Click Subscribe. This allows you to receive messages published to that topic.
    5. Observe the incoming MQTT messages
      • If your demo is successfully publishing messages to the topic, they appear in the Message log section after the test client receives them.
      • Verify that the message format and content match the expected output of your demo.
    6. Verify the demo
      • If you see the messages in the MQTT test client, your demo is working: it is sending and receiving MQTT messages via AWS IoT Core.
Ready when…
  • The device shows as Active in ALPON Cloud with a green Connection LED.
  • The awstest container is running in the Applications tab and its logs show Connected! followed by Publishing message: … lines.
  • A new {"random_message": "…"} payload arrives every 5 seconds in the AWS IoT MQTT test client on your topic.

The ALPON is now publishing to AWS IoT Core. Replace example.py with your own application logic and redeploy through ALPON Cloud.

Troubleshooting

Common failure modes when connecting the demo container to AWS IoT Core, and how to resolve each.

Connection Unable to connect to AWS IoT Core

Issue

The MQTT client fails to connect to the AWS IoT Core endpoint.

Possible causes

  • Incorrect endpoint: Ensure the endpoint in the script matches your AWS IoT Core custom endpoint (found in the AWS IoT console under Settings).
  • Network issues: The container might not be able to access the network. Check network connectivity through ALPON Cloud’s container shells.
  • AWS IoT Core authentication failure: Verify that the provided certificate, private key, and root CA are correct and valid.
  • Firewall/proxy: If you're behind a firewall or using a proxy, ensure that the necessary ports (like 8883 for secure MQTT) are open and accessible.

Solution

  • Double-check the endpoint and verify it in the AWS IoT console.
  • Check the network configuration of your Docker container.
  • Validate that your certificates are correctly mounted and readable inside the container.
Auth Certificate errors

Issue

The MQTT client fails to load certificates or authentication fails.

Possible causes

  • Incorrect certificate paths: Ensure the file paths in the environment variables are correct.
  • Wrong certificate format: Make sure the certificates are in PEM format and not corrupted.
  • Missing certificates: One or more of the required certificates (client certificate, private key, or root CA) might be missing.
  • Incorrect file permissions: The container might not have read access to the certificate files if permissions are set incorrectly.

Solution

  • Verify that the certificates exist in the specified locations inside the container. Use ls to check for the files.
  • Ensure that the correct certificate format (PEM) is being used.
  • Re-upload or regenerate certificates if they are missing or corrupted.
  • Ensure the certificate files are readable by the user running the script inside the container:
bash · fix certificate permissions
chmod 644 /path/to/certificate.pem.crt
chmod 600 /path/to/private.pem.key
chmod 644 /path/to/AmazonRootCA1.pem
Software No messages being published

Issue

The script runs, but no messages are being sent to the AWS IoT Core topic.

Possible causes

  • Incorrect topic: Ensure the topic you're publishing to matches the one your device or application is listening to.
  • MQTT QoS issue: The Quality of Service (QoS) level set for publishing might be preventing messages from being acknowledged or delivered.
  • Publish function failing silently: The publish() method might not be working as expected.

Solution

  • Double-check the topic name in both the publisher and subscriber.
  • Try changing the QoS level to mqtt.QoS.AT_LEAST_ONCE to ensure messages are reliably delivered.
  • Add error handling or logging to verify that the publish() function completes successfully.
Network Container not able to reach the internet

Issue

The container is not able to reach external services like AWS IoT Core.

Possible causes

  • DNS resolution issues: The container might not be able to resolve the AWS IoT endpoint domain name.

Solution

  • Test the container's internet access by trying to ping an external site (e.g., ping google.com) from within the container. To do this, access the container's shell through ALPON Cloud by navigating to the Applications tab of the relevant asset. From there, you can execute the necessary commands inside the container.
  • Verify the DNS settings and ensure the container can resolve domain names correctly.

You can find more information in the AWS IoT troubleshooting guide.

Production image policy: Replace floating :latest references with a reviewed immutable tag or digest, then record the selected version for rollback.


Did this page help you?