Date   

Re: Zephyr way of handling large data transfer over BLE

dhguja@gmail.com
 

Hello Carles,
            Many thanks for the information. Is this information is applicable to GATT indicate, write, read too?

Regards,
Dhananjay GJ

On Thu, Dec 28, 2017 at 2:50 PM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

Provided the peer does not initiate a GATT MTU Exchange, which would be handled automatically by the Zephyr BLE stack, you can simply call bt_gatt_notify() in a loop and from a thread while modifying the contents of the attribute in each iteration. When GATT runs out of buffers the the bt_gatt_notify() call will block until more are available, so you do not need to wait for an event like when using the SoftDevice.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@lists.zephyrproject.org [mailto:zephyr-users-bounces@lists.zephyrproject.org] On Behalf Of dhananjay gj
Sent: 28 December 2017 13:45
To: zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-users] Zephyr way of handling large data transfer over BLE

 

Hello All,

          I have a question related to the one i asked last week. (https://lists.zephyrproject.org/pipermail/zephyr-users/2017-December/000915.html). But i will rephrase it and be more generic to what i am looking for now because that question was already answered and solution works too.

I have an Android client (BLE central) and zephyr OS based BLE device as peripheral (nRF device) transfer data over a custom profile. I am aware that in BLE we can transfer only 20 bytes at a time. And also there are possibilities to extend the data packet size or increase the ATT_MTU size based on negotiation. But for compatibility purposes, I will avoid using these techniques. I am also not using BLE mesh or nordic softdevice SDK.

In that case, what is the zephyr way of handling large data transfer over BLE.? Do we need to handle segmentation and reassembly in the application layer by our selves only ? or any callback events possible in case buffer is full during multi packet transmission so that we can handle this?.

 

I am searching if there is any solution similar to the accepted answer in this thread for nordic SDK: https://devzone.nordicsemi.com/question/1741/dealing-large-data-packets-through-ble/)

 

Any example or leads to this using zephyr is much appreciated. Thanks in advance.

 

Regards,

Dhananjay GJ



Re: Zephyr way of handling large data transfer over BLE

Carles Cufi
 

Hi there,

 

Provided the peer does not initiate a GATT MTU Exchange, which would be handled automatically by the Zephyr BLE stack, you can simply call bt_gatt_notify() in a loop and from a thread while modifying the contents of the attribute in each iteration. When GATT runs out of buffers the the bt_gatt_notify() call will block until more are available, so you do not need to wait for an event like when using the SoftDevice.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of dhananjay gj
Sent: 28 December 2017 13:45
To: zephyr-users@...
Subject: [Zephyr-users] Zephyr way of handling large data transfer over BLE

 

Hello All,

          I have a question related to the one i asked last week. (https://lists.zephyrproject.org/pipermail/zephyr-users/2017-December/000915.html). But i will rephrase it and be more generic to what i am looking for now because that question was already answered and solution works too.

I have an Android client (BLE central) and zephyr OS based BLE device as peripheral (nRF device) transfer data over a custom profile. I am aware that in BLE we can transfer only 20 bytes at a time. And also there are possibilities to extend the data packet size or increase the ATT_MTU size based on negotiation. But for compatibility purposes, I will avoid using these techniques. I am also not using BLE mesh or nordic softdevice SDK.

In that case, what is the zephyr way of handling large data transfer over BLE.? Do we need to handle segmentation and reassembly in the application layer by our selves only ? or any callback events possible in case buffer is full during multi packet transmission so that we can handle this?.

 

I am searching if there is any solution similar to the accepted answer in this thread for nordic SDK: https://devzone.nordicsemi.com/question/1741/dealing-large-data-packets-through-ble/)

 

Any example or leads to this using zephyr is much appreciated. Thanks in advance.

 

Regards,

Dhananjay GJ


Re: Working with mesh shell

Johan Hedberg
 

Hi Ashish,

On Thu, Dec 28, 2017, ashish.shukla@corvi.com wrote:
I understand basics on configuration model. However, I'm trying to add app
key, it results in following error

unable to send App Key add (error -11).

I face same issue trying to add net key. For your reference, I'm attaching
snapshot of mesh shell
The first thing the shell prints is that it asks you to run "init"
before any other command. Since you haven't done that the "provision"
command doesn't do anything, and then you get EAGAIN (errno 11) when you
try to send a message, which is the error that the mesh stack returns
when you're not provisioned and try to send messages.

Johan


Re: [Zephyr-devel] Working with mesh shell

Vikrant More <vikrant8051@...>
 

Hi to all,

Need proper sequence of all commands to start working with #mesh_shell [ to activate Model 1000 (which subscribe to 0xC000) as well as 1001 (which publish to 0xC000) ]

#meshctl take care of netKey & appKey in background. is #mesh_shell does same thing
Or I have to add those key manually ?


Currently getting following log  -->

mesh> shell> Initializing...
[bt] [INF] hci_vs_init: HW Platform: Nordic Semiconductor (0x0002)
[bt] [INF] hci_vs_init: HW Variant: nRF52x (0x0002)
[bt] [INF] hci_vs_init: Firmware: Standard Bluetooth controller (0x00) Version 1.10 Build 99
[bt] [INF] show_dev_info: Identity: e2:da:a3:e1:e1:c6 (random)
[bt] [INF] show_dev_info: HCI: version 5.0 (0x09) revision 0x0000, manufacturer 0xffff
[bt] [INF] show_dev_info: LMP: version 5.0 (0x09) subver 0xffff
Bluetooth initialized[bt] [INF] bt_mesh_prov_init: Device UUID: 00000000-0000-0000-0000-e2daa3e1e1c6
Mesh initialized
mesh> provision 1 1
[bt] [INF] bt_mesh_provision: Primary Element: 0x0001
[bt] [DBG] bt_mesh_provision: (0x20000260) net_idx 0x0001 flags 0x00 iv_index 0x0000
mesh> dst 1
Destination address set to 0x0001
mesh> mod-app-bind 1 1 1000
Unable to send Model App Bind (err -11)
mesh>








On Thu, Dec 28, 2017 at 2:16 PM, ashish.shukla@... <ashish.shukla@...> wrote:
Hi Johan,
I understand basics on configuration model. However, I'm trying to add app key, it results in following error

unable to send App Key add (error -11).

I face same issue trying to add net key. For your reference, I'm attaching snapshot of mesh shell  


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Thu, Dec 28, 2017 at 1:54 PM, Johan Hedberg <johan.hedberg@...> wrote:
Hi Ashish,

On Thu, Dec 28, 2017, ashish.shukla@... wrote:
> I'm trying to provision a local node only.

Are there any specific commands you're wondering about? You can get the
full list of them by typing "help". You'd e.g. start with provisioning
by typing "provision <network index> <unicast address>". The shell does
require basic knowledge of the configuration model, so I hope you can
explore the available commands and by experimenting get something
working. Each configuration model related shell command maps directly to
a configuration model message, so you'll need to look at the respective
specification section for each command for the details of its
parameters, etc.

Johan


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel



Zephyr way of handling large data transfer over BLE

dhguja@gmail.com
 

Hello All,
          I have a question related to the one i asked last week. (https://lists.zephyrproject.org/pipermail/zephyr-users/2017-December/000915.html). But i will rephrase it and be more generic to what i am looking for now because that question was already answered and solution works too.

I have an Android client (BLE central) and zephyr OS based BLE device as peripheral (nRF device) transfer data over a custom profile. I am aware that in BLE we can transfer only 20 bytes at a time. And also there are possibilities to extend the data packet size or increase the ATT_MTU size based on negotiation. But for compatibility purposes, I will avoid using these techniques. I am also not using BLE mesh or nordic softdevice SDK.

In that case, what is the zephyr way of handling large data transfer over BLE.? Do we need to handle segmentation and reassembly in the application layer by our selves only ? or any callback events possible in case buffer is full during multi packet transmission so that we can handle this?.

I am searching if there is any solution similar to the accepted answer in this thread for nordic SDK: https://devzone.nordicsemi.com/question/1741/dealing-large-data-packets-through-ble/)

Any example or leads to this using zephyr is much appreciated. Thanks in advance.

Regards,
Dhananjay GJ


Re: Working with mesh shell

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi Johan,
I understand basics on configuration model. However, I'm trying to add app key, it results in following error

unable to send App Key add (error -11).

I face same issue trying to add net key. For your reference, I'm attaching snapshot of mesh shell  


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Thu, Dec 28, 2017 at 1:54 PM, Johan Hedberg <johan.hedberg@...> wrote:
Hi Ashish,

On Thu, Dec 28, 2017, ashish.shukla@... wrote:
> I'm trying to provision a local node only.

Are there any specific commands you're wondering about? You can get the
full list of them by typing "help". You'd e.g. start with provisioning
by typing "provision <network index> <unicast address>". The shell does
require basic knowledge of the configuration model, so I hope you can
explore the available commands and by experimenting get something
working. Each configuration model related shell command maps directly to
a configuration model message, so you'll need to look at the respective
specification section for each command for the details of its
parameters, etc.

Johan


Re: Working with mesh shell

Johan Hedberg
 

Hi Ashish,

On Thu, Dec 28, 2017, ashish.shukla@corvi.com wrote:
I'm trying to provision a local node only.
Are there any specific commands you're wondering about? You can get the
full list of them by typing "help". You'd e.g. start with provisioning
by typing "provision <network index> <unicast address>". The shell does
require basic knowledge of the configuration model, so I hope you can
explore the available commands and by experimenting get something
working. Each configuration model related shell command maps directly to
a configuration model message, so you'll need to look at the respective
specification section for each command for the details of its
parameters, etc.

Johan


Re: Working with mesh shell

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi Johan, 

I'm trying to provision a local node only. 

On 28-Dec-2017 1:37 PM, "Johan Hedberg" <johan.hedberg@...> wrote:
Hi Ashish,

On Thu, Dec 28, 2017, ashish.shukla@... wrote:
> can you please list out set of commands in order to provision and configure
> a simple onoff server?
>
> Though it is straight forward, I do not know how deal with OOB feature,
> which is disabled in my case. Without handling OOB, provision command
> doesn't work.

Zephyr does not yet have provisioner support. You can only provision the
local node throught the mesh shell at the moment (since that does not
involve running the full provisioning protocol).

Johan


Re: Working with mesh shell

Johan Hedberg
 

Hi Ashish,

On Thu, Dec 28, 2017, ashish.shukla@corvi.com wrote:
can you please list out set of commands in order to provision and configure
a simple onoff server?

Though it is straight forward, I do not know how deal with OOB feature,
which is disabled in my case. Without handling OOB, provision command
doesn't work.
Zephyr does not yet have provisioner support. You can only provision the
local node throught the mesh shell at the moment (since that does not
involve running the full provisioning protocol).

Johan


Working with mesh shell

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi,

can you please list out set of commands in order to provision and configure a simple onoff server?

Though it is straight forward, I do not know how deal with OOB feature, which is disabled in my case. Without handling OOB, provision command doesn't work. 

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


Re: Subscribing to heartbeat messages in a mesh network

Johan Hedberg
 

Hi Ashish,

On Thu, Dec 28, 2017, ashish.shukla@corvi.com wrote:
I'm almost there with mesh shell. Only a small issue, after disabling all
DEBUG messages, I still see adv stack and Kernal Stacks on terminal, which
makes it difficult work with shell. How to stop seeing these messages while
keeping mesh shell and printk enabled?
CONFIG_INIT_STACKS=n

Johan


Re: Subscribing to heartbeat messages in a mesh network

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi,
Thanks for your concern Steve, I'll write the code for it. Have a good time on vacation!!!

Hi Johan,
I'm almost there with mesh shell. Only a small issue, after disabling all DEBUG messages, I still see adv stack and Kernal Stacks on terminal, which makes it difficult work with shell. How to stop seeing these messages while keeping mesh shell and printk enabled?
 


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Wed, Dec 27, 2017 at 7:15 PM, Steve Brown <sbrown@...> wrote:

Hi Ashish 

On Dec 27, 2017, at 12:19 AM, "ashish.shukla@..." <ashish.shukla@...> wrote:

Hi,

Thanks Steve, it works as expected.

I watched a video on youtube by Johan, in which he demonstrates working of heartbeat messages. Which means he's developed some means to subscribe to Heartbeat messages as well. Is there some other way if I want to subscribe to heartbeat messages except meshctl?


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Tue, Dec 26, 2017 at 5:58 PM, Steve Brown <sbrown@...> wrote:
Hi Ashish,

On Tue, 2017-12-26 at 17:47 +0530, ashish.shukla@... wrote:
> Hello everyone !!
>
> I'm trying to work with heartbeat messages. I'm using android app by
> silicon Labs for provisioning and configuring so I can't subscribe
> and publish heartbeat messages using this app.
>
> On the other hand, there is command for publishing heartbeat messages
> in meshctl, so I'm able to publish heartbeat messages. but, there
> isn't any command to subscribe for heartbeat messages.
>
> I understand that this needs to done using configuration client,still
> I want to know if there is a way to subscribe just for testing
> purposes?
>
> Can I use these lines of code I found at /mesh_demo/src.c  in my
> main.c file, hard coding the addresses
>
>
>         struct bt_mesh_cfg_hb_sub sub = {
>             .src = PUBLISHER_ADDR,
>             .dst = GROUP_ADDR,
>             .period = 0x10,
>         };
>
>         bt_mesh_cfg_hb_sub_set(net_idx, addr, &sub, NULL);
>
> though adding these lines gives compilation error in my code.
>
> --
> Warm regards,
> Ashish Shukla
> Jr. Embedded Engineer
> Research & Development
> www.corvi.com
>
>
If the target of heartbeat publish is 0077 (meshctl's unicast address),
it will display the returned status.

Steve

There isn’t a heartbeat subscribe command in meshctl. It wouldn’t be hard to add. Take a look at the code and add it. I’m on vacation for a couple of weeks
Steve


Re: Subscribing to heartbeat messages in a mesh network

Steve Brown
 


Hi Ashish 

On Dec 27, 2017, at 12:19 AM, "ashish.shukla@..." <ashish.shukla@...> wrote:

Hi,

Thanks Steve, it works as expected.

I watched a video on youtube by Johan, in which he demonstrates working of heartbeat messages. Which means he's developed some means to subscribe to Heartbeat messages as well. Is there some other way if I want to subscribe to heartbeat messages except meshctl?


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Tue, Dec 26, 2017 at 5:58 PM, Steve Brown <sbrown@...> wrote:
Hi Ashish,

On Tue, 2017-12-26 at 17:47 +0530, ashish.shukla@... wrote:
> Hello everyone !!
>
> I'm trying to work with heartbeat messages. I'm using android app by
> silicon Labs for provisioning and configuring so I can't subscribe
> and publish heartbeat messages using this app.
>
> On the other hand, there is command for publishing heartbeat messages
> in meshctl, so I'm able to publish heartbeat messages. but, there
> isn't any command to subscribe for heartbeat messages.
>
> I understand that this needs to done using configuration client,still
> I want to know if there is a way to subscribe just for testing
> purposes?
>
> Can I use these lines of code I found at /mesh_demo/src.c  in my
> main.c file, hard coding the addresses
>
>
>         struct bt_mesh_cfg_hb_sub sub = {
>             .src = PUBLISHER_ADDR,
>             .dst = GROUP_ADDR,
>             .period = 0x10,
>         };
>
>         bt_mesh_cfg_hb_sub_set(net_idx, addr, &sub, NULL);
>
> though adding these lines gives compilation error in my code.
>
> --
> Warm regards,
> Ashish Shukla
> Jr. Embedded Engineer
> Research & Development
> www.corvi.com
>
>
If the target of heartbeat publish is 0077 (meshctl's unicast address),
it will display the returned status.

Steve

There isn’t a heartbeat subscribe command in meshctl. It wouldn’t be hard to add. Take a look at the code and add it. I’m on vacation for a couple of weeks
Steve


Re: Subscribing to heartbeat messages in a mesh network

Johan Hedberg
 

Hi Vikrant,

On Wed, Dec 27, 2017, Vikrant More wrote:
how to subscribe dynamically to heartbeat of any node (using meshctl) ?
I don't think meshctl has this support yet. IIRC, Steve sent an RFC
patch for that, but nothing has been merged upstream yet.

I've enable CONFIG_BT_MESH_CFG_CLI=y this in prj.conf

Added "Configuration Client Model" into list of models supported by
root_model -->

static struct bt_mesh_cfg_cli cfg_cli = {
};


static struct bt_mesh_model root_models[] = {
BT_MESH_MODEL_CFG_SRV(&cfg_srv),
BT_MESH_MODEL_CFG_CLI(&cfg_cli),
BT_MESH_MODEL_HEALTH_SRV(&health_srv, &health_pub),
BT_MESH_MODEL(BT_MESH_MODEL_ID_GEN_ONOFF_SRV, gen_onoff_op,
&gen_onoff_pub, NULL),
BT_MESH_MODEL(BT_MESH_MODEL_ID_GEN_LEVEL_SRV, gen_level_op,
&gen_level_pub, NULL),
BT_MESH_MODEL(BT_MESH_MODEL_ID_GEN_ONOFF_CLI, gen_onoff_cli_op,
&gen_onoff_cli_pub, NULL),
};
That all looks fine to me, however note that you don't need this if
you're planning to use an external tool like meshctl.
CONFIG_BT_MESH_CFG_CLI is only needed if you want to use Zephyr as the
configuration client.

Johan


Re: Subscribing to heartbeat messages in a mesh network

Vikrant More <vikrant8051@...>
 

how to subscribe dynamically to heartbeat of any node (using meshctl) ?

I've enable CONFIG_BT_MESH_CFG_CLI=y this in prj.conf

Added "Configuration Client Model" into list of models supported by root_model -->

static struct bt_mesh_cfg_cli cfg_cli = {
};


static struct bt_mesh_model root_models[] = {
    BT_MESH_MODEL_CFG_SRV(&cfg_srv),
    BT_MESH_MODEL_CFG_CLI(&cfg_cli),
    BT_MESH_MODEL_HEALTH_SRV(&health_srv, &health_pub),
    BT_MESH_MODEL(BT_MESH_MODEL_ID_GEN_ONOFF_SRV, gen_onoff_op,
              &gen_onoff_pub, NULL),
    BT_MESH_MODEL(BT_MESH_MODEL_ID_GEN_LEVEL_SRV, gen_level_op,
              &gen_level_pub, NULL),
    BT_MESH_MODEL(BT_MESH_MODEL_ID_GEN_ONOFF_CLI, gen_onoff_cli_op,
              &gen_onoff_cli_pub, NULL),
};

------------------------------------------------------------------------------------------------------------------------------------------------


static void heartbeat(u8_t hops, u16_t feat)
{
    //Toggle LED4 on nRF52840_PDK

    NRF_P0->OUT ^= (1<<16);
}

static struct bt_mesh_cfg_srv cfg_srv = {
    .relay = BT_MESH_RELAY_DISABLED,
    .beacon = BT_MESH_BEACON_ENABLED,
#if defined(CONFIG_BT_MESH_FRIEND)
    .frnd = BT_MESH_FRIEND_ENABLED,
#else
    .frnd = BT_MESH_FRIEND_NOT_SUPPORTED,
#endif
#if defined(CONFIG_BT_MESH_GATT_PROXY)
    .gatt_proxy = BT_MESH_GATT_PROXY_ENABLED,
#else
    .gatt_proxy = BT_MESH_GATT_PROXY_NOT_SUPPORTED,
#endif
    .default_ttl = 7,

    /* 3 transmissions with 20ms interval */
    .net_transmit = BT_MESH_TRANSMIT(2, 20),
    .relay_retransmit = BT_MESH_TRANSMIT(2, 20),

    .hb_sub.func = heartbeat,
};

On Wed, Dec 27, 2017 at 12:00 PM, Johan Hedberg <johan.hedberg@...> wrote:
Hi Ashish,

On Wed, Dec 27, 2017, Johan Hedberg wrote:
> On Wed, Dec 27, 2017, ashish.shukla@... wrote:
> > Thanks Steve, it works as expected.
> >
> > I watched a video on youtube by Johan, in which he demonstrates working of
> > heartbeat messages. Which means he's developed some means to subscribe to
> > Heartbeat messages as well. Is there some other way if I want to subscribe
> > to heartbeat messages except meshctl?
>
> The call to bt_mesh_cfg_hb_sub_set() that you found in mesh_demo is on
> the right track. It will send the heartbeat subscription configuration
> message to the given address, which also works if the address is the
> local node. Note that you also need to have the configuration client
> model as part of your models array. You didn't show us what exactly the
> compilation issue is that you got, but I suspect you simply didn't have
> the Configuration Client Model enabled in Kconfig. To enable it you need
> to set CONFIG_BT_MESH_CFG_CLI=y.

One thing I forgot to mention: you can play with most of these features
also using tests/bluetooth/mesh_shell. It has commands for configuring
heartbeat publication & subscription. The commands aren't exactly the
same as meshctl, so be sure to check with "help" for what commands are
available and what parameters they take. The mesh shell uses internally
the same configuration client API that e.g. bt_mesh_cfg_hb_sub_set() is
a part of, so if you're interested in more examples of this API's usage,
take a look at subsys/bluetooth/host/mesh/shell.c.

Johan
_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users


Re: Subscribing to heartbeat messages in a mesh network

Johan Hedberg
 

Hi Ashish,

On Wed, Dec 27, 2017, Johan Hedberg wrote:
On Wed, Dec 27, 2017, ashish.shukla@corvi.com wrote:
Thanks Steve, it works as expected.

I watched a video on youtube by Johan, in which he demonstrates working of
heartbeat messages. Which means he's developed some means to subscribe to
Heartbeat messages as well. Is there some other way if I want to subscribe
to heartbeat messages except meshctl?
The call to bt_mesh_cfg_hb_sub_set() that you found in mesh_demo is on
the right track. It will send the heartbeat subscription configuration
message to the given address, which also works if the address is the
local node. Note that you also need to have the configuration client
model as part of your models array. You didn't show us what exactly the
compilation issue is that you got, but I suspect you simply didn't have
the Configuration Client Model enabled in Kconfig. To enable it you need
to set CONFIG_BT_MESH_CFG_CLI=y.
One thing I forgot to mention: you can play with most of these features
also using tests/bluetooth/mesh_shell. It has commands for configuring
heartbeat publication & subscription. The commands aren't exactly the
same as meshctl, so be sure to check with "help" for what commands are
available and what parameters they take. The mesh shell uses internally
the same configuration client API that e.g. bt_mesh_cfg_hb_sub_set() is
a part of, so if you're interested in more examples of this API's usage,
take a look at subsys/bluetooth/host/mesh/shell.c.

Johan


Re: Subscribing to heartbeat messages in a mesh network

Johan Hedberg
 

Hi Ashish,

On Wed, Dec 27, 2017, ashish.shukla@corvi.com wrote:
Thanks Steve, it works as expected.

I watched a video on youtube by Johan, in which he demonstrates working of
heartbeat messages. Which means he's developed some means to subscribe to
Heartbeat messages as well. Is there some other way if I want to subscribe
to heartbeat messages except meshctl?
The call to bt_mesh_cfg_hb_sub_set() that you found in mesh_demo is on
the right track. It will send the heartbeat subscription configuration
message to the given address, which also works if the address is the
local node. Note that you also need to have the configuration client
model as part of your models array. You didn't show us what exactly the
compilation issue is that you got, but I suspect you simply didn't have
the Configuration Client Model enabled in Kconfig. To enable it you need
to set CONFIG_BT_MESH_CFG_CLI=y.

Johan


Re: Subscribing to heartbeat messages in a mesh network

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi,

Thanks Steve, it works as expected.

I watched a video on youtube by Johan, in which he demonstrates working of heartbeat messages. Which means he's developed some means to subscribe to Heartbeat messages as well. Is there some other way if I want to subscribe to heartbeat messages except meshctl?


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Tue, Dec 26, 2017 at 5:58 PM, Steve Brown <sbrown@...> wrote:
Hi Ashish,

On Tue, 2017-12-26 at 17:47 +0530, ashish.shukla@... wrote:
> Hello everyone !!
>
> I'm trying to work with heartbeat messages. I'm using android app by
> silicon Labs for provisioning and configuring so I can't subscribe
> and publish heartbeat messages using this app.
>
> On the other hand, there is command for publishing heartbeat messages
> in meshctl, so I'm able to publish heartbeat messages. but, there
> isn't any command to subscribe for heartbeat messages.
>
> I understand that this needs to done using configuration client,still
> I want to know if there is a way to subscribe just for testing
> purposes?
>
> Can I use these lines of code I found at /mesh_demo/src.c  in my
> main.c file, hard coding the addresses
>
>
>         struct bt_mesh_cfg_hb_sub sub = {
>             .src = PUBLISHER_ADDR,
>             .dst = GROUP_ADDR,
>             .period = 0x10,
>         };
>
>         bt_mesh_cfg_hb_sub_set(net_idx, addr, &sub, NULL);
>
> though adding these lines gives compilation error in my code.
>
> --
> Warm regards,
> Ashish Shukla
> Jr. Embedded Engineer
> Research & Development
> www.corvi.com
>
>
If the target of heartbeat publish is 0077 (meshctl's unicast address),
it will display the returned status.

Steve



Re: Subscribing to heartbeat messages in a mesh network

Steve Brown
 

Hi Ashish,

On Tue, 2017-12-26 at 17:47 +0530, ashish.shukla@corvi.com wrote:
Hello everyone !!

I'm trying to work with heartbeat messages. I'm using android app by
silicon Labs for provisioning and configuring so I can't subscribe
and publish heartbeat messages using this app.

On the other hand, there is command for publishing heartbeat messages
in meshctl, so I'm able to publish heartbeat messages. but, there
isn't any command to subscribe for heartbeat messages.

I understand that this needs to done using configuration client,still
I want to know if there is a way to subscribe just for testing
purposes?

Can I use these lines of code I found at /mesh_demo/src.c in my
main.c file, hard coding the addresses


struct bt_mesh_cfg_hb_sub sub = {
.src = PUBLISHER_ADDR,
.dst = GROUP_ADDR,
.period = 0x10,
};

bt_mesh_cfg_hb_sub_set(net_idx, addr, &sub, NULL);

though adding these lines gives compilation error in my code.

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development
www.corvi.com

If the target of heartbeat publish is 0077 (meshctl's unicast address),
it will display the returned status.

Steve


Subscribing to heartbeat messages in a mesh network

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hello everyone !!

I'm trying to work with heartbeat messages. I'm using android app by silicon Labs for provisioning and configuring so I can't subscribe and publish heartbeat messages using this app.

On the other hand, there is command for publishing heartbeat messages in meshctl, so I'm able to publish heartbeat messages. but, there isn't any command to subscribe for heartbeat messages.

I understand that this needs to done using configuration client,still I want to know if there is a way to subscribe just for testing purposes?

Can I use these lines of code I found at /mesh_demo/src.c  in my main.c file, hard coding the addresses

 
        struct bt_mesh_cfg_hb_sub sub = {
            .src = PUBLISHER_ADDR,
            .dst = GROUP_ADDR,
            .period = 0x10,
        };

        bt_mesh_cfg_hb_sub_set(net_idx, addr, &sub, NULL);

though adding these lines gives compilation error in my code.

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

2361 - 2380 of 2796