ImNotAVirus

ImNotAVirus

Bluetooth PAN serving a Phoenix app

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-tools and bluez-utils packages
  • I’ve also activated the Bluetooth subsystem support in make linux-menuconfigNetworking 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.

Most Liked

outlog

outlog

think you need to comment out dtoverlay=pi3-miniuart-bt in config.txt

can’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

fhunleth

fhunleth

Co-author of Nerves

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 dmesg shows 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

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.

Last Post!

ImNotAVirus

ImNotAVirus

Small progress: I added a symbolic link from /var/lib/bluetooth to /tmp/bluetooth (via rootfs_overlay) but I still have the same error.

(bt-agent:363): GLib-CRITICAL **: 13:30:51.254: PCRE library is compiled without UTF8          
(bt-agent:363): GLib-CRITICAL **: 13:30:51.255: PCRE library is compiled without UTF8 properties support
bt-agent: bluez service is not found
Did you forget to run bluetoothd?

Now I don’t understand what the problem is since I don’t have any error anymore (neither from dmesg nor from bluetoothd).

Where Next?

Popular in Questions Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement