Building a GATT Server on Pi Pico W
The guide instructs on building a Bluetooth GATT server on the Raspberry Pi Pico W, covering Bluetooth architecture, GATT server-client interactions, and creating a GATT database for effective communication.
Read original articleThis webpage serves as a guide for building a Bluetooth GATT server on the Raspberry Pi Pico W, primarily aimed at students in ECE 4760 at Cornell University and hobbyists interested in Bluetooth integration. It emphasizes the implementation of a GATT server while providing a brief overview of the Bluetooth architecture, particularly focusing on the BTstack library used for Bluetooth communication. The document outlines the structure of the Bluetooth stack, detailing the roles of various layers including the physical layer, link layer, and host-controller interface. It explains how the GATT server interacts with GATT clients, highlighting the asymmetry in their roles where the server responds to client requests without initiating actions. The guide also covers the creation of a GATT database, which organizes data into attributes, allowing clients to query the server effectively. Key components discussed include building an attribute database, adding services and characteristics, and configuring the server for communication. The document aims to provide a foundational understanding of GATT server implementation, preparing readers for further exploration of GATT clients.
- The guide is intended for students and hobbyists interested in Bluetooth GATT server implementation on the Raspberry Pi Pico W.
- It provides an overview of the Bluetooth stack and the roles of different layers in communication.
- The GATT server responds to client requests, emphasizing the asymmetrical relationship between clients and servers.
- The document details the creation of a GATT database and the organization of data into attributes.
- It serves as a prerequisite for understanding GATT client development.
Related
A terminal-based Bluetooth manager for Linux
A terminal-based Bluetooth manager called "bluetuith" for Linux is available on GitHub. It offers various features like file transfer, pairing, device connection, power toggling, and media playback control.
Writing GUI applications on the Raspberry Pi without a desktop environment
This article explains writing GUI applications on a Raspberry Pi without a desktop environment. It covers interacting with the framebuffer, configuring resolutions, using low-level interfaces, Raylib library, and optimizing CPU usage.
A Mini Monitor for a Pi
The author shares a project using a 2-inch display as a Raspberry Pi monitor, creating a handheld console. Details include wiring, SPI communication, display mirroring for tasks like coding and web browsing, hardware setup, communication protocol, and a system service for seamless display experience.
Baking Pi – Operating Systems Development
Baking Pi is a tutorial course for ages 16+, teaching basic operating system development on Raspberry Pi. It includes practical exercises, requires specific hardware, and encourages community contributions via GitHub.
Google Pigweed SDK Now Supports Raspberry Pi RP2350 Microcontroller
Google's Pigweed SDK now supports the Raspberry Pi RP2350 microcontroller, enhancing embedded software development with open-source libraries, cross-platform support, and features like RPC communication and reusable modules.
From what I've found in the links below, it looks Bluetooth 5.4 spec contains an Attribute Protocol (ATT) that allows for sharing of custom attributes between bluetooth devices. Attributes have a type identified by UUID, a server-specific 16-bit handle, a higher-level handle group, a value, and then permissions. Permissions specify read/write capability and requirements for encryption, authentication, and authorization. Generic Attribute Profile (GATT) is a service discovery/management framework built around ATT.
While wondering about what applications this is intended for, I found an example in Figure 2.2 the GATT spec (2nd link) showing a computer communicating with a sensor over bluetooth, so presumably, this is ATT and GATT are meant to improve IoT networks utilizing bluetooth. Appendixes A and B show examples of the protocol containing data for battery status, temperature sensors, and glucose monitors.
Is this the current state of the art for this type of information over Bluetooth, or is there something else that is currently being used?
I'd like to see a Pi Pico W bluetooth host for my custom split keyboards, and it obtaining from the the battery status to display on a small LCD/OLED display. The Nordic nRF52-based keyboards I have are already capable of reporting that type of information over bluetooth, so is that an example of GATT in the wild? Is GATT what's currently enabling my Apple Magic Trackpad and Pixel Buds Pro to report their battery status over bluetooth, or will GATT be the next generation of that capability?
Found in the Bluetooth 5.4 spec:
Part G. Generic Attribute Profile (GATT): https://www.bluetooth.com/wp-content/uploads/Files/Specifica...
Part F. Attribute Protocol (ATT): https://www.bluetooth.com/wp-content/uploads/Files/Specifica...
https://git.tcrez.dev/tcrez/micropython/src/branch/main/temp...
https://www.adafruit.com/product/5544
it says:
"Bluetooth Low Energy - note this isn't supported in software yet, its just a hardware capability."
Yet this blog discusses BTStack so it must work at some level ... Can anyone clarify: if you want to use BLE on this device, is BTStack the only option or is this outdated info?
Related
A terminal-based Bluetooth manager for Linux
A terminal-based Bluetooth manager called "bluetuith" for Linux is available on GitHub. It offers various features like file transfer, pairing, device connection, power toggling, and media playback control.
Writing GUI applications on the Raspberry Pi without a desktop environment
This article explains writing GUI applications on a Raspberry Pi without a desktop environment. It covers interacting with the framebuffer, configuring resolutions, using low-level interfaces, Raylib library, and optimizing CPU usage.
A Mini Monitor for a Pi
The author shares a project using a 2-inch display as a Raspberry Pi monitor, creating a handheld console. Details include wiring, SPI communication, display mirroring for tasks like coding and web browsing, hardware setup, communication protocol, and a system service for seamless display experience.
Baking Pi – Operating Systems Development
Baking Pi is a tutorial course for ages 16+, teaching basic operating system development on Raspberry Pi. It includes practical exercises, requires specific hardware, and encourages community contributions via GitHub.
Google Pigweed SDK Now Supports Raspberry Pi RP2350 Microcontroller
Google's Pigweed SDK now supports the Raspberry Pi RP2350 microcontroller, enhancing embedded software development with open-source libraries, cross-platform support, and features like RPC communication and reusable modules.