Re: BLE interface to Network Manager for IOT



On Fri, 2016-05-13 at 11:23 -0700, John Boiles wrote:
There's a problem I deal with that I bet a lot of other people deal
with as well: getting headless machines (for me, usually Raspberry
Pi) to connect to a wifi network. Usually this involves connecting
the hardware to a wired connection, then configuring wifi over ssh.
This is a pain, especially if the device is somewhere that's hard to
get physical access to.

I've been thinking about creating a daemon that runs alongside
Network Manager that exposes an interface over BLE that can list and
configure wireless connections in network manager. Then, I could
create a simple mobile app that could remotely configure network
manager over BLE. This would allow for much easier wifi configuration
on headless devices. This could be especially useful now that the
Raspberry Pi 3 has both bluetooth and wifi built-in.

I'd be down to build the iOS app (free and oss) and potentially the
part of the daemon that communicates over BLE, but could use some
help building the part that interfaces with NM. At very least some
architecture guidance would be helpful. Anyone interested in working
on this project?


Hi John,


I don't know about BLE, but interfacing with NM works like this:


Your daemon would D-Bus with NM. All other clients (nm-applet to nmcli)
use the same interface.

https://developer.gnome.org/NetworkManager/unstable/index.html

D-Bus can be nicely implemented in most programming languages, so for
example for a Python daemon, it should be pretty comfortable.

NM core project also ships a glib-based client library that wraps the
D-Bus interface: libnm. libnm might be more comfortable to use from
python, via GObject introspection.
Downside is, that libnm only exists for NetworkManager >= 1.0

libnm is always available where NM is (so, it's not really an
additional dependency). 

I personally would start without using libnm. I think using plain D-Bus 
tends to work nicely. But others might disagree here.


There exists libnm-glib, which is a deprecated version of libnm. That
one supports versions < 1.0 as well, but should not be used anymore
because it doesn't get new features.




NetworkManager generally thinks in terms of "connections" (aka
profiles). You create and modify them. Then you "activate" them on a
device, meaning to apply the configuration to a networking interface.


See https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples


best,
Thomas

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]