
Elixir Wizards is an interview-format podcast, focused on engineers who use the Elixir programming language. Initially launched in early 2019, each season focuses on a specific topic or topics, with each interview focusing on the guest's experience and opinions on the topic. Elixir Wizards is hosted by Eric Oestrich and Sundi Myint of SmartLogic, a dev shop that’s been building custom software since 2005 and running Elixir applications in production since 2015. Learn more about how SmartLogic uses Phoenix and Elixir. (https://smartlogic.io/phoenix-and-elixir?utm_source=podcast)
Blue Heron: Bluetooth Low Energy (BLE) for Elixir & Nerves with Connor Rigby
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.