Go offline with the Player FM app!
Blue Heron: Bluetooth Low Energy (BLE) for Elixir & Nerves with Connor Rigby
Manage episode 487000256 series 2493466
Connor Rigby joins the Elixir Wizards to talk about Blue Heron BLE (Bluetooth Low Energy) support for Elixir apps. Blue Heron implements the BLE specs in pure Elixir, leveraging binary pattern matching and concurrent message processing to handle Bluetooth protocols. Unlike most solutions that require C ports or NIFs, Blue Heron runs entirely in user space, so it works seamlessly in both Nerves-based embedded projects and (eventually) desktop Elixir applications.
We discuss how Nerves development differs from building Phoenix apps. Connor shares challenges he's experienced with hardware compatibility, where some chips only partially implement the spec, and he discusses the surprisingly deep (but sometimes incomplete) world of BLE device profiles. His tip for anyone entering the BLE space: read the official spec instead of trusting secondhand blog posts. Tools like Nerves LiveBook give you hands-on examples, so you can get a BLE prototype running on a Raspberry Pi and your phone in no time.
Key topics discussed in this episode:
- Blue Heron origins and “bird” naming convention
- BLE vs. Bluetooth Classic: core differences
- Pure Elixir implementation—no C dependencies
- Binary pattern matching for packet parsing
- Hardware transport options: UART, SPI, USB, SDIO
- GenServer patterns in Nerves vs. Phoenix
- Linux requirement and power-consumption trade-offs
- GATT (Generic Attribute Table) implementation patterns
- SQLite integration for Nerves apps
- Hardware chip quirks and spec compliance
- Manufacturer-specific commands and workarounds
- BLE device profiles and spec gaps
- Security Management Profile (SMP) for encryption
- Device connection and pairing workflows
- Web vs. embedded development differences
- Where to get started: hardware recommendations and docs
Links mentioned:
https://github.com/ConnorRigby/
https://github.com/blue-heron/
https://nerves-project.org/
BLE (Bluetooth Low Energy) https://en.wikipedia.org/wiki/Bluetooth_Low_Energy
https://developer.apple.com/ibeacon/
https://learnyousomeerlang.com/building-otp-applications
Linux https://www.linux.org/
HCI (Host Controller Interface) https://en.wikipedia.org/wiki/Host_controller_interface
Circuits UART Library https://hexdocs.pm/circuits_uart/readme.html
SPI (Serial Peripheral Interface) https://github.com/elixir-circuits/circuits_spi
SDIO (Secure Digital Input Output https://en.wikipedia.org/wiki/SDIO
Raspberry Pi https://www.raspberrypi.com/
Coral SoM Dev Board https://coral.ai/products/dev-board/
BeagleBone Single-Board Linux Computer https://www.beagleboard.org/boards/beaglebone-black
https://www.bluetooth.com/bluetooth-resources/intro-to-bluetooth-gap-gatt/
Genservers https://hexdocs.pm/elixir/1.12/GenServer.html
https://hexdocs.pm/ecto/Ecto.html
https://github.com/elixir-sqlite/ecto_sqlite3
https://github.com/nerves-livebook/nerves_livebook
Special Guest: Connor Rigby.
192 episodes
Manage episode 487000256 series 2493466
Connor Rigby joins the Elixir Wizards to talk about Blue Heron BLE (Bluetooth Low Energy) support for Elixir apps. Blue Heron implements the BLE specs in pure Elixir, leveraging binary pattern matching and concurrent message processing to handle Bluetooth protocols. Unlike most solutions that require C ports or NIFs, Blue Heron runs entirely in user space, so it works seamlessly in both Nerves-based embedded projects and (eventually) desktop Elixir applications.
We discuss how Nerves development differs from building Phoenix apps. Connor shares challenges he's experienced with hardware compatibility, where some chips only partially implement the spec, and he discusses the surprisingly deep (but sometimes incomplete) world of BLE device profiles. His tip for anyone entering the BLE space: read the official spec instead of trusting secondhand blog posts. Tools like Nerves LiveBook give you hands-on examples, so you can get a BLE prototype running on a Raspberry Pi and your phone in no time.
Key topics discussed in this episode:
- Blue Heron origins and “bird” naming convention
- BLE vs. Bluetooth Classic: core differences
- Pure Elixir implementation—no C dependencies
- Binary pattern matching for packet parsing
- Hardware transport options: UART, SPI, USB, SDIO
- GenServer patterns in Nerves vs. Phoenix
- Linux requirement and power-consumption trade-offs
- GATT (Generic Attribute Table) implementation patterns
- SQLite integration for Nerves apps
- Hardware chip quirks and spec compliance
- Manufacturer-specific commands and workarounds
- BLE device profiles and spec gaps
- Security Management Profile (SMP) for encryption
- Device connection and pairing workflows
- Web vs. embedded development differences
- Where to get started: hardware recommendations and docs
Links mentioned:
https://github.com/ConnorRigby/
https://github.com/blue-heron/
https://nerves-project.org/
BLE (Bluetooth Low Energy) https://en.wikipedia.org/wiki/Bluetooth_Low_Energy
https://developer.apple.com/ibeacon/
https://learnyousomeerlang.com/building-otp-applications
Linux https://www.linux.org/
HCI (Host Controller Interface) https://en.wikipedia.org/wiki/Host_controller_interface
Circuits UART Library https://hexdocs.pm/circuits_uart/readme.html
SPI (Serial Peripheral Interface) https://github.com/elixir-circuits/circuits_spi
SDIO (Secure Digital Input Output https://en.wikipedia.org/wiki/SDIO
Raspberry Pi https://www.raspberrypi.com/
Coral SoM Dev Board https://coral.ai/products/dev-board/
BeagleBone Single-Board Linux Computer https://www.beagleboard.org/boards/beaglebone-black
https://www.bluetooth.com/bluetooth-resources/intro-to-bluetooth-gap-gatt/
Genservers https://hexdocs.pm/elixir/1.12/GenServer.html
https://hexdocs.pm/ecto/Ecto.html
https://github.com/elixir-sqlite/ecto_sqlite3
https://github.com/nerves-livebook/nerves_livebook
Special Guest: Connor Rigby.
192 episodes
All episodes
×Welcome to Player FM!
Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.