I am very new to Bluez and I want to create some custom profile (GATT server) with one service and 2 Characteristics by using Bluez5.49 version.
I don't know how to start. I want to write this as a C application via Dbus. I don't want to use any command line operation for advertise.
I have doubt like if I advertise my device by using Dbus how I know whether I got scan request from Master (Central device). Which Dbus method is used to read the event of the BLE? How to proceed further?
Related
I'm trying to conect my PX4Flow sensor to a raspberry pi. It seems that nearly everybody is using qgroundcontrol to access and control it. But as I'd like to integrate it into some bigger program, I'd like to control it with some self-written simple python code, if possible.
My aim is to:
access the camera (to measure the speed - later)
get gyrometer values
I don't need the ultra sonic sensor.
I found out that I can use MAVlink for the communication between the px4flow sensor and the raspberry pi. I cloned the git repository and followed the steps on https://github.com/mavlink/mavlink until the generation of header file (python -m mavgenerate). With that, I can generate a new python file. I don't know if this is correct, and I don't know what to do with that python file. No more file (header files) are copied or generated. How do I go on? How do I use the library? How do I even test the connection?
If I understand you correctly, you want to make a module to communicate with PX4Flow.
I have some experience in building a ground control station with ardupilot. I think the procedure is roughly the same:
Generate the proper mavlink library, what you have done by using mavgenerate. Read some guidance of mavlink communication procedure.
Read the source code in PX4Flow communication module https://github.com/PX4/Flow/blob/master/src/modules/flow/communication.c, which shows what kind of messages have been sent to client side (e.g. your communication module)
Start write the module code to communicate with PX4Flow. You may need to start with HEARTBEAT msg first to establish connections between your module and PX4Flow. Note that you can always receive HEARTBEAT messages from PX4Flow. You can start with decoding these ones.
Implement your other functionalities.
You can read sources code of QGourndControl during step 3 and step 4. Make sure to find the right module in its repo.
My communication module is built using JavaScript https://github.com/kvenux/nodegcs, if it helps.
Is there any option in Kaa when device contacted the Kaa platform with some data, Is it able to send the same information to our external systems through message broker? For example when a temperature sensor updated the current temperature value to the Kaa, Is kaa able to send the same information to the Messaging brokers like ActiveMQ.
Maybe you can try the Kafka or Flume appender of Kaa.
I try to use the Kafka appender to send the data from some sensor to storm server like below reference and it works fine.
https://www.kaaproject.org/iot-real-time-data-processing-in-storm-using-kaa/
And you also can custom your appender by following below url:
https://kaaproject.github.io/kaa/docs/v0.10.0/Customization-guide/Log-appenders/
There are many possibilities to do that which are better or not depending on your particular use case.
But, usually the most efficient way would be to use one of the existing Log Appenders that are running on the Kaa server side and were specifically created for such messaging.
My description could be a little vague because I have not big experience in this field.
The problem is that my web service should do the following steps.
Another service send phone number in my web service
My web service takes that number and start calling into a particular queue in asterisk
After someone in this queue pickup call he\she should hear a recorded audio message
After that astersik should dial to the phone number from first step
Right now I can call to a local extension and then asterisk do the rest by calling to a client and connecting him with manager.
The first problem is that I don't know how to dial not to a local extension but to a queue in asterisk.
The second issue is how to play audio only when manager pick up call made from my web service.
Would be appreciate any help.
IF you use freepbx, you should put message in Call Confirm Announce
If you use custom dialplan, you should use M option for dial command and create macro which will play needed file.
For dial queue in freepbx you have use queue_num#from-internal. No way give any suggestion for custom dialplan
Note: doing system like that without understanding asterisk internal can result hi bills for international calls becuase of hackers.
With the last release of BlueZ (5.30) the highlight was the completion of the GATT D-Bus apis. My goal is to programmatically (in C), as a BLE client:
scan for ble devices (which I can do with the hci layer)
Connect to an advertising BLE device
Get the UUIDs
Execute Read and Write to handles
The BlueZ community is strongly suggesting to use the GATT-Dbus api to accomplish this. After multiple searches and head scratching I was not successful to find a proper way or example that would perform this through GATT-DBUs api. It seems more complicate than just use directly the GATT layer. Unfortunately BlueZ removed direct access to make calls to gatt.
I'm very close to just pull the GATT source files out from Bluez, compile it as it's own independent library and directly use the GATT layer and calls to connect and execute reads/writes to ble device server. I know it is not the suggested way compared to the DBUS-GATT api but I'm out of options.
If anybody has any input on this or suggestion (with some sample code) please advise.
thank you in advance!
The best way to start with DBUS GATT API is to hace a look at the source code here: http://git.kernel.org/cgit/bluetooth/bluez.git/tree/
Under client folder you can find a full sample of how to use the DBUS GATT API. Actually that is the source of bluetoothctl tool.
Note that DBUS GATT API is still experimental but you can enable it running bluetoothd service with -E flag.
I had a similar issue which is to interact with a BLE device with a GATT C/C++ API.
In my case I had to use Bluez v4.101 - the latest Bluez version available in Ubuntu 14.04 LTS (read my story). In Bluez v4.x, there is no DBus API.
And actually, I have recently worked with Bluez v5 DBus API and I discovered if you do not use at least Bluez v5.39 (from April 2016) it is likely you will have issue with the DBus API. And as said before the DBus API is still experimental.
So to solve my Bluez v4.x dependency I had to pull the GATT source files out from Bluez and create my own library 'gattlib'. The project is Open-Source to encourage feedback and contribution.
I am using this library in my own GATT client project.
I wrote few examples to help people to start using it see the folder /examples of the project.
EDIT March 2017: I have just added DBus support to gattlib (https://github.com/labapart/gattlib/). From Bluez v5.42, gattlib automatically uses DBus API (DBus gattlib backend can also be forced when building the library to use it before v5.42).
I was wondering if it was possible to be able to control/get the system volume, get network information (i.e is it a wired or wireless connection, name of network, etc.) and get battery information with VB.Net using Mono on Ubuntu 12.10? Thanks.
You can use the System.Diagnostics.Process class to call out to the shell and invoke the commands / get the information you require. There is an example here.