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 Deno, yes I was referring to the side issue. So when there is 4 sensors the app works fine but the side issue was only 3 descriptors being listed in the app when sending a SensorGet. This was because the the mesh libraries in the app are expecting a Uint16 (2 bytes)in the humidty characteristic where as there is only 1 byte available on the humidity characteristic causing the SensorStatus to ignore the 4th descriptor. I would check line number 73 and 98 in your app_sensor_utils.c and I have a feeling your are returning the pir_data_size_t for all property_id cases irrespective of the property_id. Each property_id has different data sizes defined. please check Mesh Device Propterties specification.

    What I noticed with your main issue was that, the app/library does not get any response from the device for a CompositionDataGet which we managed to produce in both platforms Android and iOS. So we can narrow down it's something on the firmware.

  • Hi Roshan, Thanks for the detailed info on data size. In the Mesh Device Properties Spec v2 (pg 22-23):

    3.5.11 Present Ambient Relative Humidity device property
    This property represents relative humidity measured by a humidity sensor.
    Characteristic: Humidity

    As Humidity is a scalar value, I presume its represented value is related to the raw value by the following equations (per pg 11): R = C * M * 10d * 2b

    But it is unclear to me what individual data size is it for R, C, M, d and b. Also, what values of M, d and b are supposed to be used for "Humidity" characteristic? I could not find the info in Mesh Device Properties Spec v2. Can you advise?

    With regard to the main issue, is anyone from nRF5 Mesh stack team helping to look into the issue from firmware perspective?

  • Hi,

    deno said:
    With regard to the main issue, is anyone from nRF5 Mesh stack team helping to look into the issue from firmware perspective?

     Regarding your main issue, I have reached out to our Mesh team for help. I will update you as soon as I get a response.

  • Hi Deno I can answer the part relating to the Humidity characteristic. You are correct, it indeed is a scalar value and here's the link to download the GATT Supplement Specification which specifies represented values for the scalar value equation. Check section 3.111. Hope this helps.

Related