---
title: "BLE Beacon Scanner Integration with Raspberry Pi Pico W, WIZnet Ethernet HAT, and AWS IoT Core"
url: "https://maker.wiznet.io/mason/projects/ble-beacon-scanner-integration-with-raspberry-pi-pico-w%2C-wiznet-ethernet-hat%2C-and-aws-iot-core/"
markdown_url: "https://maker.wiznet.io/mason/projects/ble-beacon-scanner-integration-with-raspberry-pi-pico-w%2C-wiznet-ethernet-hat%2C-and-aws-iot-core/md"
type: "WCC: WIZnet Created Content"
author: "Mason Lee"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Mason Lee"
license: "3-Clause BSD License(BSD-3-Clause)"
published: "2023-09-15"
language: "en"
tags: ["BLE", "Beacon", "AWS IoT Core"]
hardware: ["WIZnet Ethernet HAT", "Raspberry Pi Pico W"]
likes: 0
views: 3850
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# BLE Beacon Scanner Integration with Raspberry Pi Pico W, WIZnet Ethernet HAT, and AWS IoT Core

> BLE beacon scanner using Raspberry Pi Pico W & Wiznet Ethernet HAT for real-time, secure, & energy-efficient data transmission to AWS IoT Core

Original author: Mason Lee

## Components

- **WIZnet Ethernet HAT** x 1
- **Raspberry Pi Pico W** x 1 ([docs](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html))
- Software: **microsoft Visual Studio Code Extension for Arduino** ([docs](https://github.com/Azure/azure-sdk-for-c-arduino))

## Documents and links

- [Github Code](https://github.com/wiznetmaker/RPI_PICO_W-W5100S-BEACON_SCANNER_AWS) (code)

## Article

**Introduce**

At the application is the Raspberry Pi Pico W, a compact yet powerful microcontroller that orchestrates the seamless communication between BLE beacons and servers. Paired with the WIZnet Ethernet HAT, the system achieves unparalleled connectivity, ensuring a steady and reliable flow of data.

![](https://maker.wiznet.io/upload/ckeditor5/287138184%5F1694696042%2Ejpg)

*Raspberry Pi Pico W*

![](https://maker.wiznet.io/upload/ckeditor5/287138184%5F1694696068%2Epng)

*WIZnet Ethernet HAT*

![](https://maker.wiznet.io/upload/ckeditor5/287138184%5F1694696248%2Ejpg)

*Raspberry Pi Pico W + WIZnet Ethernet HAT*

The gateway operates by receiving BLE advertisement data, extracting crucial information such as the beacon address, data, sensitivity, and the time received, and transmitting this data securely to the AWS IoT Core server.

**Getting Start**

1. Source Code Clone and submodules update

```plaintext
 git clone --recursive https://github.com/wiznetmaker/RPI_PICO_W-W5100S-BEACON_SCANNER_AWS.git
```

2. Input your AWS IoT parameters

..\RPI_PICO_W-W5100S-BEACON_GATEWAY_AWS\examples\le_scanner\le_scanner.c

```c
#define MQTT_DOMAIN "account-specific-prefix-ats.iot.ap-northeast-2.amazonaws.com"
#define MQTT_PUB_TOPIC "$aws/things/my_rp2040_thing/shadow/update"
#define MQTT_SUB_TOPIC "$aws/things/my_rp2040_thing/shadow/update/accepted"
#define MQTT_USERNAME NULL
#define MQTT_PASSWORD NULL
#define MQTT_CLIENT_ID "my_rp2040_thing"
```

..\RPI_PICO_W-W5100S-BEACON_GATEWAY_AWS\examples\le_scanner\mqtt_certificate.h

```c
uint8_t mqtt_root_ca[] =
"-----BEGIN CERTIFICATE-----\r\n"
"...\r\n"
"-----END CERTIFICATE-----\r\n";

uint8_t mqtt_client_cert[] =
"-----BEGIN CERTIFICATE-----\r\n"
"...\r\n"
"-----END CERTIFICATE-----\r\n";

uint8_t mqtt_private_key[] =
"-----BEGIN RSA PRIVATE KEY-----\r\n"
"...\r\n"
"-----END RSA PRIVATE KEY-----\r\n";
```

For more detailed AWS settings, see the links below.
https://maker.wiznet.io/WIZnet/projects/connect-w5100s-evb-pico-to-aws-iot-core/

3. Build & Write

```plaintext
mkdir build
cd ./build/
cmake -G "NMake Makefiles" ..
nmake
```

![](https://maker.wiznet.io/upload/ckeditor5/287140058%5F1694769655%2Epng)

![](https://maker.wiznet.io/upload/ckeditor5/287140058%5F1694769680%2Epng)

![](https://maker.wiznet.io/upload/ckeditor5/287140058%5F1694769828%2Epng)

4. Copy a RPI_PICO_W-W5100S-BEACON_GATEWAY_AWS\build\examples\le_scanner\le_scanner.uf2 file to your Pico W board

5. Open terminal

![](https://maker.wiznet.io/upload/ckeditor5/287140058%5F1694770045%2Epng)

![](https://maker.wiznet.io/upload/ckeditor5/287140058%5F1694770024%2Epng)

6. Open your AWS IoT Console

![](https://maker.wiznet.io/upload/ckeditor5/287140058%5F1694770118%2Epng)

Beacon devices can be used by writing any BLE example to another Pico W board or by using an app on a smartphone.

---

Source: https://maker.wiznet.io/mason/projects/ble-beacon-scanner-integration-with-raspberry-pi-pico-w%2C-wiznet-ethernet-hat%2C-and-aws-iot-core/
