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:
|
|
Re: Subscribing to heartbeat messages in a mesh network
Steve Brown
Hi Ashish Steve
|
|
Re: Subscribing to heartbeat messages in a mesh network
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.confThat 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.confstatic 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,
|
|
Re: Subscribing to heartbeat messages in a mesh network
Hi Ashish,
On Wed, Dec 27, 2017, Johan Hedberg wrote: On Wed, Dec 27, 2017, ashish.shukla@corvi.com wrote:One thing I forgot to mention: you can play with most of these featuresThanks Steve, it works as expected.The call to bt_mesh_cfg_hb_sub_set() that you found in mesh_demo is on 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
Hi Ashish,
On Wed, Dec 27, 2017, ashish.shukla@corvi.com wrote: Thanks Steve, it works as expected.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. -- 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,
|
|
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 !!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. 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
youqun
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: [Zephyr-devel] 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:
|
|
Re: Unable to set Appkey for generic server model
Mani Sadhasivam
Hi Johan, On Sat, Dec 23, 2017 at 5:21 PM, Johan Hedberg <johan.hedberg@...> wrote: Hi Mani, You are right... Mistakenly specified the cfg_srv model. It is working fine now :) Also, if this is really a formal publish message you're sending, you Sure, will make use of it. Thanks for the clarification! Regards, Mani Johan
|
|
Re: Unable to set Appkey for generic server model
Hi Mani,
On Sat, Dec 23, 2017, Mani Sadhasivam wrote: [bt] [ERR] model_send: Model not bound to AppKey 0x0001A couple of things come to mind here: Is root_models[0] really the model that's supposed to do the publishing? It's often the Configuration Server Model, which would explain the error you're getting. You didn't show the definition of your models array, so I'm just guessing here. Also, if this is really a formal publish message you're sending, you should be using the bt_mesh_model_publish() API instead of bt_mesh_model_send(). The latter is intended mainly for client model messages as well as for the server's responses to those, and it doesn't take into consideration things like the Model Publish Retransmit state or that you're actually publishing using the configured publication state (correct app key, destination address, TTL, etc). Johan
|
|
Unable to set Appkey for generic server model
Mani Sadhasivam
Hello, My objective is to use 96Boards carbons running Zephyr to form a mesh network for publishing sensor data. For testing purposes, I am using Generic ON/OFF server model for sending the sensor data to all nodes in the network, later this will get replaced by Sensor server model. However, after provisioning the node using `meshctl` and binding AppKey to the model, publishing sensor data from node results in the below error: [bt] [ERR] model_send: Model not bound to AppKey 0x0001 Thread used for publishing sensor data: void temp_work_thread(struct k_work *work) { if (node_addr == BT_MESH_ADDR_UNASSIGNED) return; struct net_buf_simple *msg = NET_BUF_SIMPLE(3 + 4); struct bt_mesh_msg_ctx ctx = { .net_idx = 0, .app_idx = 1, .addr = BT_MESH_ADDR_ALL_NODES, .send_ttl = BT_MESH_TTL_DEFAULT, }; bt_mesh_model_msg_init(msg, BT_MESH_MODEL_OP); net_buf_simple_add_u8(msg, 1); if (bt_mesh_model_send(&root_models[0], &ctx, msg, NULL, NULL)) { printk("Unable to send sensor message\n"); return; } printk("Sensor message sent with OpCode 0x%08x\n", BT_MESH_MODEL_OP); } Meshctl commands for provisioning and binding AppKey: discover-unprovisioned on provision 0108 # Node address 0108 menu config target 0108 appkey-add 1 bind 0 1 1000 # bind AppKey 1 to model 1000 of 0th element Above commands seems to succeed with below debug message: [Zephyr-Node-0108]# target 0108 Configuring node 0108 [config: Target = 0108]# target 0108[config: Target = 0108]# appkey-add 1 GATT-TX: 00 f4 c2 c3 a1 79 49 50 dd 24 66 ea ac 62 e3 76 GATT-TX: 8d 86 c3 53 dd ca b1 76 2e 21 0c aa 5c c8 GATT-TX: 00 f4 56 51 ac b5 41 23 5c 15 44 f4 40 68 04 92 GATT-TX: 35 5f e0 33 34 1a 32 99 00 01 b5 67 ed c0 GATT-RX: 00 f4 fb 34 d9 5b 37 66 66 0f 1b 3b d0 ca e5 24 GATT-RX: 70 92 fd 94 3c 44 6c 42 e6 GATT-RX: 00 f4 33 91 bd 9f b5 37 2d ae 01 5a c8 67 00 c0 GATT-RX: fa 5f 34 fc e4 53 c9 da 15 Node 0108 AppKey Status Success NetKey 000, AppKey 001 [config: Target = 0108]# bind 0 1 1000 GATT-TX: 00 f4 25 40 41 a2 09 fb 01 8f d1 be 2c e3 1b 0b GATT-TX: 13 e3 ac 38 ea f9 74 c7 99 a9 33 GATT-RX: 00 f4 a3 1b e3 71 55 5c 0b a6 d1 6f a2 6f 80 62 GATT-RX: 84 d6 26 a9 61 49 0a 73 ad 31 bc 04 Node 0108 Model App Status Success Element 0108 AppIdx 001 ModelId 1000 [config: Target = 0108]# Can anyone please clarify what is going wrong? Branch used: Latest Master branch Thanks in advance! -Mani
|
|
Re: [Zephyr-devel] Using Math function in zephyr
Michael Hope
toggle quoted messageShow quoted text
|
|
Re: [Zephyr-devel] Using Math function in zephyr
Boie, Andrew P
Ø
printk("round up %d \n\r",round(5.7));
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, 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:
|
|
Re: [Zephyr-devel] Using Math function in zephyr
ashish.shukla@corvi.com <ashish.shukla@...>
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:
|
|
Re: [Zephyr-devel] Using Math function in zephyr
Michael Hope
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'.
|
|
Re: [Zephyr-devel] Using Math function in zephyr
ashish.shukla@corvi.com <ashish.shukla@...>
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)); } -- 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:
|
|
Re: [Zephyr-devel] Using Math function in zephyr
Michael Hope
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.
|
|