# Bluetooth mangoH yellow launch

**URL:** <https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665>\
**Category:** mangOH Yellow\
**Created:** [November 18, 2020, 10:14am UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665 "2020-11-18T10:14:33Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![marckasse](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marckasse](https://mangoh.discourse.group/u/marckasse)\
**Post date:** [December 1, 2020, 10:46pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/21 "2020-12-01T22:46:23Z")

</div>

I downloaded the last firmware 0.6.0 but my version bluez is still 5.50 and not 5.52. Anyway, I am not sure it is the origin of my problem.

Concerning your previous message :“I looks like not all functions in bluetoothctl work on the yellow. The connect function is classic Bluetooth and it does not appear to work.” Do you mean it is normal that it doesn’t work but the BLE apps can work even if devices are not connected? Could you try to make a connect to one your device please and let me know if it works?

---

<div class="post-metadata">

**Author:** ![pinst](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pinst](https://mangoh.discourse.group/u/pinst)\
**Post date:** [December 2, 2020, 4:45pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/22 "2020-12-02T16:45:27Z")

</div>

BLE doesn’t connect the way Bluetooth Classic does, it’s a different protocol in many respects. So connect working (or not working) on one does not apply to the other. Using bluetoothctl I get different errors trying to connect from either side:

```auto
Ubuntu->mangOH
[bluetooth]# connect 3C:E1:A1:E8:B6:E1
Attempting to connect to 3C:E1:A1:E8:B6:E1
Failed to connect: org.bluez.Error.Failed
[bluetooth]# 

mangoh->Ubuntu
[bluetooth]# connect 5C:F3:70:98:69:EC
Device 5C:F3:70:98:69:EC not available
[bluetooth]# 

```

---

<div class="post-metadata">

**Author:** ![pinst](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pinst](https://mangoh.discourse.group/u/pinst)\
**Post date:** [December 2, 2020, 4:51pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/23 "2020-12-02T16:51:42Z")

</div>

Here is gatttool on Ubuntu connecting to my application on the mangOH yellow using BLE:

```auto
paul@paul-ThinkCentre-M72e:~$ sudo gatttool -b 3C:E1:A1:E8:B6:E1 -I
[3C:E1:A1:E8:B6:E1][LE]> connect
Attempting to connect to 3C:E1:A1:E8:B6:E1
Connection successful
[3C:E1:A1:E8:B6:E1][LE]> primary
attr handle: 0x0001, end grp handle: 0x0005 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0006, end grp handle: 0x000d uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x000e, end grp handle: 0x0013 uuid: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
[3C:E1:A1:E8:B6:E1][LE]> char-desc
handle: 0x0001, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0002, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0004, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
handle: 0x0006, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0007, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0008, uuid: 00002a05-0000-1000-8000-00805f9b34fb
handle: 0x0009, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x000a, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x000b, uuid: 00002b29-0000-1000-8000-00805f9b34fb
handle: 0x000c, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x000d, uuid: 00002b2a-0000-1000-8000-00805f9b34fb
handle: 0x000e, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x000f, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0010, uuid: 6e400003-b5a3-f393-e0a9-e50e24dcca9e
handle: 0x0011, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x0012, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0013, uuid: 6e400002-b5a3-f393-e0a9-e50e24dcca9e
[3C:E1:A1:E8:B6:E1][LE]> 

```

---

<div class="post-metadata">

**Author:** ![pinst](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pinst](https://mangoh.discourse.group/u/pinst)\
**Post date:** [December 2, 2020, 5:29pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/24 "2020-12-02T17:29:03Z")

</div>

btgatt-client connecting to same application:

```auto
paul@paul-ThinkCentre-M72e:~/bluez-5.50/tools$ ./btgatt-client -d 3C:E1:A1:E8:B6:E1
Connecting to device... Done
[GATT client]# Service Added - UUID: 00001800-0000-1000-8000-00805f9b34fb start: 0x0001 end: 0x0005
[GATT client]# Service Added - UUID: 00001801-0000-1000-8000-00805f9b34fb start: 0x0006 end: 0x000d
[GATT client]# Service Added - UUID: 6e400001-b5a3-f393-e0a9-e50e24dcca9e start: 0x000e end: 0x0013
[GATT client]# GATT discovery procedures complete
[GATT client]# 
service - start: 0x0001, end: 0x0005, type: primary, uuid: 00001800-0000-1000-8000-00805f9b34fb
	  charac - start: 0x0002, value: 0x0003, props: 0x02, ext_props: 0x0000, uuid: 00002a00-0000-1000-8000-00805f9b34fb
	  charac - start: 0x0004, value: 0x0005, props: 0x02, ext_props: 0x0000, uuid: 00002a01-0000-1000-8000-00805f9b34fb

service - start: 0x0006, end: 0x000d, type: primary, uuid: 00001801-0000-1000-8000-00805f9b34fb
	  charac - start: 0x0007, value: 0x0008, props: 0x20, ext_props: 0x0000, uuid: 00002a05-0000-1000-8000-00805f9b34fb
		  descr - handle: 0x0009, uuid: 00002902-0000-1000-8000-00805f9b34fb
	  charac - start: 0x000a, value: 0x000b, props: 0x0a, ext_props: 0x0000, uuid: 00002b29-0000-1000-8000-00805f9b34fb
	  charac - start: 0x000c, value: 0x000d, props: 0x02, ext_props: 0x0000, uuid: 00002b2a-0000-1000-8000-00805f9b34fb

service - start: 0x000e, end: 0x0013, type: primary, uuid: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
	  charac - start: 0x000f, value: 0x0010, props: 0x10, ext_props: 0x0000, uuid: 6e400003-b5a3-f393-e0a9-e50e24dcca9e
		  descr - handle: 0x0011, uuid: 00002902-0000-1000-8000-00805f9b34fb
	  charac - start: 0x0012, value: 0x0013, props: 0x08, ext_props: 0x0000, uuid: 6e400002-b5a3-f393-e0a9-e50e24dcca9e

[GATT client]# 

```

---

<div class="post-metadata">

**Author:** ![marckasse](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marckasse](https://mangoh.discourse.group/u/marckasse)\
**Post date:** [December 2, 2020, 5:35pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/25 "2020-12-02T17:35:12Z")

</div>

Well, thanks. I will try. Also, my application bluetoothServices is stopped and I cannot start it. I guess it is normal?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/2X/a/aeb3c6022e58a1b42113ff636fbb7faad36e91b2.png)

---

<div class="post-metadata">

**Author:** ![pinst](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pinst](https://mangoh.discourse.group/u/pinst)\
**Post date:** [December 2, 2020, 6:23pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/26 "2020-12-02T18:23:06Z")

</div>

gatttool connecting to bluetoothServices. I have found that sometimes it terminates due to a registration timeout but if you power cycle the mangOH it’s ok.

```auto
paul@paul-ThinkCentre-M72e:~/bluez-5.50/tools$ sudo gatttool -b 3C:E1:A1:E8:B6:E1 -I
[3C:E1:A1:E8:B6:E1][LE]> connect
Attempting to connect to 3C:E1:A1:E8:B6:E1
Connection successful
[3C:E1:A1:E8:B6:E1][LE]> primary
attr handle: 0x0001, end grp handle: 0x0005 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0006, end grp handle: 0x000d uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x000e, end grp handle: 0x0011 uuid: 0000180f-0000-1000-8000-00805f9b34fb
attr handle: 0x0012, end grp handle: 0x0014 uuid: 00001802-0000-1000-8000-00805f9b34fb
[3C:E1:A1:E8:B6:E1][LE]> char-desc
handle: 0x0001, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0002, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0004, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
handle: 0x0006, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0007, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0008, uuid: 00002a05-0000-1000-8000-00805f9b34fb
handle: 0x0009, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x000a, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x000b, uuid: 00002b29-0000-1000-8000-00805f9b34fb
handle: 0x000c, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x000d, uuid: 00002b2a-0000-1000-8000-00805f9b34fb
handle: 0x000e, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x000f, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0010, uuid: 00002a19-0000-1000-8000-00805f9b34fb
handle: 0x0011, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x0012, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0013, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0014, uuid: 00002a06-0000-1000-8000-00805f9b34fb
[3C:E1:A1:E8:B6:E1][LE]> 

```

---

<div class="post-metadata">

**Author:** ![marckasse](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marckasse](https://mangoh.discourse.group/u/marckasse)\
**Post date:** [December 3, 2020, 7:19pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/27 "2020-12-03T19:19:41Z")

</div>

Is it necessary to have the app BluetoothServices running to make bluetooth work or it is not related?

---

<div class="post-metadata">

**Author:** ![pinst](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pinst](https://mangoh.discourse.group/u/pinst)\
**Post date:** [December 3, 2020, 9:07pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/28 "2020-12-03T21:07:19Z")

</div>

BluetoothServices is a Legato application that implements a BLE server, i.e. peripheral. The name means that it implements certain BLE-defined services for a connected BLE client, i.e. host, as can be seen in the traces above. It does not provide anything to other applications on the mangOH. There is a bluetooth daemon which runs on Linux systems and supports all apps using Bluetooth but it’s not a Legato app itself.

---

<div class="post-metadata">

**Author:** ![marckasse](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marckasse](https://mangoh.discourse.group/u/marckasse)\
**Post date:** [December 8, 2020, 11:40pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/29 "2020-12-08T23:40:49Z")

</div>

> [@pinst](#):
>
> Nordic RF

I noticed this concerning the bluetoothServices app in the related README :

“Most of this code was originally written outside of the context of a Legato application, so the code is not formatted or named according to Legato style conventions.”

Does it mean that I cannot consider this app to help me develop on BLE?

---

<div class="post-metadata">

**Author:** ![pinst](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pinst](https://mangoh.discourse.group/u/pinst)\
**Post date:** [December 9, 2020, 1:39pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/30 "2020-12-09T13:39:32Z")

</div>

They are just talking about the C coding style. The interface to BlueZ though glib is correct and it works. I used bluetoothServices as a starting point for my transparent UART BLE application.

---

<div class="post-metadata">

**Author:** ![marckasse](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marckasse](https://mangoh.discourse.group/u/marckasse)\
**Post date:** [December 9, 2020, 1:57pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/31 "2020-12-09T13:57:45Z")

</div>

Isn’t it better to use bluetoothSensorTag app?

---

<div class="post-metadata">

**Author:** ![pinst](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pinst](https://mangoh.discourse.group/u/pinst)\
**Post date:** [December 9, 2020, 2:06pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/32 "2020-12-09T14:06:22Z")

</div>

Depends on what you are trying to do. My understanding is that bluetoothSensorTag is a BLE host (i.e. client) which communicates with a sensor tag device (i.e. server). bluetoothServices is a BLE device (i.e. server) which communicates with a host (i.e. client).

---

<div class="post-metadata">

**Author:** ![marckasse](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marckasse](https://mangoh.discourse.group/u/marckasse)\
**Post date:** [December 10, 2020, 9:30am UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/33 "2020-12-10T09:30:25Z")

</div>

Ok. It is quite similar indeed. There is only the notion of proxy in bluetoothSensorTag. I you don’t mind it could be interesting to see your app you developed.

---

<div class="post-metadata">

**Author:** ![pinst](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pinst](https://mangoh.discourse.group/u/pinst)\
**Post date:** [December 10, 2020, 5:38pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/34 "2020-12-10T17:38:49Z")

</div>

I cannot make our code public but I can tell you that the coding involved changing the service and characteristic definitions previously made within battery\_register\_services() in battery\_service.c . You can see the changes in the output of gatttool posted about.

---

<div class="post-metadata">

**Author:** ![marckasse](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marckasse](https://mangoh.discourse.group/u/marckasse)\
**Post date:** [December 11, 2020, 3:11pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/35 "2020-12-11T15:11:34Z")

</div>

Thanks for your reply. I am also wondering. Could we build app without D-Bus or is it highly adviced or mandatory with mangoh yellow?

---

<div class="post-metadata">

**Author:** ![marckasse](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marckasse](https://mangoh.discourse.group/u/marckasse)\
**Post date:** [December 11, 2020, 3:30pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/36 "2020-12-11T15:30:13Z")

</div>

Also, what value take these values (services\_om and num\_services\_registered)? It must come from somewhere to be injected in battery\_register\_services, right?

![image](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/2X/3/31720e9edbb58302981da66ae21e5428972577a4.png)

---

<div class="post-metadata">

**Author:** ![pinst](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pinst](https://mangoh.discourse.group/u/pinst)\
**Post date:** [December 14, 2020, 2:10pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/37 "2020-12-14T14:10:26Z")

</div>

It appears that you could use L2CAP sockets with BLE. It’s a low level interface that doesn’t use D-Bus. I have never tried it.

> **[Doing\_Bluetooth\_Low\_Energy\_on\_Linux.pdf](https://elinux.org/images/3/32/Doing_Bluetooth_Low_Energy_on_Linux.pdf)**
>
> 233.39 KB

battery\_register\_services() is found in battery\_service.c and is called from primary.c . It sets up the service and characteristics and you would modify these to support a different BLE service.

---

<div class="post-metadata">

**Author:** ![marckasse](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marckasse](https://mangoh.discourse.group/u/marckasse)\
**Post date:** [December 14, 2020, 3:19pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/38 "2020-12-14T15:19:39Z")

</div>

Thanks a lot!! That’s helping a lot! I don’t understand how are introduced ‘io\_AddNumericPushHandler’ or ’ dhubAdmin\_AddNumericPushHandler’. Is it coming from a library?

---

<div class="post-metadata">

**Author:** ![pinst](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pinst](https://mangoh.discourse.group/u/pinst)\
**Post date:** [December 14, 2020, 3:57pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/39 "2020-12-14T15:57:56Z")

</div>

These are Legato dhub routines that are defined in the api section of Component.cdef . They don’t have anything to do with Bluetooth itself, they are just used to periodically generate simulated  
battery level data.

---

<div class="post-metadata">

**Author:** ![marckasse](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marckasse](https://mangoh.discourse.group/u/marckasse)\
**Post date:** [December 15, 2020, 2:32pm UTC](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665/40 "2020-12-15T14:32:02Z")

</div>

My understanding is that datahub has nothing to do with Octave (cloud) right? In my project, I am not using Octave this is why

[Previous page](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665.md?page=1)

[Next page](https://mangoh.discourse.group/t/bluetooth-mangoh-yellow-launch/5665.md?page=3)
