Giter Club home page Giter Club logo

nymea-networkmanager's Introduction

nymea-networkmanager

This daemon allows to set up the wireless network using a bluetooth LE connection. The daemon will automatically start a bluetooth low energy server if the system is currently not connected to any network. Once the system is connected, the daemon will shutdown the bluetooth server.

Configuration

nymea-networkmanager will search for a config file in the following location:

/etc/nymea/nymea-networkmanager.conf

If such a config file is found, it reads values from there. There is a example config in this repository and it will be installed to /etc/nymea-networkmanager.conf with the dpkg package.

Note: Command line parameters will have higher priority than entries in the configuration file.

Building from source

Dependencies

Qt

A Qt verion >= 5.7.0 is required in order to work and bluez version >= 5.48.

$ sudo apt update
$ sudo apt install qt5-default qtbase5-dev qtbase5-dev-tools libqt5bluetooth5 qtconnectivity5-dev 

libnymea-networkmanager-dev

The libnymea-networkmanager-dev package can be installed from the nymea dpkg repository or built and installed from source:

Repository: deb http://repository.nymea.io <distro> main Source: https://github.com/nymea/libnymea-networkmanager

libnymea-gpio-dev

The libnymea-gpio-dev package can be installed from the nymea dpkg repository or built and installed from source:

Repository: deb http://repository.nymea.io <distro> main Source: https://github.com/nymea/nymea-gpio

Building manually

Clone the source code and change into the source directory

$ git clone https://github.com/guh/nymea-networkmanager.git
$ cd nymea-networkmanager

Create the build directory

$ mkdir build
$ cd build

And finally build the daemon and library

$ qmake ..
$ make -j$(nproc)

You can run the daemon directly with following command

$ sudo ./nymea-networkmanager/nymea-networkmanager

Building the debian packages

In order to build a debian package you can do following:

$ sudo apt install debhelper dh-systemd

$ mkdir nymea-networkmanager
$ cd nymea-networkmanager
$ git clone https://github.com/guh/nymea-networkmanager.git
$ cd nymea-networkmanager
$ dpkg-buildpackage -us -uc -tc
$ cd ..

$ ls -l *.deb

Development

Bluetooth GATT profile


In order to connect to nymea-networkmanager using bluetooth low energy, once has to perform a bluetooth discovery, filter for all low energy devices and connect to the device with the name nymea. The remote address type for connecting to nymea-networkmanager is public.

Notifications

In order to enable/disable the notification for a characteristic with the notify flag, a client has to write the value 0x0100 for enabling and 0x0000 for disabling to the descriptor 0x2902 of the corresponding characteristic.

Services:

Overview

Name Service UUID Description
Generic Access 00001800-0000-1000-8000-00805f9b34fb The service contains generic information about the device
Generic Attribute 00001801-0000-1000-8000-00805f9b34fb Default service for Bluetooth LE GATT devices
Device information 0000180a-0000-1000-8000-00805f9b34fb The service contains information about the device and manufacturer
Wireless service e081fec0-f757-4449-b9c9-bfa83133f7fc The wifi service for managing the wireless network
Network service ef6d6610-b8af-49e0-9eca-ab343513641c The network service for managing the network

S = Service; C = Characteristic; D = Descriptor

W = Write; R = Read; N = Notify

S: Generic Access

Default service for Bluetooth LE GATT devices. More information can be found here.

S: Generic Attribute

Default service for Bluetooth LE GATT devices. More information can be found here.

S: Device Information

Default service for Bluetooth LE GATT devices. More information can be found here.

S: Wireless service e081fec0-f757-4449-b9c9-bfa83133f7fc

The Wireless Service allows a client to configure and monitor a wireless network connection. The connection can be controlled with the Wireless commander characteristic. Each command sent will generate a respone on the Comander response characteristic containing the error code for the command. The Wireless connection status characteristic informs the client about the current connection status of the wireless device.

Characteristic overview

Name Characterisitc UUID Flag Description
Wireless commander e081fec1-f757-4449-b9c9-bfa83133f7fc W Controll what the wifi manager should do.
Commander response e081fec2-f757-4449-b9c9-bfa83133f7fc N This characteristic will be used to inform about the command result (error reporting).
Wireless connection status e081fec3-f757-4449-b9c9-bfa83133f7fc RN Informs about the current wireless connection status.
Wireless mode e081fec4-f757-4449-b9c9-bfa83133f7fc RN Informs about the current mode of the wireless device.

Characteristic details

  • C: Wireless commander (W) e081fec1-f757-4449-b9c9-bfa83133f7fc

    • Description: Controll characteristic for the wireless manager. Each command sent to this characteristic will create a response report on the Commander response characterisitc.
    • Range: [0-20] Byte, UTF-8, JSON
    • Possible values:

In following example you can find the basic structure of a command and a response. The command can be sent to this Wireless commander characteristic, the response will be notified on the Commander response characteristic. The JSON object containing the command map has to be formated compact and must end with the '\n' character. If a data package is longer than the allowed 20 Bytes, the data must be splitted into 20 Byte packages and sent in the correct order. The end of a JSON data stream will be recongnized, once the '\n' character will be found at the end of a package. The Commander response characteristic uses the same mechanism.

  • Request

                {
                    "c": 0,           // Integer: Command: describing the method called
                    "p": { }          // The parameters of the method. If the method does not have any parameters you can skip this.
                }
    
  • Response

                {
                    "c": 0,               // Integer: Command: describing the method called
                    "r": 0,               // Integer: Response error code. See list of error codes.
                    "p": Object or Array  // Object or Array. This value is optional and depends on the requested command.
                }
    
  • List of response error code:

Value Name Description
0 Success The command has been executed successfully.
1 InvalidCommand The commander received an invalid command.
2 InvalidParameter The commander received an invalid parameter.
3 NetworkManagerNotAvailable Network manager is currently not available (network-manager daemon or dbus not running).
4 WirelessNotAvailable Wireless currently not available. There is no wireless adapter in the system.
5 NetworkingDisabled Networking is not enabled. One can enable it in the Network service.
6 WirelessDisabled Wireless networking is not enabled. One can enable it in the Network service.
7 Unknown An unknown error happend.
Methods
Value Name Description
0 GetNetworks Get the current wifi network list on the "Wireless data stream".
1 Connect Connect to the network with the given ssid and password in C e081fec4 and C e081fec5. If the network is open, set the password characteristic to an empty string.
2 ConnectHidden Connect to the hidden network using the given ssid and password in C e081fec4 and C e081fec5.
3 Disconnect Disconnect from current wireless network.
4 Scan Perform a wireless accesspoint scan.
5 GetConnection Get the current connection information on the "Wireless data stream"
6 StartAccessPoint Start a wireless access point.
- GetNetworks (0)
  • Request

                {
                    "c": 0            // Command: GetNetworks
                }
    
  • Response

                {
                    "c": 0,               // Integer: Command: describing the method called
                    "r": 0                // Integer: Response error code. See list of response error codes.
                    "p": [
                        {
                            "e": "My network",               // String: ESSID: the name of the wifi network
                            "m": "AA:BB:CC:DD:EE",           // String: The MAC address of the wifi access point
                            "s": 86,                         // Integer: Signal strength [0-100] %
                            "p": 0                           // Integer: Protected [0,1]; 0 - open, 1 - protected 
                        }
                   ]
                }
    
- Connect (1)
  • Request

                {
                    "c": 1,                    // Command: Connect
                    "p": {
                        "e": "Wifi SSID",      // The SSID of the wifi access point you want to connect to
                        "p": "Wifi password"   // The password of the access point you want to connect to
                    }
                }
    
  • Response

                {
                    "c": 1,               // Integer: Command: describing the method called
                    "r": 0                // Integer: Response error code. See list of response error codes.
                }
    
- ConnectHidden (2)
  • Request

                {
                    "c": 2,                    // Command: ConnectHidden
                    "p": {
                        "e": "Wifi SSID",      // The SSID of the wifi access point you want to connect to
                        "p": "Wifi password"   // The password of the access point you want to connect to
    
                    }
                }
    
  • Response

                {
                    "c": 2,               // Integer: Command: describing the method called
                    "r": 0                // Integer: Response error code. See list of response error codes.
                }
    
- Disconnect (3)
  • Request

                {
                    "c": 3            // Command: Disconnect
                }
    
  • Response

                {
                    "c": 3,               // Integer: Command: describing the method called
                    "r": 0                // Integer: Response error code. See list of response error codes.
                }
    
- Scan (4)
  • Request

                {
                    "c": 4            // Command: Scan
                }
    
  • Response

                {
                    "c": 4,               // Integer: Command: describing the method called
                    "r": 0                // Integer: Response error code. See list of response error codes.
                }
    
- GetConnection (5)
  • Request

                {
                    "c": 5            // Command: GetConnection
                }
    
  • Response

                {
                    "c": 5,               // Integer: Command: describing the method called
                    "r": 0                // Integer: Response error code. See list of response error codes.
                    "p": {
                        "e": "My network",               // String: ESSID: the name of the current wifi network
                        "m": "AA:BB:CC:DD:EE",           // String: The MAC address of the current wifi access point
                        "s": 86,                         // Integer: Signal strength [0-100] %
                        "p": 0,                          // Integer: Protected [0,1]; 0 - open, 1 - protected 
                        "i": "192.168.0.12"              // String: The IP address of the current wifi connection
                    }
                }
    
- StartAccessPoint (6)
  • Request

                {
                    "c": 6,                    // Command: StartAccessPoint
                    "p": {
                        "e": "Access Point SSID",               // The SSID of the wifi access point you want to create
                        "p": "Wireless access point password"   // The password of the access point you want to create
                    }
                }
    
  • Response

                {
                    "c": 6,               // Integer: Command: describing the method called
                    "r": 0                // Integer: Response error code. See list of response error codes.
                }
    
  • C: Commander response (N) e081fec2-f757-4449-b9c9-bfa83133f7fc

    • Description: Sends a JSON object in 20 Byte packages. The data stream is finished once the \n charater received at the end of a package.
    • Range: [0-20] Byte, UTF-8, JSON
    • Possible values: See "methods - response" for more details

    The JSON object containing the response map has to be formated compact and must end with the '\n' character. If a data package is longer than the allowed 20 Bytes, the data must be splitted into 20 Byte packages and sent in the correct order. The end of a JSON data stream will be recongnized, once the '\n' character will be found at the end of a package. The Commander characteristic uses the same mechanism.

  • C: Wireless connection status (RN) e081fec3-f757-4449-b9c9-bfa83133f7fc

    • Description: This characteristic represents the current state of the wireless adapter.
    • Range: 1 Byte, Hex value
    • Possible values:
Value Name Description
0x00 Unknown The device state is unknown.
0x01 Unmanaged The device is recognized, but not managed by NetworkManager.
0x02 Unavailable The device is managed by NetworkManager, but is not available for use (i.e. Wireless switched off, missing firmware).
0x03 Disconnected The device can be activated, but is currently idle and not connected to a network.
0x04 Prepare The device is preparing the connection to the network.
0x05 Config The device is connecting to the requested network (Associating with the WiFi accesspoint).
0x06 NeedAuth The device requires more information to continue connecting to the requested network.
0x07 IpConfig The device is requesting IPv4 and/or IPv6 addresses and routing information from the network.
0x08 IpCheck The device is checking whether further action is required for the requested network connection. This may include checking whether only local network access is available, whether a captive portal is blocking access to the Internet.
0x09 Secondaries The device is waiting for a secondary connection (like a VPN) which must activated before the device can be activated.
0x0A Activated The device has a network connection, either local or global.
0x0B Deactivating A disconnection from the current network connection was requested, and the device is cleaning up resources used for that connection. The network connection may still be valid.
0x0C Failed The device failed to connect to the requested network and is cleaning up the connection request.
  • C: Wireless mode (RN) e081fec4-f757-4449-b9c9-bfa83133f7fc

    • Description: This characteristic represents the current state of the wireless adapter.
    • Range: 1 Byte, Hex value
    • Possible values:
Value Name Description
0x00 Unknown The device mode is unknown.
0x01 Adhoc For both devices and access point objects, indicates the object is part of an Ad-Hoc 802.11 network without a central coordinating access point.
0x02 Infrastructure The device or access point is in infrastructure mode. For devices, this indicates the device is an 802.11 client/station.
0x03 AccessPoint The device is an access point/hotspot.

S: Network service ef6d6610-b8af-49e0-9eca-ab343513641c

This service allows to monitor and configure the network-manager daemon running on the system.

Characteristic overview

Name Characteristic UUID Flag Description
Network status ef6d6611-b8af-49e0-9eca-ab343513641c RN Represents the current network manager state.
Network commander ef6d6612-b8af-49e0-9eca-ab343513641c W Controll what the network manager should do.
Commander response ef6d6613-b8af-49e0-9eca-ab343513641c N This characteristic will be used to inform about the command result (error reporting).
Networking enabled ef6d6614-b8af-49e0-9eca-ab343513641c RN This characteristic indicates if the networking in the network-manager is enabled.
Wireless enabled ef6d6615-b8af-49e0-9eca-ab343513641c RN This characteristic indicates if the wireless networking in the network-manager is enabled.

Characteristic details

  • C: Network status (RN) ef6d6611-b8af-49e0-9eca-ab343513641c

    • Description: Represents the current network manager state.
    • Range: 1 Byte, Hex value
    • Possible values:
Value Name Description
0x00 Unknown The networking state is unknown.
0x01 Asleep Networking is not enabled.
0x02 Disconnected There is no active network connection.
0x03 Disconnecting Network connections are being cleaned up.
0x04 Connecting A network connection is being started.
0x05 Local There is only local IPv4 and/or IPv6 connectivity
0x06 ConnectedSite There is only site-wide IPv4 and/or IPv6 connectivity
0x07 ConnectedGlobal There is global IPv4 and/or IPv6 Internet connectivity
  • C: Network commander (W) ef6d6612-b8af-49e0-9eca-ab343513641c

    • Description: Controll what the network manager should do.
    • Range: 1 Byte, Hex value
    • Possible values:
Value Name Description
0x00 EnableNetworking Enable networking on the system.
0x01 DisableNetworking Disable networking on the system.
0x02 EnableWireless Enable wireless networking on the system.
0x03 DisableWireless Disable wireless networking on the system.
  • C: Commander response (N) ef6d6613-b8af-49e0-9eca-ab343513641c

    • Description: This characteristic will be used to inform about the command result (error reporting).
    • Range: 1 Byte, Hex value
    • Possible values:
Value Name Description
0x00 Success The command has been executed successfully.
0x01 InvalidValue The commander received an invalid command.
0x02 NetworkManagerNotAvailable Network manager is currently not available (network-manager daemon or dbus not running).
0x03 WirelessNotAvailable Wireless currently not available. There is no wireless adapter in the system.
0x04 Unknown An unknown error happend.
  • C: Networking enabled (RN) ef6d6614-b8af-49e0-9eca-ab343513641c

    • Description: This characteristic indicates if the networking in the network-manager is enabled.

    • Range: 1 Byte, Hex value

    • Possible values:

      • 0x00 : Disabled
      • 0x01 : Enabled
  • C: Wireless enabled (RN) ef6d6615-b8af-49e0-9eca-ab343513641c

    • Description: This characteristic indicates if the wireless networking in the network-manager is enabled.

    • Range: 1 Byte, Hex value

    • Possible values:

      • 0x00 : Disabled
      • 0x01 : Enabled

nymea-networkmanager's People

Contributors

brandonhilkert avatar mzanetti avatar nymea-jenkins avatar t-mon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nymea-networkmanager's Issues

Custom native app to interact with nymea

Hello !!

I'm searching for a way to setup the WiFi via BT on my raspberry pi home automation system (https://github.com/mylisabox) and find Nymea/berrylan (https://github.com/nymea/berrylan).

Look pretty interesting ! But I'm a bit lost ^^ so from what I understand I have to install nymea-networkmanager on my PI and that's basically it for server side.

I can't use berrylan because I already have my own mobile app and want it integrated to it, so my idea was to look how you did on native side of the app but it's all QT code lol which I don't know. So I tried to look at the BT protocole you have here but it is not clear to me too :(

So my main question is what are the minimal steps I have to do to talk with nymea in bluetooth. Because I only need to setup the WiFi if not already setup and that's it and look like nymea is doing more. Or is there any example of native iOS / Android interaction with nymea I could look

Problem on raspberry pi 3B stretch

Great Project thanks: I've followed the instructions but get the following error.

I | Application: =====================================
I | Application: Starting nymea-networkmanager "0.3.2"
I | Application: =====================================
I | Application: Advertising name: "BT WLAN setup"
I | Application: Platform name: "nymea-box"
I | Application: Mode: Core::Mode(ModeOffline)
I | Application: Timeout: 60
W | NymeaService: Invalid D-Bus HardwareManager interface.
W | NymeaService: Could not init nymea D-Bus services
W | NetworkManager: Invalid DBus network manager interface. NetworkManagre not available.
W | Application: Could not start network manager. Please make sure the networkmanager is available.
^C I | Application: Cought SIGINT quit signal...
I | Application: =====================================
I | Application: Shutting down nymea-networkmanager
I | Application: =====================================
I | Application: Shutting down nymea service
I | Application: Shutting down bluetooth service
I | Application: Shutting down network-manager service

NetworkManager start/stop bluetooth repeatedly on Raspbian 11 64bit on Pi 4

Hello, I've installed NetworkManager on Raspbian 11 lite 64bit and try to configure WiFi.

It works fine the first time I've tried to setup WiFi.
After setting up WiFi first time, I've update and installed all software I need on my distro.

I've installed theese softwares:

  • tmux
  • snapd
  • docker.io
  • zip
  • imagemagick
  • lightdm-autologin-greeter
  • lxde
  • scrot
  • unclutter

During LXDE installing process, my ssh stop working on 72%, while installing "connman", but when I've tried to re-connect, ssh worked fine.

I placed some scripts and containers for my project porpouse and see that all works fine.
After that, I delete my WiFi connection with nmcli to test NetworkManager again but it sto working and start logging this bluetooth issue.

journalctl return theese rows repeatedly

Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | NetworkManagerBluetoothServer: -------------------------------------
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | NetworkManagerBluetoothServer: Starting bluetooth server...
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | NetworkManagerBluetoothServer: -------------------------------------
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | NetworkManagerBluetoothServer: Local device "raspberrypi" "DC:A6:32:55:72:EA"
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  W | qt.bluetooth: Using BlueZ kernel ATT interface
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | NetworkManagerBluetoothServer: Create NetworkService.
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | NetworkManagerBluetoothServer: Create WirelessService.
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | NetworkManagerBluetoothServer: WirelessService: Using WirelessNetworkDevice("wlan0", "EA:93:B6:5D:98:E3", WirelessNetworkDevice::WirelessModeInfrastructure, 0 [Mb/s], "Net>
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  W | NetworkManagerBluetoothServer: Truncating local host name to "BT WLAN " (maximum length of 8 characters exceeded)
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | NetworkManagerBluetoothServer: Start advertising "BT WLAN setup" "DC:A6:32:55:72:EA"
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | NetworkManagerBluetoothServer: Controller state advertising...
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | NetworkManagerBluetoothServer: Set running true
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  W | qt.bluetooth.bluez: received advertising error
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  W | NetworkManagerBluetoothServer: Bluetooth error occured: QLowEnergyController::AdvertisingError "Error occurred trying to start advertising"
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | NetworkManagerBluetoothServer: Controller state disonnected.
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | NetworkManagerBluetoothServer: Set running false
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | Application: Bluetooth server started
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | Application: Bluetooth server stopped
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  W | NymeaService: Could not enable/disable bluetooth hardware resource. D-Bus interface not available.
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  I | Application: Start the bluetooth service because of "offline" mode.
Mar 29 14:59:02 raspberrypi nymea-networkmanager[1536]:  W | NymeaService: Could not enable/disable bluetooth hardware resource. D-Bus interface not available.

Network manager version: "nymea-networkmanager 0.5.9~bullseye+rpi1"

Any idea?
Thank you in advance for help
ronkpunk

Changing MAC address on each boot?

Why does the network manager change the Wifi MAC address on each boot?
My home network uses the MAC address to identify devices and allow access (and assign fixed IPs) and now I can't actually use that anymore. Is there a way to disable this behavior?

L2CAP write request incomplete: 0 of 23

Very weird problem! Generally Berrylan is working great, except for one user.

Fresh install, fresh boot. Getting this error:
L2CAP write request incomplete: 0 of 23

iPhone 12 max
iOS 14.0.
Hardware: amlogic s912 tv box running Armbian on 5.9 kernel

also tested with an iPhone 8, on iOS 13.6.1. same issue. But it totally works for other users :/

image

Service hangs/stop responding after connecting to network

Hi all!
Very often it happens that after successfully connecting to a wireless network, the nymea service does not receive its IP configuration and sits into a strange loop... (it says "no active accesspoint" but the wifi connection is up).
In this state the bluetooth device is not discoverable anymore, only thing to do is to restart nymea-networkmanager service.
Don't know what's happening here..I'm on Ubuntu Server 22.04 with Kernel 5.17 and onboard wifi+bluetooth chip.

Any ideas?
Below the journalctl with the service log...

image

But the device is connected to wifi as per:

image

image

Stuck on Setting up nymea-networkmanager (1.0.0+202203142203~buster+rpi1) ...

Hi I was updating Raspbian on a raspberry pi 3 and I got stuck on Setting up nymea-networkmanager (1.0.0+202203142203~buster+rpi1) ...
It doesn't matter what I do even if I execute sudo dpkg --force-depends --configure -a I get stuck on Setting up nymea-networkmanager (1.0.0+202203142203~buster+rpi1) ...

symbol lookup error: undefined symbol: _ZN15BluetoothServer14runningChangedERKb

Device: Raspberry Pi 3B+
OS: Raspbian Buster Lite

Upgraded raspberrypi-firmware, rpi-eeprom etc. as well as nymea-networkmanager with sudo apt dist-upgrade.
Now running nymea-networkmanager fails with:
nymea-networkmanager: symbol lookup error: nymea-networkmanager: undefined symbol: _ZN15BluetoothServer14runningChangedERKb

Reinstalling according to the instructions at http://www.berrylan.org/faq.html#5 didn't fix it.

nymea network on bananapi (ubuntu server)

Hi,

I'm big fan of this project and I have been used berrylan with raspberry zero (kali linux) with no errors. Now I trying to use in BananaPi M2 zero with UbuntuServer. I've got a message:

pi@bpi-iot-ros-ai:/home$ sudo nymea-networkmanager --mode always -d
nymea-networkmanager: /usr/lib/arm-linux-gnueabihf/libQt5DBus.so.5: version Qt_5' not found (required by nymea-networkmanager) nymea-networkmanager: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version Qt_5' not found (required by nymea-networkmanager)
nymea-networkmanager: /usr/lib/arm-linux-gnueabihf/libQt5DBus.so.5: version Qt_5' not found (required by /usr/lib/arm-linux-gnueabihf/libnymea-networkmanager.so.1) nymea-networkmanager: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version Qt_5' not found (required by /usr/lib/arm-linux-gnueabihf/libnymea-networkmanager.so.1)
nymea-networkmanager: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version `Qt_5' not found (required by /usr/lib/arm-linux-gnueabihf/libnymea-gpio.so.1)
pi@bpi-iot-ros-ai:/home$

If I try for another way like compile the project, th system return this message:
Project ERROR: nymea-networkmanager development package not found

Apparently is posible to run nymea-networkmanager in this hardware, but I don't know how the best way to fix these issue.

tks

Communicate via BT Browser API

After sending a cmd to RPi i got this warning in network manager and no response

W | NetworkManagerBluetoothServer: Got invalid json object "{c:0}\n"

My JS code:

button.addEventListener('pointerup', function(event) {
                navigator.bluetooth.requestDevice({
                  acceptAllDevices: true,
                  optionalServices: [
                      'ef6d6610-b8af-49e0-9eca-ab343513641c',
                      '00001801-0000-1000-8000-00805f9b34fb',
                      'e081fec0-f757-4449-b9c9-bfa83133f7fc',
                      '00001800-0000-1000-8000-00805f9b34fb',
                      '0000180a-0000-1000-8000-00805f9b34fb'
                  ]
                })
                .then(device => device.gatt.connect())
                .then(server => {
                  // Getting Battery Service…
                  return server.getPrimaryService('e081fec0-f757-4449-b9c9-bfa83133f7fc');
                })
                .then(service => {
                  // Getting Battery Level Characteristic…
                  return service.getCharacteristic('e081fec1-f757-4449-b9c9-bfa83133f7fc');
                })
                .then(characteristic => {
                   let encoder = new TextEncoder('utf-8');
                  return characteristic.writeValue(encoder.encode({'c': 0}+'\n'));
                })
                .then(value => {
                    console.log( new TextDecoder("utf-8").decode(value));
                })
                .catch(error => { console.error(error); });
            });

Do I something wrong? Have someone try to use Browser BT API to set WLAN on RPi?

nymea-networkmanager asking to pair

Hello, as i understand BLE is not supposed to ask user to pair. However with latest iOS 14.4.1 getting some odd BLE pair requests. After accepting pair the app does not seem to work

Is anyone else experiencing these pair requests?

Unable to start NetworkManagerBluetoothServer with newest Intel NUC devices

Network manager is unable to start its bluetooth server, I am seeing
Bluetooth error occured: QLowEnergyController::AdvertisingError "Error occurred trying to start advertising"

I have confirmed that bluetooth does indeed work on the 2 different NUC devices that I have using other methods. However, when installing the debian package and attempting to get the networkmanager to advertise, I am seeing that error over and over. The bluetooth device never shows up as advertising to my personal device.

Building everything from source and running directly also produces the same error.

Mar 23 16:43:15 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: Starting bluetooth server...
Mar 23 16:43:15 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: -------------------------------------
Mar 23 16:43:15 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: Local device "test" "34:7D:F6:90:52:67"
Mar 23 16:43:15 test nymea-networkmanager[7758]:  W | qt.bluetooth: Using BlueZ kernel ATT interface
Mar 23 16:43:15 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: Create NetworkService.
Mar 23 16:43:15 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: Create WirelessService.
Mar 23 16:43:15 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: WirelessService: Using WirelessNetworkDevice("wlp0s20f3", "34:7D:F6:90:52:63", WirelessNetworkDevice::WirelessModeInfrastructure, 0 [Mb/s], "NetworkDeviceStateDisconnected")
Mar 23 16:43:15 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: Start advertising "BT WLAN setup" "34:7D:F6:90:52:67"
Mar 23 16:43:15 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: Controller state advertising...
Mar 23 16:43:15 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: Set running true
Mar 23 16:43:15 test nymea-networkmanager[7758]:  I | Application: Bluetooth server started
Mar 23 16:43:16 test nymea-networkmanager[7758]:  W | qt.bluetooth.bluez: received advertising error
Mar 23 16:43:16 test nymea-networkmanager[7758]:  W | NetworkManagerBluetoothServer: Bluetooth error occured: QLowEnergyController::AdvertisingError "Error occurred trying to start advertising"
Mar 23 16:43:16 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: Controller state disonnected.
Mar 23 16:43:16 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: Set running false
Mar 23 16:43:16 test nymea-networkmanager[7758]:  I | Application: Bluetooth server stopped
Mar 23 16:43:16 test nymea-networkmanager[7758]:  I | Application: Restart the bluetooth service because of "always" mode.
Mar 23 16:43:18 test nymea-networkmanager[7758]:  W | NymeaService: Could not enable/disable bluetooth hardware resource. D-Bus interface not available.
Mar 23 16:43:18 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: -------------------------------------
Mar 23 16:43:18 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: Starting bluetooth server...
Mar 23 16:43:18 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: -------------------------------------
Mar 23 16:43:18 test nymea-networkmanager[7758]:  I | NetworkManagerBluetoothServer: Local device "test" "34:7D:F6:90:52:67"

I have tested on Ubuntu 18 and 20.04.1 LTS versions, along with NUC model numbers: NUC8BEH, NUC10FNK

Bluetooth logs are showing some command disallowed errors when attempting to advertise.

< HCI Command: LE Read Advertising Channel TX Power (0x08|0x0007) plen 0                                                                                 #715 [hci0] 353.221320
> HCI Event: Command Complete (0x0e) plen 5                                                                                                              #716 [hci0] 353.340028
      LE Read Advertising Channel TX Power (0x08|0x0007) ncmd 1
        Status: Command Disallowed (0x0c)
        TX power: 1 dbm (0x01)
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1                                                                                              #717 [hci0] 353.341877
        Advertising: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                              #718 [hci0] 353.343070
      LE Set Advertise Enable (0x08|0x000a) ncmd 1
        Status: Command Disallowed (0x0c)
< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15                                                                                       #719 [hci0] 353.344132
        Min advertising interval: 100.000 msec (0x00a0)
        Max advertising interval: 100.000 msec (0x00a0)
        Type: Connectable undirected - ADV_IND (0x00)
        Own address type: Public (0x00)
        Direct address type: Public (0x00)
        Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
        Channel map: 37, 38, 39 (0x07)
        Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                              #720 [hci0] 353.345047
      LE Set Advertising Parameters (0x08|0x0006) ncmd 1
        Status: Command Disallowed (0x0c)
@ RAW Open: nymea-networkma (privileged) version 2.22                                                                                                       {0x011f} 356.218829
@ Control Close: 0xffff                                                                                                                                     {0x011f} 356.218902
@ RAW Open: nymea-networkma (privileged) version 2.22                                                                                                {0x011f} [hci0] 356.218924

image (4)

I am not sure if this is some strange hardware bug crash or what additional steps I can take to continue troubleshooting.

I have bashed my head at this for over a month thinking it was somehow a configuration error or a bad device.

Any assistance would be much appreciated.

Repo problems

Trying to install nginx and other software in getting the following error from berrylan image.
pi@raspberrypi:~ $ sudo apt install lighttpd Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libfam0 libmariadb3 lighttpd-modules-ldap lighttpd-modules-mysql mariadb-common mysql-common spawn-fcgi Suggested packages: fam rrdtool php-cgi apache2-utils lighttpd-doc The following NEW packages will be installed: libfam0 libmariadb3 lighttpd lighttpd-modules-ldap lighttpd-modules-mysql mariadb-common mysql-common spawn-fcgi 0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded. Need to get 546 kB of archives. After this operation, 1,663 kB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://raspbian.mirror.constant.com/raspbian buster/main armhf libfam0 armhf 2.7.0-17.3 [24.6 kB] Get:2 http://raspbian.mirror.constant.com/raspbian buster/main armhf mysql-common all 5.8+1.0.5 [7,324 B] Get:3 http://raspbian.mirror.constant.com/raspbian buster/main armhf mariadb-common all 1:10.3.22-0+deb10u1 [31.9 kB] Get:4 http://raspbian.mirror.constant.com/raspbian buster/main armhf libmariadb3 armhf 1:10.3.22-0+deb10u1 [158 kB] Get:5 http://raspbian.mirror.constant.com/raspbian buster/main armhf lighttpd armhf 1.4.53-4 [292 kB] Get:6 http://raspbian.mirror.constant.com/raspbian buster/main armhf lighttpd-modules-ldap armhf 1.4.53-4 [8,832 B] Get:7 http://raspbian.mirror.constant.com/raspbian buster/main armhf lighttpd-modules-mysql armhf 1.4.53-4 [8,972 B] Get:8 http://raspbian-us.ngc292.space/raspbian buster/main armhf spawn-fcgi armhf 1.6.4-2 [13.9 kB] Err:8 http://raspbian-us.ngc292.space/raspbian buster/main armhf spawn-fcgi armhf 1.6.4-2 File has unexpected size (16384 != 13928). Mirror sync in progress? [IP: 198.211.116.210 443] Fetched 532 kB in 7s (80.8 kB/s) E: Failed to fetch https://113store.cr/es/ File has unexpected size (16384 != 13928). Mirror sync in progress? [IP: 198.211.116.210 443] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
I have done sudo apt update, upgrade and I'm still getting the same error.

Pi Zero Build not working

I have followed the build and deploy instructions of nymea for Pi Zero. But I am having trouble using Berry Lan on a Pi Zero.


I have done this using a fresh buster install on a Pi Zero

sudo apt install qt5-default qtbase5-dev qtbase5-dev-tools libqt5bluetooth5 qtconnectivity5-dev git

sudo apt install debhelper dh-systemd

git clone
libnymea-networkmanager
and nymea-gpio
and nymea-networkmanager

First I have built and installed libnymea-networkmanager

dpkg-buildpackage -us -uc -tc
sudo apt install ./libnymea-networkmanager_0.2.3_armhf.deb
sudo apt install ./libnymea-networkmanager-dev_0.2.3_armhf.deb

Then I have done the same for libnymea-gpio

And finally, I have built and installed
nymea-networkmanager_0.5.1_armhf.deb

I have also done -
sudo systemctl disable dhcpcd


After all that ... when I fire up Berry Lan, first time, I see the advertisement from Pi Zero, but moving on to the second screen, it keeps spinning without showing any networks. I restart Berry Lan, after that I don't even see the advertisement. I restart Pi Zero, any number of times ... no advertisement.

The same SD card when booting a Pi 3 works perfect with BerryLan.

This is reproducible on multiple Pi Zero and multiple Pi 3 cards.

Am I missing anything in the process?

I know about
nymea/berrylan#10
https://forum.nymea.io/t/berrylan-on-pi-zero-w/120
#25

But those instructions I thought only applies to when you are not building yourself.
BTW: I have sone similar build that worked fine on Pi Zero and Pi 3 for Stretch. I am having issues because I want to upgrade to Buster and to the latest nymea code.

Help appreciated!

Two wlan interfaces

I was wondering if there is a way to make it work with a second WLAN? since I'm using the native WLAN0 as a hotspot.
I have a Wlan1 via USB but when i open the app all I get is a spinning looking for SSID but not showing any network.

Build instructions?

Thank you for this interesting project. I am trying to test it out on an Nvidia TX2. Unfortunately, the pre-built library errors with version 'Qt_5' not found (even though it is finding the correct qt5 .so files). I'm guessing that the easiest solution is to rebuild nymea-networkmanager and link against my installed qt5 library.

How can I rebuild? Are there instructions somewhere (I read the docs but couldn't find it...).

Wireless networks duplicated

I have noticed some but not all wireless networks are being duplicated on the available networks screen. The issue can be recreated with berrylan app. When I check with other devices for wifi I can see there are no duplicate networks

This is installed on a rpi4.

I tried looking through the daemon.log but couldn't see that it saves any of the network information. Tried debug option also with no success to try help provide useful log.

Happy to share logs if you tell me which one is of good use to you.

Thank you

stopping nymea after network established and running secondary ble

Hello,

Thank you for the daemon, it is great!

I have a scenario where I need to run a secondary ble service after internet connectivity is established. ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 5; done;' I have noticed that when my broadcast starts it still uses nymea's characteristics. I have to disconnect + refresh several times + connect in order to see mine.

So we tried the following to check + stop nymea before starting ours

ExecStartPre=/bin/sh -c "until ping -c1 google.com; do sleep 5; done;if  systemctl list-units -all | grep -Fq 'nymea-networkmanager.service'; then echo 'Stoping nymea before starting jawsaver'; sudo systemctl stop nymea-networkmanager.service; else echo 'nymea not found'; fi"

Which seems to properly stop and broadcast the correct ble characteristics. However it prematurely stops nymea during the wifi setup (whenever there is no wlan set up).

Any suggestions to properly stopping nymea after setup and starting a second ble service?

if it makes a difference we are using the installation as noted on berrylan repo.

Switching to ethernet if available

The nymea-networkmanager requires that dhpcd is turned off, however it does not seem to handle connections with ethernet interfaces. In particular, acquiring an IP address works only sometimes, and even then there is a chance that the connection will be dropped off when the IP lease time has expired, without acquiring a new one.

Are there any plans to support ethernet interfaces?

Error on kali

Hi everybody,

I have dificults to run on kali linux.

When I run manually: nymea-networkmanager --mode always -d

I have:
I | Application: Networkmanager networking is now enabled
I | NetworkManager: Wireless networking enabled
I | Application: Networkmanager wireless networking is now enabled
I | NetworkManager: [+] NetworkDevice("lo" - "Generic", "NetworkDeviceStateUnmanaged")
I | NetworkManager: [+] WirelessNetworkDevice("wlan0", "B8:27:EB:D7:6B:1E", 0 [Mb/s], "NetworkDeviceStateUnmanaged")
I | NetworkManager: The network manager is now available
I | Application: Networkmanager is now available.
I | Application: Start the bluetooth service because of "always" mode.
I | Application: Start service
W | NymeaService: Could not enable/disable bluetooth hardware resource. D-Bus interface not available.
I | Application: Start bluetooth service
I | NetworkManager: Network manager initialized successfully.
I | Application: Start the bluetooth service because of "always" mode.
I | Application: Start service
W | NymeaService: Could not enable/disable bluetooth hardware resource. D-Bus interface not available.
I | Application: Start bluetooth service
I | BluetoothServer: -------------------------------------
I | BluetoothServer: Starting bluetooth server
I | BluetoothServer: -------------------------------------
I | BluetoothServer: Local device "kali" "B8:27:EB:28:94:E1"
W | qt.bluetooth: Using BlueZ kernel ATT interface
I | BluetoothServer: Create NetworkService.
I | BluetoothServer: NetworkService: Notify state changed "\x07"
I | BluetoothServer: NetworkService: Notify networking enabled changed: enabled
I | BluetoothServer: NetworkService: Notify wireless networking enabled changed: enabled
I | BluetoothServer: Create WirelessService.
I | BluetoothServer: Start advertising "Inove Media Meter" "B8:27:EB:28:94:E1"
I | BluetoothServer: Controller state advertising...
I | Application: Bluetooth server started

The first error is:
invalid D-BUS hardmanager interface.

how could I fix this?

Latest release for PI Zero / Build on pi zero

I followed the instructions described in :
nymea/berrylan#10

It seems the "rasbian" version of the repository only have the 0.3.2 version so i tried to build nyme-networkmanager from source myself on a PI zero but always get "Illegal instruction" at runtime.

Is there special build inscrtruction on pi zero ?

Raspberry Pi 3A+ issue

Installed on a Raspberry Pi 3A+. Attempted to use berrylan app to configure, but never saw the Pi show up. Swapped SD card into a Raspberry Pi Zero W and works fine. Must be some difference in HW. Thanks for the work on this. Hope it gets traction.

Update: Hooked up a keyboard and display and interactively logged in to the 3A+. Determined that the wlan0 device does not show up even under the latest, and standard raspian. Maybe I have a bad board...

Impossible to find the bluetooth device - Pi Zero

Hello, @mzanetti @nymea-jenkins

I tried many times but nothing works.
When I launch the Android App, it's always written "searching for your raspberry pi".
The network manager is in "offline" mode. And I see, it is activated when I turn on my Raspberry Pi Zero.

I would like to uninstall it properly and re-install it again. ( i hope it will solve the problem )
How can I do that ?

Thanks per advance,

Bluetooth stops advertising after 1 minute

While the bluetooth should advertise for 3 minutes, when no WiFi can't be made yet, it only does this for 1 minute and then stops advertising.
We are trying to configure multiple devices at once, but after configuring the first device, the second etc. can't be connected to anymore via bluetooth.
There is already a WiFi network configured on the device, but it can't connect to this network, could this be the cause?

issue installing berrylan on arm64

I tried following the berrylan install instructions on Raspberry Pi OS 64bit but ran into this issue

The following packages have unmet dependencies:
 nymea-networkmanager:armhf : Depends: libqt5network5:armhf but it is not going to be installed
                              Depends: libqt5bluetooth5:armhf but it is not going to be installed
                              Depends: network-manager:armhf but it is not going to be installed
                              Depends: libnymea-networkmanager:armhf but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Any suggestions? Thanks for making berrylan, it's been super useful!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.