I'm trying to make a Ble Mesh application using the bluez dbus api.
I have made a provisioner on a linux device and an unprovioned node on an other. When I have successfully provisioned my node with the provisioner, I need to send a message from the provisioner to the node.
For that I call the method void Send(object element_path, uint16 destination, uint16 key_index, dict options, array{byte} data) fom the org.bluez.mesh.Node1 but I got this error :
[org.bluez.mesh.Error.InvalidArgs] Key not found
So my question is : How can I get or generate the key_index value ?
Related
we are trying to set some telemetry environment on a Juniper VMX (virtual) router located on AWS.
We configured the router following the documentation, and tried to get some telemetry data from it via jtimon and Telegraf.
The gRPC connection is established and we do receive data, but not exactly what we want. Before continuing, I'm sharing the configuration that we use :
Router configuration (telemetry-related) :
system {
services {
extension-service {
request-response {
grpc {
clear-text {
port 32767;}
skip-authentication;
}
}
notification {
allow-clients {
address 0.0.0.0/0;
}
}
}
}
schema {
openconfig {
unhide;}
On Telegraf, we have these settings (for example) :
[[inputs.jti_openconfig_telemetry]]
servers = ["10.0.100.202:32767"]
sample_frequency = "10000ms"
sensors = [
"15000ms /junos/system/linecard/cpu/memory"
"2000ms /components"
]
collection_jitter = "0s"
flush_interval = "15s"
flush_jitter = "0s"
precision = ""
debug = true
quiet = false
Basically, our sensors gets created on the router, and we can see them with the show agent sensors command. What we cannot understand is that if we change the sensor in the configuration file of Telegraf, we will still receive the information of all previously subscribed sensors. To be clear : in the example, we subscribe to /junos/system/linecard/cpu/memory and /components. If I delete these lines, subscribe to /interfaces and run Telegraf, we will receive the information from the 3 sensors (/components, .../cpu/memory and /interfaces).
As we understand, this is due to an "ephemeral-configuration" called "junos-analytics", as written in the official documentation :
Starting in Junos OS Release 18.2R1, when an external streaming server, or collector, provisions sensors to export data through gRPC on devices running Junos OS, the sensor configuration is committed to the junos-analytics instance of the ephemeral configuration database, and the configuration can be viewed by using the show ephemeral-configuration instance junos-analytics operational command.
Thing is, we don't understand how to edit/disable/delete this "junos-analytics" instance. From what we see, some new sensors (sometimes with the exact same path) get created (with a different sensor ID / name) everytime we run Telegraf. We don't know how to delete them (we tried with a delete services analytics sensor *sensor_name* but it resulted in a "statement not found" error message...).
To sum up, we do receive our sensors' data, but it comes in the middle of lots and lots of other (useless) previously subscribed data.
I feel like we might be missing something in the router configuration, as Telegraf and jtimon show the same behaviour/results.
Any help is appreciated, I can of course share more information if needed ! Thanks in advance :)
Just in case someone is having the same problem : we contacted the Juniper support, they asked us to upgrade our Junos version (from 18.2 to 19.X) and that solves the problem !
I start my qt application in the user's .profile file (not root) to make the app start on boot. Sometimes when my application start, it reports an warning as below:
"No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/NetworkManager/ActiveConnection/1"
I searched on google but did not find a explanation.
It seems my app is still working fine, but I want to locate the problem.
The application is running on ubuntu and using Qt5.
Thanks in advance.
Edit
I tried to debug dbus based on Eligijus Pupeikis's help with running:
gdbus introspect --system \
--dest org.freedesktop.NetworkManager \
--object-path /org/freedesktop/NetworkManager/ActiveConnection
it returns:
node /org/freedesktop/NetworkManager/ActiveConnection {
node 0 {
};
};
So, this means there is no such object just as the error message said, right?
And also, this gns3 team member says this problem is about Qt and Ubuntu.
Does this mean I don't need to solve it? I not familiar with the relationship between dbus and qt.
Most likely there is no such object "/org/freedesktop/NetworkManager/ActiveConnection/1" and because of that it can't find 'org.freedesktop.DBus.Properties' interface.
From documentation org.freedesktop.NetworkManager.Connection.Active :
Objects that implement the Connection.Active interface represent an attempt to connect to a network using the details provided by a Connection object. The Connection.Active object tracks the life-cycle of the connection attempt and if successful indicates whether the connected network is the "default" or preferred network for access. NetworkManager has the concept of connections, which can be thought of as settings, a profile or a configuration that can be applied on a networking device. Such settings-connections are exposed as D-Bus object and the active-connection expresses this relationship between device and settings-connection. At any time a settings-connection can only be activated on one device and vice versa. However, during activation and deactivation multiple active-connections can reference the same device or settings-connection as they are waiting to be activated or to be deactivated.
You can't know that that ActiveConnection object with specifically index 1 exists so you need to check by reading ActiveConnections property from /org/freedesktop/NetworkManager object's org.freedesktop.NetworkManager interface.
To have better visualize and understand how it looks I suggest D-Bus debugger. If you are using Gnome check out D-Feet.
I am trying to create a QT based application that scan and connect WiFi networks. I am using this example as a reference code.
Is it possible to assign static IP for the WiFi connection using QNetworkConfiguration or any related class ?
How to authenticate the networks that are password protected ?
thanks in advance......
I have created a net work session using the below code set..
void BearerMonitor::createNewSessionFromQml(QString ssid)
{
QList<QNetworkConfiguration> allConfigurations = manager.allConfigurations();
while (!allConfigurations.isEmpty()) {
QNetworkConfiguration config = allConfigurations.takeFirst();
if(config.name()==ssid)
createSessionFor(config);
}
}
SessionWidget::SessionWidget(const QNetworkConfiguration &config, QObject *parent):QObject(parent)
{
session = new QNetworkSession(config, this);
session->open();
}
No you can't. At least not with just Qt APIs.
Please read this and in particular this. QNetworkConfiguration is just a facility to manage network configurations. Editing such configurations is demanded to native code / OS interactions. From the second link:
Note that the QNetworkConfiguration object only provides limited information about the configuration details themselves. It's main purpose is to act as a configuration identifier through which link layer connections can be created, destroyed and monitored.
Even the "start/stop network interfaces" claim is not entirely true since such a feature is available only in certain OSs (not the mobile ones). See the "Platform capabilities" section of the second link for more details about that.
The same reasoning applies to the password question. Once a network is registed in the OS with the corresponding password (because of native code or the user physically registering it) a new configuration is available to the NetworkConfigurationManager, granted that the list of configurations is updated via updateConfigurations(). The new configuration contains the password but you can't edit it from Qt APIs.
Native code is the only solution, as said. Still, Apple does not want you to mess up with WiFi programatically since private APIs for that cannot be used in iOS > 5.1 (the oldest version supported by Qt as for Qt 5.4).
By default, there are a default of 1,000 messages stored in the ring buffer on the server.
It doesn't make sense for me to send a lagging client 1,000 updates, but rather just the most recent update. In WCF I can do this by using volatile data.
I suppose I can emulate a volatile approach by reducing the buffer to "1", but not sure if this can be configured on a per hub basis, or ideally, on a per method basis.
Does it matter if I use hubs or persistent connections with this?
Even if you set the DefaultMessageBufferSize to 1, SignalR ensures each buffer will hold at least 32 messages.
The primary purpose of this minimum buffer size is to ensure that SignalR's long-polling transport works somewhat reliably. If the buffer size was actually 1, a client connected via long-polling would be very likely to miss messages between polls.
I understand that there are some applications where only the last message matters. Unfortantely, as of now, SignalR does not have a "volitile" messaging configuration. Setting the buffer size to 32 is about as good as it gets. At least the client shouldn't lag too far behind with that small of a buffer size.
You are correct in assuming that there are multiple buffers, but buffer sizes cannot be configured individually. SignalR creates one ring buffer per "signal". A "signal" can be a connection id, group name, user name, PersistentConnection name (for when you call Connection.Broadcast), and Hub name (for when you call Clients.All). If you use Clients.All inside of multiple methods in a single hub, all those calls will end up in a single buffer.
EDIT:
If you want to configure another SignalR endpoint with different settings inside of the same application you can do the following:
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Configuration;
using Owin;
// ...
public void Configuration(IAppBuilder app)
{
// The following will setup a SignalR endpoint at "/signalr"
// using settings from GlobalHost
app.MapSignalR();
var resolver = new DefaultDependencyResolver();
var configuration = resolver.Resolve<IConfigurationManager>();
configuration.DefaultMessageBufferSize = 32;
// By specifying or own dependency resolver, we tell the
// "/volatile" endpoint not to use settings from GlobalHost
app.MapSignalR("/volatile", new HubConfiguration
{
Resolver = resolver
});
}
// ...
I am working on the iBeacon technology and I can't find any answer to a particular point concerning the address type.
I found the documenation (bluetooth specification) explaining what are the address types but I can't seem to find how to chose between the two types (public and random).
Here is an example where I found it (it is a sniffed packet transmitted by an iBeacon on a Raspberry PI) :
http://i.stack.imgur.com/QF5gf.png
and http://i.stack.imgur.com/NHY6x.png (sorry I can't post images yet because of my reputation)
Let's try to ask questions and make it more specific :
Since a public address has to be valid, might it be that there is a command to generate a random one (yet correct in formatting the address) to assign it to the concerned device?
If the above is true : what would be the command? and how do you roll back (to the primary public address)?
Or is there a "switch" that allows to chose between the (valid) public address or to generate a random one?
Thank you.
Here's a command that looks pretty much like what you want. See here for details.
Set Static Address Command
==========================
Command Code: 0x002B
Controller Index: <controller id>
Command Parameters: Address (6 Octets)
Return Parameters:
This command allows for setting the static random address. It is
only supported on controllers with LE support. The static random
address is suppose to be valid for the lifetime of the
controller or at least until the next power cycle. To ensure
such behavior, setting of the address is limited to when the
controller is powered off.
The special BDADDR_ANY address (00:00:00:00:00:00) can be used
to disable the static address.
When a controller has a public address (which is required for
all dual-mode controllers), this address is not used. Only when
the controller information reports BDADDR_ANY (00:00:00:00:00:00),
it is required to configure a static address first.
If privacy mode is enabled and the controller is single mode
LE only without a public address, the static random address is
used as identity address.
This command generates a Command Complete event on success or a
Command Status event on failure.
Possible errors: Rejected
Not Supported
Invalid Parameters
Invalid Index
It looks to me like the privacy features of BlueZ are under current active development and may not be complete yet. See this commit from 2014/02/18. If you want to try this with the latest updates, you will have to compile BlueZ from source.