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

OvermindDL1
Been making an MLElixir thing (not released yet…) for fun in spare time in the past day. I’m just trying to see how much I can get an ML...
132 13487 106
New
wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
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
mcrumm
If you would like to migrate away from node/npm/webpack while still using sass, the dart_sass package provides a installer and runner for...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New
riverrun
I’ve just released version 3 of Comeonin, a password hashing library. The following small changes have been made: changes to the NIF c...
New
pkrawat1
Presenting Aviacommerce, open source e-commerce platform in Elixir Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
bryanjos
Hi, I wanted share a small library we at Revelry Labs made for rendering react components from the server side. There are instructions fo...
New

Other popular topics Top

TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
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
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
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Sub Categories:

We're in Beta

About us Mission Statement