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

sensor_server with 5 Property IDs always failed in getting configuration (compositon_data_get) step using nRF Mesh (Android)

Hi,

My development setup:

HW:  nRF52840 DK
SDK: nrf5_SDK_for_Mesh_v5.0.0_src + nRF5_SDK_17.0.2_d674dde + s140nrf52720
Provisioner: nRF Mesh Android app (Ver 3.1.0)

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

I modified sensor_server example (nrf5_SDK_for_Mesh_v5.0.0_src\examples\sensor\server) to support multiple Property IDs (2 to 5)

Below are the Property ID I used in the modified sensor_server app: 

#define SENSOR_MOTION_SENSED_PROPERTY_ID (0x0042)
#define SENSOR_PRESENCE_DETECT_PROPERTY_ID (0x004D)
#define SENSOR_PRESENT_AMBIENT_TEMPERATURE_PROPERTY_ID (0x004F)
#define SENSOR_PRESENT_AMBIENT_RELATIVE_HUMIDITY_PROPERTY_ID (0x0076)
#define SENSOR_PRESENT_AMBIENT_VOC_PROPERTY_ID (0x0078)

I have tried adding UP TO 4 Property IDs (and up to 4 descriptors), everything is working fine, i.e. able to get through provisioning and configuration successfully and work fine with sensor_client app to send the descriptor msg for all property ids and other test (per the sensor example)

   

Problem statement:
When the number of Property ID is increased to 5, during provisioning (using nRF Mesh Android app) process,  even though sensor_server is able to go through provisioning successfully (Note: On nRF Mesh mobile app: "<- Provisioning complete received" is shown) but it consistently failed/stopped at the "composition data get" step (Pls see nRF Mesh's  screenshot below)

I have repeatedly tried with 4 and 5 Property ID builds for several times and verified that the build with 4 Property ID is always OK in all aspects but for the build with 5 Property ID, the nRF Mesh always failed at the " -> Sending composition data get .." step. 

Some debugging info:
1. I have put in some log message in handle_composition_data_get in handle_composition_data_get() (in config_server.c) and noticed that the function runs ok all the way till the end (i.e. app_evt_send(&evt). 

2. The handle_config_default_ttl_get() is not invoked for the case of 5 Property ID

This is unclear to me the issue lies with nRF52840 firmware or with the nRF Mesh mobile app.

Pls advise what needs to be done to make the sensor_server_model capable of supporting 5 Property IDs (for 5 sensors).

Another side issue:
When the sensor_server model supports only 3 sensors (3 Property IDs and 3 descriptors), I am able to click "Get Sensor" on nRF Mesh app to get the 3 sensors info showing up (under Sensor Information section). However, when testing with sensor_server with 4 sensors (4 Property ID and 4 descriptors). Upon clicking the "Get Sensor" on nRF Mesh, the nRF Mesh app will either has no response or exit from Sensor Server model screen. 

  

 

  • Hi,

    Could you provide me with your firmware if possible? And a step-by-step procedure on how I can try reproduce this on my side.

  • Thank you for the code and the step-by-step procedure, I will try reproducing the issue and come back to you.

  • Hi deno, I see a slight issue here, both iOS and Android libraries are failing parse the 4th property however the the sample app is crashing where as it should not. The reason for not showing up the 4th sensor property which is "Ambient Relative Humidity" is because the data provided provided by the senor is wrong. This property contains a characteristic called Humidity which should contain a uint16 and what the library/apps are receiving is uint8 causing the parsing to fail.

    I will update the Android app so that it does not crash in case of invalid data is received and once you fix the issue on the fw side all 4 sensor properties should show up.

  • Hi Rashan, I believe you referred to the "side issue" reported. In my app code (main.c and sensor_common.h), property id has already been defined as uint16 and I am not sure which "Humidity" characteristic you referred to in the sensor descriptor data (Pls see the extracted code below).

    At application level, I don't see how the descriptor data is being sent. Could the issue with sending of the "Humidity" characteristic as uint8 (instead of uint16) lie in BLE mesh stack or the sensor example code itself? 

    Another question: The descriptors for all the 4 Property ID are defined in the same way, why would the BLE Mesh app works for the case of 3 sensors (3 Property ID) and not for the case of 4 sensors (4 Property ID)?

    BTW, any finding so far with regard to the main issue reported (failed at Sending composition data get step for the case of 5 property id)?

    Thank you.


    In sensor_common.h:
    
    /** Parameters for the Sensor Descriptor. */
    typedef struct
    {
        uint16_t property_id;               /**< Property ID for sensor */
        uint16_t positive_tolerance;        /**< 12-bit value for possible positive sensor error */
        uint16_t negative_tolerance;        /**< 12-bit value for possible negative sensor error */
        uint8_t sampling_function;          /**< Sampling function applied to measured sensor values */
        uint8_t measurement_period;         /**< Period over which measurement is taken in seconds */
        uint8_t update_interval;            /**< Interval between measurement updates in seconds */
    } sensor_descriptor_t;
    
    In main.c:
    
    static uint16_t property_array[] = {NUM_PROPERTY_ID, 
                                        SENSOR_MOTION_SENSED_PROPERTY_ID,
                                        SENSOR_PRESENCE_DETECT_PROPERTY_ID,
                                        SENSOR_PRESENT_AMBIENT_TEMPERATURE_PROPERTY_ID,
                                        SENSOR_PRESENT_AMBIENT_RELATIVE_HUMIDITY_PROPERTY_ID,
    #if (NUM_PROPERTY_ID == 5)
                                        SENSOR_PRESENT_AMBIENT_VOC_PROPERTY_ID
    #endif
                                       };

Related