fhunleth
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
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
https://twitter.com/pressy4pie/status/1304423648917245952?s=20
https://twitter.com/pressy4pie/status/1299085636108918784?s=20
Here are a few examples i’ve managed to create with this library so far. They are both available on the repo!
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.
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









