ImNotAVirus
For my first Nerves project, I would like to create a Phoenix application that would be available only via Bluetooth Personal Area Network (PAN).
I’ve never done this before, but from what I could understand it would be feasible.
During my researches, I came across this stackoverflow post explaining in detail how to setup a Bluetooth PAN on Raspbian.
So I tried to reproduce the steps for Nerves :
- First, I created a new system based on
nerves_system_rpi3 - On this system I installed
bluez-toolsandbluez-utilspackages - I’ve also activated the
Bluetooth subsystem supportinmake linux-menuconfig→Networking Support
Once the firmware burn on my SD card and the Raspberry started, I executed the following commands :
# Run D-Bus & Bluetoothd daemons
mkdir -p /var/run/dbus
/usr/bin/dbus-daemon --system
/usr/libexec/bluetooth/bluetoothd &
# Create PAN interface
ip link add pan0 type bridge
# Configure interface
ifconfig pan0 192.168.50.1 netmask 255.255.255.0 up
Until then, no problem.
But when I tried to execute bt-agent -c NoInputNoOutput or bt-network -s nap pan0, I got the following error:
bt-agent: bluez service is not found
Did you forget to run bluetoothd?
However, when I display the list of processes, I can see bluetoothd running.
I would like to know if anyone has ever had this problem or if anyone has ever succeeded in setting up a Bluetooth PAN.
Thanks in advance.
Trending in Questions
Other Trending Topics
Latest Nerves Threads
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
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #elixirconf-us
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 8- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
fhunleth
You’re following the steps that I’d take if I were doing this. As a sanity check, does this work on Raspbian? And I wonder if
dmesgshows any errors?Also, not that this is a bad thing, but this is an ambitious first project. I think that you’ll be the first person to get Bluetooth PANs working with Nerves, so I’m very curious to hear your progress.
ImNotAVirus
First of all, thank you for your answer.
I just tried this afternoon on Raspbian and I was able to setup a working PAN.
For
dmesg, there is no error.I like to have ambitious projects when I try out a technology. It allows me to really try to understand how it works, especially when I’m trying to do something and there is little documentation on the topic ^^
I will try again and I will update this post if I manage to get the NAP working on Nerves.
ImNotAVirus
Small progress: After several hours of debugging, it seems that the problem comes from
bluetoothd.When I run it on Raspbian with debug mode (
bluetoothd -nd) it finds my Bluetooth controller:but he doesn’t find it on Nerves:
So I tried to attach it manually by following the documentation on the Alpine website with
But I now have the following errors (
dmesg):outlog
think you need to comment out
dtoverlay=pi3-miniuart-btin config.txtcan’t really grasp it all - but believe that overlay moves BT to tttyS0 aka the mini-uart, so it’s not on ttyAMA0 - see https://github.com/raspberrypi/documentation/blob/master/configuration/uart.md
ImNotAVirus
Thanks! You were right! My controller is now properly detected.
Unfortunately, I always get the same errors when I run
bt-agent -c NoInputNoOutputandbt-network -s nap pan0:It seems that
bluetoothdwants to write to/var/lib/bluetoothbut it can’t (read-only partition):I’ll keep digging.
GregMefford
Great work figuring that out so far!
It’s been a while since I’ve done it, but I believe if you want to make that directory be writable, you can either configure the application to write to somewhere that is writable, mount a writable partition there, or use a symlink to redirect that directory to a place that is writable.
Advanced Configuration — nerves v1.14.3
I thought we used to have an example of doing that e.g. for making the
/etc/resolv.conffile and friends be writable, but I’m having trouble finding a link to that now. Maybe someone else knows what I’m talking about and/or can fill in the gap.ImNotAVirus
Thanks for your help!
I think I’ll create a symlink to
/tmp/bluetoothbecause I don’t think it’s necessary to make this folder persistent.Currently I don’t really understand how to do it and I would be happy to have some documentation on the subject or a code to study.
ImNotAVirus
Small progress: I added a symbolic link from
/var/lib/bluetoothto/tmp/bluetooth(viarootfs_overlay) but I still have the same error.Now I don’t understand what the problem is since I don’t have any error anymore (neither from
dmesgnor frombluetoothd).