TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Building a GATT Server on Pi Pico W

56 点作者 vha39 个月前

5 条评论

evanjrowley9 个月前
I&#x27;m trying to understand what GATT is.<p>From what I&#x27;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&#x2F;write capability and requirements for encryption, authentication, and authorization. Generic Attribute Profile (GATT) is a service discovery&#x2F;management framework built around ATT.<p>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.<p>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?<p>I&#x27;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&#x2F;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&#x27;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?<p>Found in the Bluetooth 5.4 spec:<p><i>Part G. Generic Attribute Profile (GATT)</i>: <a href="https:&#x2F;&#x2F;www.bluetooth.com&#x2F;wp-content&#x2F;uploads&#x2F;Files&#x2F;Specification&#x2F;HTML&#x2F;Core-54&#x2F;out&#x2F;en&#x2F;host&#x2F;generic-attribute-profile--gatt-.html" rel="nofollow">https:&#x2F;&#x2F;www.bluetooth.com&#x2F;wp-content&#x2F;uploads&#x2F;Files&#x2F;Specifica...</a><p><i>Part F. Attribute Protocol (ATT)</i>: <a href="https:&#x2F;&#x2F;www.bluetooth.com&#x2F;wp-content&#x2F;uploads&#x2F;Files&#x2F;Specification&#x2F;HTML&#x2F;Core-54&#x2F;out&#x2F;en&#x2F;host&#x2F;attribute-protocol--att-.html" rel="nofollow">https:&#x2F;&#x2F;www.bluetooth.com&#x2F;wp-content&#x2F;uploads&#x2F;Files&#x2F;Specifica...</a>
评论 #41270280 未加载
评论 #41270733 未加载
评论 #41269516 未加载
评论 #41271317 未加载
评论 #41270573 未加载
评论 #41271746 未加载
MuffinFlavored9 个月前
Equivalent in Rust: <a href="https:&#x2F;&#x2F;github.com&#x2F;embassy-rs&#x2F;embassy&#x2F;blob&#x2F;main&#x2F;examples&#x2F;rp&#x2F;src&#x2F;bin&#x2F;bluetooth.rs#L106">https:&#x2F;&#x2F;github.com&#x2F;embassy-rs&#x2F;embassy&#x2F;blob&#x2F;main&#x2F;examples&#x2F;rp&#x2F;...</a>
评论 #41269669 未加载
briandw9 个月前
GATT is great if you want to make yet another heart rate monitor. I was building a lock that worked over BTLE and I spent most of my time trying to get around the problems with GATT. It&#x27;s been 8 years now but I believe that that there was a bunch of extra overhead that bloated the packets and the packets were too small. Resulted in too much back and forth etc. I really just wanted a socket. iOS eventually allowed you to interact directly with the Logical Link Control and Adaptation Protocol aka L2CAP. Seems like every time someone try to design a generic structure that does one job but is also extendable, it&#x27;s a mess. Just give me the byte stream and move on. L2CAP doesn&#x27;t seem to be accessible on the pico yet, <a href="https:&#x2F;&#x2F;github.com&#x2F;micropython&#x2F;micropython-lib&#x2F;issues&#x2F;803">https:&#x2F;&#x2F;github.com&#x2F;micropython&#x2F;micropython-lib&#x2F;issues&#x2F;803</a>
trescenzi9 个月前
It’s not a full generic GATT server but I implemented a server for temperature sensors with MicroPython if anyone is curious what that looks like. I have it running on two picos to collect data across my house and then I push it to a MQTT server. Honestly would love feedback too because it’s pretty gross and error prone.<p><a href="https:&#x2F;&#x2F;git.tcrez.dev&#x2F;tcrez&#x2F;micropython&#x2F;src&#x2F;branch&#x2F;main&#x2F;temperature_ble_relay&#x2F;main.py" rel="nofollow">https:&#x2F;&#x2F;git.tcrez.dev&#x2F;tcrez&#x2F;micropython&#x2F;src&#x2F;branch&#x2F;main&#x2F;temp...</a>
clumsysmurf9 个月前
When I last look at the description of the Pi Pico W from adafruit<p><a href="https:&#x2F;&#x2F;www.adafruit.com&#x2F;product&#x2F;5544" rel="nofollow">https:&#x2F;&#x2F;www.adafruit.com&#x2F;product&#x2F;5544</a><p>it says:<p>&quot;Bluetooth Low Energy - note this isn&#x27;t supported in software yet, its just a hardware capability.&quot;<p>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?
评论 #41270894 未加载