Skip to content

Program allows Raspberry Pi Pico W to connect to wireless network and send messages to AWS IoT Core via MicroPython.

Notifications You must be signed in to change notification settings

onisoyyc/Connect-RPi-Pico-W-and-Write-Data-to-AWS-IoT-Core.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Connect Raspberry Pi Pico W to AWS IoT Core

This project demonstrates how to connect a Raspberry Pi Pico W to AWS IoT Core using MicroPython and MQTT.

Project Requirements

  • Hardware
    • Raspberry Pi Pico W x1
    • Push buttons x4
  • Software

Overview

Using AWS IoT Core’s message broker, this setup enables secure message transmission between AWS IoT Core and the Pico W.

The application:

  • Publishes button status to the picow/button topic when buttons are pressed or released.
  • Subscribes to the pico/led topic to control the Pico W’s onboard LED based on received messages (on, off, toggle).

Hardware Setup

  1. Connect each button between the GND and GP3 pins on the Raspberry Pi Pico W.

AWS IoT Core Setup

  1. Create an AWS Account and Access IoT Core

    • Sign in to AWS, search for IoT Core, and open it.
  2. Configure Policies

    • Go to Security > Policies and create a policy to control access.
    • Add the necessary policy actions, including the ability to publish and subscribe.
    • AWS IoT Core Policies Documentation
  3. Register Your Device

    • Go to All devices > Things > Create thing to register your Pico W device.
    • Name the thing and generate a new certificate for authentication.
    • Download the certificates for later use.
  4. Endpoint Configuration

    • Under Settings, note the Endpoint URL, as it will be used to set up the MQTT connection.

Code Setup

  1. Upload Certificate and Key Files

    • In Thonny IDE, navigate to View -> Files and locate the AWS IoT Core certificate and key files you downloaded earlier.
    • Upload them to the Pico W using Upload to /.
  2. Update Code with AWS Information

    • Use the AWS IoT Endpoint URL and certificate filenames in your MicroPython code to configure the MQTT client.
  3. Download the mainAWS.py file

  • Move to Raspberry Pico or prefered location in Computer and open in Thonny.
  • Run script.

About

Program allows Raspberry Pi Pico W to connect to wireless network and send messages to AWS IoT Core via MicroPython.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages