fhunleth

fhunleth

Co-author of Nerves

BlueHeron - A new Bluetooth LE library

BlueHeron is a new Bluetooth LE (BLE) library that’s focused on communicating directly with Bluetooth modules on embedded devices like those running Nerves and on desktops and laptops. It uses the Bluetooth HCI protocol and currently supports USB Bluetooth dongles and UART-connected Bluetooth modules.

What can you do with Bluetooth LE? A lot!

We’re focused on using BLE to interact with Bluetooth-enabled devices, implement beacons, and let smartphones directly communicate with Nerves devices.

This is the beginning and the library supports a fraction of this. We do have quite a bit of the underlying infrastructure in place. Our current focus is controlling a Bluetooth light bulb since it’s inexpensive, widely available, and has a simple interface that’s representative of many Bluetooth devices.

The good news is that there is a lot of commonality in the code used to control the bulb and the other use cases. Please check out the GitHub repository for more information, the rationale for why we’re doing this, and for examples.

If there’s a particular use case that you’re interested in, we’d love your help. We chat in real-time on the #nerves-bluetooth channel on the Elixir slack.

In particular, we are very interested in examples and HCI traces of working setups to emulate.

The library doesn’t support all Bluetooth hardware yet. Please try to find ways of using the same hardware as us. While broad BT hardware support is possible and a goal, we’re focused on implementing BLE use cases on current working hardware. That means that if your Bluetooth module doesn’t work, we’re probably not going to be able to help much other than ask you to find your hardware vendor’s BT firmware .hcd file and debug from there.

We’ll be posting updates to this thread.

Hopefully a few of you can join us on this adventure.

Most Liked

fhunleth

fhunleth

Co-author of Nerves

I can’t help with the other parts, but I can help with 32-bit vs. 64-bit. If 32-bit is working for you, then don’t worry at all about 64-bit until the end. I think it will just work on nerves_system_rpi0_2 modulo any kernel option updates you find.

The only other hint I have is something I discussed with Connor a while back which didn’t seem to work out, but I don’t know why. Take this with a grain of salt since I don’t feel like I’m an expert on this. My understanding about Bluetooth support is that you almost always have to update the firmware on the module since it’s either old or missing. I think BlueHeron got lucky on some Raspberry Pi’s since the Bluetooth firmware was good enough and didn’t need an update. The BlueHeron backend that everyone uses connects directly to the modules via UART, so it’s responsible for the firmware updates. If BlueHeron had a backend that went through the Linux kernel’s HCI drivers then the kernel could do the firmware updates. At one time, I think the kernel was lacking in this area, but that seems like years ago and is hopefully totally solved by now. I don’t remember the Linux Bluetooth driver interface being well-documented so code spelunking was needed. Since the kernel’s HCI interface should be the same on devices, if I were doing this, I’d start with one of the Raspberry Pi’s with more interfaces (like a Pi 4 or 5), then I’d probably try Buildroot first and play around with strace and hciutil to see what happens and orient myself with where to look in code. If I had trouble there, I’d install Raspberry Pi OS and uninstall/disable bluez.

ConnorRigby

ConnorRigby

Nerves Core Team

Here are a few examples i’ve managed to create with this library so far. They are both available on the repo!

shahryarjb

shahryarjb

Hi, do you have a document to install it from scratch? I have Raspberry Pi 4 and need to work with Bluetooth.
I want to connect to OBD (which is a cable to connect Bluetooth) to get a car info.

Where Next?

Popular in Libraries Top

kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
seancribbs
Today I released a new dialyzer Mix task as the dialyzex package! At the time we started writing this task, the existing dialyzer integra...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
dbern
I’m excited to announce that TaxJar has developed and open-sourced DateTimeParser. We developed it because we found a need to parse user ...
New
woutdp
Hi! I wanted to introduce my latest project LiveSvelte. It allows you to render Svelte inside LiveView with end-to-end reactivity. It’s ...
New
New
mbuhot
EctoJob A transactional job queue built with Ecto, PostgreSQL and GenStage Available on Hex.pm: ecto_job | Hex Docs: API Reference — ec...
New
josevalim
Yes, yet another parser combinator library! Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
159 18262 141
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_or...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New

Sub Categories:

We're in Beta

About us Mission Statement