This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Receive string message from node in ble mesh.

I have extend the light switch example to send message to the other node. I have refer This example to send message. But how to configure another node to receive the message and relay the same message to server using WiFi. Will you please provide some sample example code to receive the message and relay that message. It also gives the error "Undefined reference to address_set." in following code

uint32_t status=0;
uint8_t buffer[30];
uint8_t length;
uint16_t address;
access_message_tx_t msg;
length= SEGGER_RTT_Read(0,buffer, sizeof(buffer));
           if (length)
            {
              msg.opcode.opcode =simple_message_OPCODE_SEND;
              msg.opcode.company_id = 0x0059; // Nordic's company ID
      
              msg.p_buffer = (const uint8_t *) &buffer[0];
              msg.length =length;
              address = 0xCAFE;
              address_set(address);
              SEGGER_RTT_printf(0,"Sending to group address 0x%04x\n", address);
              status= access_model_publish(m_clients[0].model_handle, &msg);

              if (status == NRF_ERROR_INVALID_STATE ||
              status == NRF_ERROR_BUSY||status == NRF_ERROR_NO_MEM)
               {
                 __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Cannot send. Device is busy.\n");
                  hal_led_blink_ms(LEDS_MASK, 50, 4);
               }
               else
               {
                     ERROR_CHECK(status);
               }
            }
Parents
  • Hello Pooja,

    In my response to your previous question, it clearly stated that you would need to implement your own solution in order to send data across wifi and/or the cloud. Bluetooth Mesh doesn't define any requirement or have any notion of a gateway, so you will either have to implement one or use something like nrfCloud using a devkit/PC combination coupled with Mesh SDK firmware to send data into the Nordic cloud service (or your cloud service/database of choice).

    Additionally, Bluetooth Mesh works on a publish/subscribe message paradigm, so once a node (which has been successfully provisioned into the mesh network) subscribes to a message, upon publication of that message (by a client), the underlying mesh network should deliver it to that subscribing node. Please re-read the links provided in my previous post so that you clearly familiarize yourself with underlying mesh concepts. Only then can you hope to build any mesh solutions which adequately comply with the standard.

    Regarding the "Undefined reference to address_set" error that you refer to, in the post that you linked, it clearly states the following...


    Again, as above, re-reading a post a couple of times will go a long way to helping you to resolve many of the issues that you come across.

    Regards,

Reply
  • Hello Pooja,

    In my response to your previous question, it clearly stated that you would need to implement your own solution in order to send data across wifi and/or the cloud. Bluetooth Mesh doesn't define any requirement or have any notion of a gateway, so you will either have to implement one or use something like nrfCloud using a devkit/PC combination coupled with Mesh SDK firmware to send data into the Nordic cloud service (or your cloud service/database of choice).

    Additionally, Bluetooth Mesh works on a publish/subscribe message paradigm, so once a node (which has been successfully provisioned into the mesh network) subscribes to a message, upon publication of that message (by a client), the underlying mesh network should deliver it to that subscribing node. Please re-read the links provided in my previous post so that you clearly familiarize yourself with underlying mesh concepts. Only then can you hope to build any mesh solutions which adequately comply with the standard.

    Regarding the "Undefined reference to address_set" error that you refer to, in the post that you linked, it clearly states the following...


    Again, as above, re-reading a post a couple of times will go a long way to helping you to resolve many of the issues that you come across.

    Regards,

Children
Related