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

nRF9160 lwm2m registeration, how to add option(others)?

SDK: NCS 1.4.0

board: nRF9160-DK

sample: lwm2m_client

Question: 

I am testing SERCOMM module and nRF9160-DK, but there is difference in registration procedure .

When bootstrap completed, i receive some data from server. In registration procedure, i use this data.

In registration procedure  with lwm2m server, it looks like i have to send some data in option[others]. 

1. Is there any setting value in lwm2m_client sample ?

2. Is there function to add data in option[others]?

(I have tested coap_packet_append_option() using  enum coap_option_num, but there is no option[others]. )

#1 registration: (lwm2m_client sample, nRF9160-DK -> server)

options => {
    "if_match_list"null,
    "uri_host"null,
    "etag_list"null,
    "if_none_match"false,
    "uri_port"null,
    "location_path_list"null,
    "uri_path_list": [
        "rd"
    ],
    "content_format"40,
    "max_age"null,
    "uri_query_list": [
        "lwm2m=1.0",
        "",
        "lt=86400"
    ],
    "accept"-1,
    "location_query_list"null,
    "proxy_uri"null,
    "proxy_scheme"null,
    "block1"null,
    "block2"null,
    "size1"null,
    "size2"null,
    "observe"null,
    "others": null,

#2 registration: (SERCOMM board -> server)

options => {
    "if_match_list"null,
    "uri_host"null,
    "etag_list"null,
    "if_none_match"false,2
    "uri_port"null,
    "location_path_list"null,
    "uri_path_list": [
        "rd"
    ],
    "content_format"40,
    "max_age"null,
    "uri_query_list": [
        "lwm2m=1.0",
        "ep=-",
        "b=U",
        "lt=86400"
    ],
    "accept"-1,
    "location_query_list"null,
    "proxy_uri"null,
    "proxy_scheme"null,
    "block1"null,
    "block2"null,
    "size1"null,
    "size2"null,
    "observe"null,
    "others": [
        {
            "number": 2048,
            "value": "",
            "stringValue": "",
            "integerValue": ,
            "unSafe": false,
            "noCacheKey": false,
            "longValue": ,
            "critical": false,
            "length": 22
        },
        {
            "number": 2049,
            "value": "",
            "stringValue": "",
            "integerValue": ,
            "unSafe": false,
            "noCacheKey": false,
            "longValue": ,
            "critical": true,
            "length": 43
        }
    ],

Parents Reply Children
  • OK, thanks for clarifying. Is there a reason for you using NCS v1.4.0? In your last ticket you were using NCS v1.5.0. Several improvements have been introduced to v1.5.0, among other a CoAP bug (fix long options encoding), and v1.5.0 is tested with modem fw 1.2.3. 

    Our expert replies:

    It's not that the Zephyr implementation is lacking these options, it's the other library (from Sercomm) that adds some custom options to the registration message (not covered by the standard). Currently Zephyr does not allow to add custom options to the registration message. If the customer really wants to do that, he'd need to modify the lwm2m library and usecoap_packet_append_option(). One caveat the function has, is that you need to add options in an ascending order (in terms of option ID) so perhaps these are out of order.

    Kind regards,
    Øyvind

Related