Date   

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: [Zephyr-users] 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: [Zephyr-users] 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: [Zephyr-users] 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: [Zephyr-users] 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: [Zephyr-users] 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: [Zephyr-users] 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: [Zephyr-users] 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: [Zephyr-users] 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: mcuboot usage guide

Fabio Utzig <utzig@...>
 

On Tue, Dec 26, 2017, at 2:45 AM, Sun, Youqun wrote:
Hello experts,

The Zephyr(v1.10) project has run in my NRF52_PCA10040 board.
Mcuboot source code has been downloaded.
But Zephyr and mcuboot sites give very few info about how to use it.

Hope there is a guide or example for users about how to use mcuboot.
My project needs serial bootloader function.
I use the one linked below; is there anything missing?

https://github.com/runtimeco/mcuboot/blob/master/README-zephyr.rst

Fabio Utzig


Re: [Zephyr-users] 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


mcuboot usage guide

Sun, Youqun <Youqun.Sun@...>
 

Hello experts,

 

The Zephyr(v1.10) project has run in my NRF52_PCA10040 board.

Mcuboot source code has been downloaded.

But Zephyr and mcuboot sites give very few info about how to use it.

 

Hope there is a guide or example for users about how to use mcuboot.

My project needs serial bootloader function.

 

 

Best Regards,

Youqun Sun


Re: Using Math function in zephyr

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

Thanks a lot Michael, for your efforts. It works now. 


--
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 Sat, Dec 23, 2017 at 4:54 PM, Michael Hope <michaelh@...> wrote:
Hi Ashish.  Here's a blow-by-blow:

https://asciinema.org/a/v1LmP0FCsV2Xyv8BqNKTF8pdy

-- Michael


On Fri, 22 Dec 2017 at 11:35 ashish.shukla@... <ashish.shukla@...> wrote:
Michael, I'm a newbie in Zephyr, can you please tell the steps to be followed to turn on float support for printf.


--
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 Fri, Dec 22, 2017 at 2:39 PM, Michael Hope <michaelh@...> wrote:

printk probably doesn't support floating point args. Give printf a try and make sure that printf float support is turned on under 'make menuconfig'.


On Fri, 22 Dec 2017, 10:04 ashish.shukla@..., <ashish.shukla@...> wrote:
Hi,

It doesn't seem to be working for me. Here's a test program

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
printk("round up %d  \n\r",round(5.7));
printk("round down %d \n\r",round(5.2));
}

and output I get is

round up 1075314688
round down 1075052544

I'm working with nrf52840 uC.





--
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 Fri, Dec 22, 2017 at 1:02 PM, Michael Hope <michaelh@...> wrote:
Huh, interesting.  It works for me in a test program:

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
        printf("round up: %f\n", round(1.9));
        printf("round down: %f\n", round(3.1));
}

"""
***** BOOTING ZEPHYR OS v1.10.99- - BUILD: Dec 21 2017 21:44:19 *****
round up: 2.000000
round down: 3.000000
"""

This is on BOARD=qemu_cortex_m3 which uses the ARM soft float ABI.  There's a chance that you've got a mix of hard float / soft float code but I thought the linker checked that.

What board is this for?

-- Michael

On Fri, 22 Dec 2017 at 08:17 ashish.shukla@... <ashish.shukla@...> wrote:
Hi Michael,

After switching to new library, code compiles but it rounds off all the values to 0.


--
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 Fri, Dec 22, 2017 at 12:01 PM, Michael Hope <michaelh@...> wrote:
Hi Ashish.  I haven't used this personally, but try switching the libc from the built-in minimal libc to newlib.  See http://docs.zephyrproject.org/subsystems/c_library.html for more.

-- Michael

On Fri, 22 Dec 2017 at 06:00 ashish.shukla@... <ashish.shukla@...> wrote:
Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

--
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

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





Re: bt_mesh_scan_enable is failed.

loquat3
 

Sorry
I was mistake.

When I am setting a observer role, It's fine.


2017-12-23 18:10 GMT+09:00 biwa <sjbiwa@...>:

Hi,
I develop mesh application on nrf52840 + zephyr1.10

I tryo to work mesh_demo.
But bt_mesh_provision() -> bt_mesh_scan_enable() is error.
(err:0xFFFFFFFB:EIO)

mesh_packet's send is success.

Please help me.



Re: Using Math function in zephyr

Michael Hope
 

Hi Ashish.  Here's a blow-by-blow:

https://asciinema.org/a/v1LmP0FCsV2Xyv8BqNKTF8pdy

-- Michael

On Fri, 22 Dec 2017 at 11:35 ashish.shukla@... <ashish.shukla@...> wrote:
Michael, I'm a newbie in Zephyr, can you please tell the steps to be followed to turn on float support for printf.


--
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 Fri, Dec 22, 2017 at 2:39 PM, Michael Hope <michaelh@...> wrote:

printk probably doesn't support floating point args. Give printf a try and make sure that printf float support is turned on under 'make menuconfig'.


On Fri, 22 Dec 2017, 10:04 ashish.shukla@..., <ashish.shukla@...> wrote:
Hi,

It doesn't seem to be working for me. Here's a test program

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
printk("round up %d  \n\r",round(5.7));
printk("round down %d \n\r",round(5.2));
}

and output I get is

round up 1075314688
round down 1075052544

I'm working with nrf52840 uC.





--
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 Fri, Dec 22, 2017 at 1:02 PM, Michael Hope <michaelh@...> wrote:
Huh, interesting.  It works for me in a test program:

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
        printf("round up: %f\n", round(1.9));
        printf("round down: %f\n", round(3.1));
}

"""
***** BOOTING ZEPHYR OS v1.10.99- - BUILD: Dec 21 2017 21:44:19 *****
round up: 2.000000
round down: 3.000000
"""

This is on BOARD=qemu_cortex_m3 which uses the ARM soft float ABI.  There's a chance that you've got a mix of hard float / soft float code but I thought the linker checked that.

What board is this for?

-- Michael

On Fri, 22 Dec 2017 at 08:17 ashish.shukla@... <ashish.shukla@...> wrote:
Hi Michael,

After switching to new library, code compiles but it rounds off all the values to 0.


--
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 Fri, Dec 22, 2017 at 12:01 PM, Michael Hope <michaelh@...> wrote:
Hi Ashish.  I haven't used this personally, but try switching the libc from the built-in minimal libc to newlib.  See http://docs.zephyrproject.org/subsystems/c_library.html for more.

-- Michael

On Fri, 22 Dec 2017 at 06:00 ashish.shukla@... <ashish.shukla@...> wrote:
Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

--
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

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




bt_mesh_scan_enable is failed.

loquat3
 

Hi,
I develop mesh application on nrf52840 + zephyr1.10

I tryo to work mesh_demo.
But bt_mesh_provision() -> bt_mesh_scan_enable() is error.
(err:0xFFFFFFFB:EIO)

mesh_packet's send is success.

Please help me.


Re: poll event handling bug in v1.9.0 and v1.10.0, Request review for this patch.

Boie, Andrew P
 

Please don't send patches as screenshots.

Send a Github pull request instead.

 

http://docs.zephyrproject.org/contribute/contribute_guidelines.html

 

Andrew

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of zhou.xin8@...
Sent: Friday, December 22, 2017 12:46 AM
To: zephyr-devel@...
Cc: liu.yanan1@...; dai.kang@...; leng.tong@...
Subject: [Zephyr-devel]  poll event handling bug in v1.9.0 and v1.10.0, Request review for this patch.

 

Hi, All

 

Due to network policy issue, We submit a bug about poll event handling by mail-list way here,

And request review for the patch.

 

 

 

周欣 Zhou Xin

 

安全操作系统与驱动
解决方案一部/解决方案部/深圳市中兴微电子技术有限公司

 

南京市雨花台区紫荆花路68号中兴通讯南京研发中心4C

4C/F, ZTE R&D Center(NanJing), No.68 ZiJinghua Road, 

YuHuatai District, Nanjing, P.R.China, 210012

T: 025-52870384

M: +86 13770868539

E: zhou.xin8@...

 


Re: [Zephyr-users] Using Math function in zephyr

Boie, Andrew P
 

Ø  printk("round up %d  \n\r",round(5.7));
printk("round down %d \n\r",round(5.2));

 

What output are you expecting? You are using %d.

printk() doesn't support floating point.

 

Andrew

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of ashish.shukla@...
Sent: Friday, December 22, 2017 2:35 AM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@...; zephyr-devel@...
Subject: Re: [Zephyr-users] [Zephyr-devel] Using Math function in zephyr

 

Michael, I'm a newbie in Zephyr, can you please tell the steps to be followed to turn on float support for printf.


 

--

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 Fri, Dec 22, 2017 at 2:39 PM, Michael Hope <michaelh@...> wrote:

printk probably doesn't support floating point args. Give printf a try and make sure that printf float support is turned on under 'make menuconfig'.

 

On Fri, 22 Dec 2017, 10:04 ashish.shukla@..., <ashish.shukla@...> wrote:

Hi,

It doesn't seem to be working for me. Here's a test program


#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{

printk("round up %d  \n\r",round(5.7));
printk("round down %d \n\r",round(5.2));
}

and output I get is

round up 1075314688

round down 1075052544

I'm working with nrf52840 uC.




 

--

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 Fri, Dec 22, 2017 at 1:02 PM, Michael Hope <michaelh@...> wrote:

Huh, interesting.  It works for me in a test program:

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
        printf("round up: %f\n", round(1.9));
        printf("round down: %f\n", round(3.1));
}

"""
***** BOOTING ZEPHYR OS v1.10.99- - BUILD: Dec 21 2017 21:44:19 *****
round up: 2.000000
round down: 3.000000
"""

 

This is on BOARD=qemu_cortex_m3 which uses the ARM soft float ABI.  There's a chance that you've got a mix of hard float / soft float code but I thought the linker checked that.

 

What board is this for?

-- Michael

 

On Fri, 22 Dec 2017 at 08:17 ashish.shukla@... <ashish.shukla@...> wrote:

Hi Michael,

After switching to new library, code compiles but it rounds off all the values to 0.


 

--

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 Fri, Dec 22, 2017 at 12:01 PM, Michael Hope <michaelh@...> wrote:

Hi Ashish.  I haven't used this personally, but try switching the libc from the built-in minimal libc to newlib.  See http://docs.zephyrproject.org/subsystems/c_library.html for more.

-- Michael

 

On Fri, 22 Dec 2017 at 06:00 ashish.shukla@... <ashish.shukla@...> wrote:

Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

 

--

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

 

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

 

 

 

4121 - 4140 of 8046