Code Monkey home page Code Monkey logo

emqx-lwm2m's Introduction

LwM2M Gateway for the EMQX Broker.

The LwM2M Specifications is a Lightweight Machine to Machine protocol.

With emqx_lwm2m, user is able to send LwM2M commands(READ/WRITE/EXECUTE/...) and get LwM2M response in MQTT way. emqx_lwm2m transforms data between MQTT and LwM2M protocol.

emqx_lwm2m needs object definitions to parse data from lwm2m devices. Object definitions are declared by organizations in XML format, you could find those XMLs from LwM2MRegistry, download and put them into the directory specified by lwm2m.xml_dir. If no associated object definition is found, response from device will be discarded and report an error message in log.

Load emqx_lwm2m

./bin/emqx_ctl plugins load emqx_lwm2m

Test emqx-lwm2m using wakaama

wakaama is an easy-to-use lwm2m client command line tool.

Start lwm2mclient using an endpoint name ep1:

./lwm2mclient -n ep1 -h 127.0.0.1 -p 5683 -4

To send an LwM2M DISCOVER command to lwm2mclient, publish an MQTT message to topic lwm2m/<epn>/dn (where <epn> is the endpoint name of the client), with following payload:

{
    "reqID": "2",
    "msgType": "discover",
    "data": {
        "path": "/3/0"
    }
}

The MQTT message will be translated to an LwM2M DISCOVER command and sent to the lwm2mclient. Then the response of lwm2mclient will be in turn translated to an MQTT message, with topic lwm2m/<epn>/up/resp, with following payload:

{
    "reqID": "2",
    "msgType": "discover",
    "data": {
        "code":"2.05",
        "codeMsg": "content",
        "content": [
            "</3/0>;dim=8",
            "</3/0/0>",
            "</3/0/1>",
            "</3/0/4>",
            "</3/0/16>"
        ]
    }
}

LwM2M <--> MQTT Mapping

Register/Update (LwM2M Client Registration Interface)

  • LwM2M Register and Update message will be converted to following MQTT message:

    • Method: PUBLISH
    • Topic: lwm2m/{?EndpointName}/up/resp (configurable)
    • Payload:
      • MsgType register and update:
        {
            "msgType": {?MsgType},
            "data": {
                "ep": {?EndpointName},
                "lt": {?LifeTime},
                "sms": {?MSISDN},
                "lwm2m": {?Lwm2mVersion},
                "b": {?Binding},
                "alternatePath": {?AlternatePath},
                "objectList": {?ObjectList}
            }
        }
        • {?EndpointName}: String, the endpoint name of the LwM2M client
        • {?MsgType}: String, could be:
          • "register": LwM2M Register
          • "update": LwM2M Update
        • "data" contains the query options and the object-list of the register message
        • The update message is only published if the object-list changed.

Downlink Command and Uplink Response (LwM2M Device Management & Service Enablement Interface)

  • To send a downlink command to device, publish following MQTT message:

    • Method: PUBLISH
    • Topic: lwm2m/{?EndpointName}/dn
    • Request Payload:
      {
          "reqID": {?ReqID},
          "msgType": {?MsgType},
          "data": {?Data}
      }
      • {?ReqID}: Integer, request-id, used for matching the response to the request
      • {?MsgType}: String, can be one of the following:
        • "read": LwM2M Read
        • "discover": LwM2M Discover
        • "write": LwM2M Write
        • "write-attr": LwM2M Write Attributes
        • "execute": LwM2M Execute
        • "create": LwM2M Create
        • "delete": LwM2M Delete
      • {?Data}: Json Object, its value depends on the {?MsgType}:
        • If {?MsgType} = "read" or "discover":

          {
              "path": {?ResourcePath}
          }
          • {?ResourcePath}: String, LwM2M full resource path. e.g. "3/0", "/3/0/0", "/3/0/6/0"
        • If {?MsgType} = "write" (single write):

          {
              "path": {?ResourcePath},
              "type": {?ValueType},
              "value": {?Value}
          }
          • {?ValueType}: String, can be: "Time", "String", "Integer", "Float", "Boolean", "Opaque", "Objlnk"
          • {?Value}: Value of the resource, depends on "type".
        • If {?MsgType} = "write" (batch write):

          {
              "basePath": {?BasePath},
              "content": [
                  {
                      "path": {?ResourcePath},
                      "type": {?ValueType},
                      "value": {?Value}
                  }
              ]
          }
          • The full path is concatenation of "basePath" and "path".
        • If {?MsgType} = "write-attr":

          {
              "path": {?ResourcePath},
              "pmin": {?PeriodMin},
              "pmax": {?PeriodMax},
              "gt": {?GreaterThan},
              "lt": {?LessThan},
              "st": {?Step}
          }
          • {?PeriodMin}: Number, LwM2M Notification Class Attribute - Minimum Period.
          • {?PeriodMax}: Number, LwM2M Notification Class Attribute - Maximum Period.
          • {?GreaterThan}: Number, LwM2M Notification Class Attribute - Greater Than.
          • {?LessThan}: Number, LwM2M Notification Class Attribute - Less Than.
          • {?Step}: Number, LwM2M Notification Class Attribute - Step.
        • If {?MsgType} = "execute":

          {
              "path": {?ResourcePath},
              "args": {?Arguments}
          }
          • {?Arguments}: String, LwM2M Execute Arguments.
        • If {?MsgType} = "create":

          {
              "basePath": "/{?ObjectID}",
              "content": [
                  {
                      "path": {?ResourcePath},
                      "type": {?ValueType},
                      "value": {?Value}
                  }
              ]
          }
          • {?ObjectID}: Integer, LwM2M Object ID
        • If {?MsgType} = "delete":

          {
              "path": "{?ObjectID}/{?ObjectInstanceID}"
          }
          • {?ObjectInstanceID}: Integer, LwM2M Object Instance ID
  • The response of LwM2M will be converted to following MQTT message:

    • Method: PUBLISH
    • Topic: "lwm2m/{?EndpointName}/up/resp"
    • Response Payload:
    {
        "reqID": {?ReqID},
        "imei": {?IMEI},
        "imsi": {?IMSI},
        "msgType": {?MsgType},
        "data": {?Data}
    }
    • {?MsgType}: String, can be:
      • "read": LwM2M Read
      • "discover": LwM2M Discover
      • "write": LwM2M Write
      • "write-attr": LwM2M Write Attributes
      • "execute": LwM2M Execute
      • "create": LwM2M Create
      • "delete": LwM2M Delete
      • "ack": CoAP Empty ACK
    • {?Data}: Json Object, its value depends on {?MsgType}:
      • If {?MsgType} = "write", "write-attr", "execute", "create", "delete", or "read"(when response without content):

        {
              "code": {?StatusCode},
              "codeMsg": {?CodeMsg},
              "reqPath": {?RequestPath}
        }
        • {?StatusCode}: String, LwM2M status code, e.g. "2.01", "4.00", etc.
        • {?CodeMsg}: String, LwM2M response message, e.g. "content", "bad_request"
        • {?RequestPath}: String, the requested "path" or "basePath"
      • If {?MsgType} = "discover":

        {
            "code": {?StatusCode},
            "codeMsg": {?CodeMsg},
            "reqPath": {?RequestPath},
            "content": [
                {?Link},
                ...
            ]
        }
        • {?Link}: String(LwM2M link format) e.g. "</3>", "<3/0/1>;dim=8"
      • If {?MsgType} = "read"(when response with content):

        {
            "code": {?StatusCode},
            "codeMsg": {?CodeMsg},
            "content": {?Content}
        }
        • {?Content}
          [
              {
                  "path": {?ResourcePath},
                  "value": {?Value}
              }
          ]
      • If {?MsgType} = "ack", "data" does not exists

Observe (Information Reporting Interface - Observe/Cancel-Observe)

  • To observe/cancel-observe LwM2M client, send following MQTT PUBLISH:

    • Method: PUBLISH
    • Topic: lwm2m/{?EndpointName}/dn
    • Request Payload:
      {
          "reqID": {?ReqID},
          "msgType": {?MsgType},
          "data": {
              "path": {?ResourcePath}
          }
      }
      • {?ResourcePath}: String, the LwM2M resource to be observed/cancel-observed.
      • {?MsgType}: String, can be:
        • "observe": LwM2M Observe
        • "cancel-observe": LwM2M Cancel Observe
      • {?ReqID}: Integer, request-id, is the {?ReqID} in the request
  • Responses will be converted to following MQTT message:

    • Method: PUBLISH
    • Topic: lwm2m/{?EndpointName}/up/resp
    • Response Payload:
      {
          "reqID": {?ReqID},
          "msgType": {?MsgType},
          "data": {
              "code": {?StatusCode},
              "codeMsg": {?CodeMsg},
              "reqPath": {?RequestPath},
              "content": [
                  {
                      "path": {?ResourcePath},
                      "value": {?Value}
                  }
              ]
          }
      }
      • {?MsgType}: String, can be:
        • "observe": LwM2M Observe
        • "cancel-observe": LwM2M Cancel Observe
        • "ack": CoAP Empty ACK

Notification (Information Reporting Interface - Notify)

  • The notifications from LwM2M clients will be converted to MQTT PUBLISH:
    • Method: PUBLISH
    • Topic: lwm2m/{?EndpiontName}/up/notify
    • Notification Payload:
      {
          "reqID": {?ReqID},
          "msgType": {?MsgType},
          "seqNum": {?ObserveSeqNum},
          "data": {
              "code": {?StatusCode},
              "codeMsg": {?CodeMsg},
              "reqPath": {?RequestPath},
              "content": [
                  {
                      "path": {?ResourcePath},
                      "value": {?Value}
                  }
              ]
          }
      }
      • {?MsgType}: String, must be "notify"
      • {?ObserveSeqNum}: Number, value of "Observe" option in CoAP message
      • "content": same to the "content" field contains in the response of "read" command

Feature limitations

  • emqx_lwm2m implements LwM2M gateway to EMQX, not a full-featured and independent LwM2M server.
  • emqx_lwm2m does not include LwM2M bootstrap server.
  • emqx_lwm2m supports UDP binding, no SMS binding yet.
  • Firmware object is not fully supported now since mqtt to coap block-wise transfer is not available.
  • Object Versioning is not supported now.

DTLS

emqx-lwm2m support DTLS to secure UDP data.

Please config lwm2m.certfile and lwm2m.keyfile in emqx_lwm2m.conf. If certfile or keyfile are invalid, DTLS will be turned off and you could read a error message in the log.

License

Apache License Version 2.0

Author

EMQX Team.

emqx-lwm2m's People

Contributors

emqplus avatar gilbertwong96 avatar hjianbo avatar huangdan avatar qingchuwudi avatar rory-z avatar spring2maz avatar terry-xiaoyu avatar tigercl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emqx-lwm2m's Issues

LwM2M in combination with auth_psql

Hi everyone!

I have problems in configuring emqx_lwm2m and emqx_auth_psql plugins together to achieve a username/password authentication. I was curious if that is even possible?

BR,
Patrik Kokol

I can't use the plugin

I have a problem with the plugin.
Here is my log file :

=CRASH REPORT==== 9-Oct-2018::14:34:02.731126 ===
  crasher:
    initial call: emqx_lwm2m_mqtt_adapter:init/1
    pid: <0.2316.0>
    registered_name: []
    exception error: undefined function emqx_protocol:init/3
      in function  emqx_lwm2m_mqtt_adapter:proto_init/5 (src/emqx_lwm2m_mqtt_adapter.erl, line 216)
      in call from emqx_lwm2m_mqtt_adapter:init/1 (src/emqx_lwm2m_mqtt_adapter.erl, line 82) 
      in call from gen_server:init_it/2 (gen_server.erl, line 374)
      in call from gen_server:init_it/6 (gen_server.erl, line 342)
    ancestors: [<0.2315.0>,<0.1946.0>,<0.1945.0>,lwm2m_coap_channel_sup_sup,
                  lwm2m_coap_server,<0.1736.0>]
    message_queue_len: 0
    messages: []
    links: [<0.2315.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 610
    stack_size: 27
    reductions: 265
  neighbours:
    neighbour:
      pid: <0.2315.0>
      registered_name: []
      initial call: lwm2m_coap_responder:init/1
      current_function: {gen_server,loop,7}
      ancestors: [<0.1946.0>,<0.1945.0>,lwm2m_coap_channel_sup_sup,
                  lwm2m_coap_server,<0.1736.0>]
      message_queue_len: 0
      links: [<0.1946.0>,<0.2316.0>]
      trap_exit: false
      status: waiting
      heap_size: 610
      stack_size: 10
      reductions: 514
      current_stacktrace: [{gen_server,loop,7,[{file,"gen_server.erl"},{line,403}]},
                  {proc_lib,init_p_do_apply,3,
                            [{file,"proc_lib.erl"},{line,249}]}]

14:34:02.731 [error] CRASH REPORT Process <0.2316.0> with 1 neighbours crashed with reason: call to undefined function emqx_protocol:init({{172,28,3,131},5683}, #Fun<emqx_lwm2m_mqtt_adapter.25.74916560>, [{max_clientid_len,96},{max_packet_size,512}])
=SUPERVISOR REPORT==== 9-Oct-2018::14:34:02.734029 ===
    supervisor: {<0.1946.0>,lwm2m_coap_responder_sup}
    errorContext: child_terminated
    reason: {undef, 
                [{emqx_protocol,init,
                     [{{172,28,3,131},5683},
                      #Fun<emqx_lwm2m_mqtt_adapter.25.74916560>,
                      [{max_clientid_len,96},{max_packet_size,512}]],
                     []},
                 {emqx_lwm2m_mqtt_adapter,proto_init,5,
                     [{file,"src/emqx_lwm2m_mqtt_adapter.erl"},{line,216}]},
                 {emqx_lwm2m_mqtt_adapter,init,1,
                     [{file,"src/emqx_lwm2m_mqtt_adapter.erl"},{line,82}]},
                 {gen_server,init_it,2,[{file,"gen_server.erl"},{line,374}]},
                 {gen_server,init_it,6,[{file,"gen_server.erl"},{line,342}]},
                 {proc_lib,init_p_do_apply,3,
                     [{file,"proc_lib.erl"},{line,249}]}]}
    offender: [{pid,<0.2315.0>},
               {id,{{172,28,3,131},5683}},
               {mfargs,{lwm2m_coap_responder,start_link,undefined}},
               {restart_type,temporary},
               {shutdown,5000},
               {child_type,worker}]
14:34:02.734 [error] Supervisor {<0.1946.0>,lwm2m_coap_responder_sup} had child {{172,28,3,131},5683} started with {lwm2m_coap_responder,start_link,undefined} at <0.2315.0> exit with reason call to undefined function emqx_protocol:init({{172,28,3,131},5683}, #Fun<emqx_lwm2m_mqtt_adapter.25.74916560>, [{max_clientid_len,96},{max_packet_size,512}]) in context child_terminated

thanks

LWM2M with DTLS and PSK

Hi,

I'm trying to use LWM2M plugin with DTLS and PSK in version 4.3.7 but without any success.
In emqx.conf I commented out listener.ssl.external.ciphers and uncommented listener.ssl.external.psk_ciphers.
I enabled the emqx_psk_file plugin.
In psk.txt file I entered my client id and key (myclientId:C127D993068150012D74863733313864F26932C7E707E724A479BBA730580538).
In emqx_lwm2m.conf I commented out lwm2m.dtls.ciphers and uncommented lwm2m.dtls.psk_ciphers.
Then I restarted EMQX.

Now if I try to connect using leshan client I get the following exception:

2021-08-27 16:29:51,735 INFO LeshanClientDemo - DTLS Full Handshake initiated by client : STARTED ...
2021-08-27 16:29:51,750 INFO DefaultRegistrationEngine - Unable to send register request : Received 'fatal alert/INSUFFICIENT_SECURITY'
2021-08-27 16:29:51,750 INFO LeshanClientDemo - DTLS Full Handshake initiated by client : FAILED (Received 'fatal alert/INSUFFICIENT_SECURITY')

Leshan client command that I use:
java -jar .\leshan-client-demo.jar -n myclientId -u localhost:5684 -i myclientId -p C127D993068150012D74863733313864F26932C7E707E724A479BBA730580538

In the log file I can see:

2021-08-27T16:44:04.480000+02:00 [notice] DTLS server: In state hello at dtls_handshake.erl:194 generated SERVER ALERT: Fatal - Insufficient Security
2021-08-27T16:44:04.480000+02:00 [error] supervisor: 'esockd_connection_sup - <0.442.0>', errorContext: connection_shutdown, reason: {ssl_error,{tls_alert,{insufficient_security,"DTLS server: In state hello at dtls_handshake.erl:194 generated SERVER ALERT: Fatal - Insufficient Security\n"}}}, offender: [{pid,<0.1333.0>},{name,connection},{mfargs,{lwm2m_coap_channel,start_link,[[{lifetime_max,86400},{lifetime_min,1},{mountpoint,<<"lwm2m/%e/">>},{port,5683},{auto_observe,false},{qmode_time_window,0},{update_msg_publish_condition,contains_object_list},{topics,[...]}]]}}]

Could you please help me, I don't find any more help in the docu..

Thank you in advance and best regards,
Sonny

About “Create”

示例中的红色底色的是必须的意思吗?
还有,可以给一个create的范例吗?

Errors in README.md

Hi, thank you for a great project. This plugin is very useful.

I want to inform that some details in the readme seems to be incorrect.

For example, {?RequestPath} is missing from the observe/notify payloads. {?ResourceName} does not exist and {?ValueType} is not included in the responses. There is likely a copy-past error in the explanation of the delete-response.

DTLS + PSK support

It seems EMQx in general has DTLS + PSK support for devices. Can this be utilised with the LwM2M plugin?

Also, is there support for reading the PSK secrets from a database?

If not, I would like to request these features.

Updates not published on MQTT

Thank you for a great plugin.

I have experienced some issues with the update-topic, configured in lwm2m.topics.update. An update is only published on MQTT if the CoAP payload contains the list of Objects and Object Instances. I.e. if the list is empty, nothing will be published.

Below is two examples, one successful and one failure. The only difference is that the successful case has a non-empty object list.

SUCCESS (update does get MQTT published):

([email protected])1> 2020-08-27 14:39:00.991 [debug] LWM2M-RESOURCE: <0.2150.0> {{10,36,0,72},36563} GET Query=[<<"lt=60">>], Content={coap_content,
                                                                                  undefined,
                                                                                  60,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  [<<"lt=60">>],
                                                                                  [<<"rd">>,
                                                                                   <<"urn:imei:1234567890">>],
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  <<"</>;rt=\"oma.lwm2m\";ct=11543,</34120/0>,</34124>,</34121/0>,</34122/0>,</34123/0>,</1/0>,</3/0>,</5/0>">>}
([email protected])1> 2020-08-27 14:39:00.991 [debug] LWM2M-RESOURCE: <0.2150.0> {{10,36,0,72},36563} UPDATE command location=[<<"rd">>,
                                                                         <<"urn:imei:1234567890">>], Query=[<<"lt=60">>], Content={coap_content,
                                                                                                                                        undefined,
                                                                                                                                        60,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        [<<"lt=60">>],
                                                                                                                                        [<<"rd">>,
                                                                                                                                         <<"urn:imei:1234567890">>],
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        <<"</>;rt=\"oma.lwm2m\";ct=11543,</34120/0>,</34124>,</34121/0>,</34122/0>,</34123/0>,</1/0>,</3/0>,</5/0>">>}
([email protected])1> 2020-08-27 14:39:00.992 [info] PUBLISH to lwm2m/urn:imei:1234567890/up/update: <<"{\"msgType\":\"update\",\"data\":{\"objectList\":[\"/34120/0\",\"/34124\",\"/34121/0\",\"/34122/0\",\"/34123/0\",\"/1/0\",\"/3/0\",\"/5/0\"],\"lwm2m\":\"1.0\",\"lt\":60,\"ep\":\"urn:imei:1234567890\",\"alternatePath\":\"/\"}}">>
([email protected])1> 2020-08-27 14:39:00.992 [debug] LWM2M-TIMER: start_timer of 60 secs
([email protected])1> 2020-08-27 14:39:00.992 [debug] LWM2M-PROTO: Update RegInfo to: #{<<"alternatePath">> => <<"/">>,
                                  <<"ep">> => <<"urn:imei:1234567890">>,
                                  <<"lt">> => 60,<<"lwm2m">> => <<"1.0">>,
                                  <<"objectList">> =>
                                      [<<"/34120/0">>,<<"/34124">>,
                                       <<"/34121/0">>,<<"/34122/0">>,
                                       <<"/34123/0">>,<<"/1/0">>,<<"/3/0">>,
                                       <<"/5/0">>]}
([email protected])1> 2020-08-27 14:39:00.993 [info] LWM2M-RESOURCE: {{10,36,0,72},36563}, UPDATE Success, assgined location: <<"/rd/urn:imei:1234567890">>

FAILURE (no MQTT publish):

([email protected])1> 2020-08-27 14:39:05.622 [debug] LWM2M-RESOURCE: <0.1856.0> {{10,36,0,72},50262} GET Query=[<<"lt=60">>], Content={coap_content,
                                                                                  undefined,
                                                                                  60,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  [<<"lt=60">>],
                                                                                  [<<"rd">>,
                                                                                   <<"urn:imei:1234567890">>],
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  undefined,
                                                                                  <<>>}
([email protected])1> 2020-08-27 14:39:05.622 [debug] LWM2M-RESOURCE: <0.1856.0> {{10,36,0,72},50262} UPDATE command location=[<<"rd">>,
                                                                         <<"urn:imei:1234567890">>], Query=[<<"lt=60">>], Content={coap_content,
                                                                                                                                        undefined,
                                                                                                                                        60,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        [<<"lt=60">>],
                                                                                                                                        [<<"rd">>,
                                                                                                                                         <<"urn:imei:1234567890">>],
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        undefined,
                                                                                                                                        <<>>}
([email protected])1> 2020-08-27 14:39:05.622 [debug] LWM2M-TIMER: start_timer of 60 secs
([email protected])1> 2020-08-27 14:39:05.623 [debug] LWM2M-PROTO: Update RegInfo to: #{<<"alternatePath">> => <<"/">>,
                                  <<"ep">> => <<"urn:imei:1234567890">>,
                                  <<"lt">> => 60,<<"lwm2m">> => <<"1.0">>,
                                  <<"objectList">> =>
                                      [<<"/34120/0">>,<<"/34124">>,
                                       <<"/34121/0">>,<<"/34122/0">>,
                                       <<"/34123/0">>,<<"/1/0">>,<<"/3/0">>,
                                       <<"/5/0">>]}
([email protected])1> 2020-08-27 14:39:05.623 [info] LWM2M-RESOURCE: {{10,36,0,72},50262}, UPDATE Success, assgined location: <<"/rd/urn:imei:1234567890">>

To clearify ... I expected to see
([email protected])1> 2020-08-27 14:39:00.992 [info] PUBLISH to lwm2m/urn:imei:1234567890/up/update: <<"{\"msgType\":\"update\",\"data\":{\"objectList\":[\"/34120/0\",\"/34124\",\"/34121/0\",\"/34122/0\",\"/34123/0\",\"/1/0\",\"/3/0\",\"/5/0\"],\"lwm2m\":\"1.0\",\"lt\":60,\"ep\":\"urn:imei:1234567890\",\"alternatePath\":\"/\"}}">>
in the FAILURE case - but it is missing.

DTLS and x509

Hello,
I am trying to connect with leshan client demo to emqx with DTLS. I am following the steps in of x509 part:
https://github.com/eclipse/leshan/wiki/Credential-files-format
In order to launch the leshan client demo I have to pass ccert, cprik, scert. I generate only ccert and cprik and I am not sure where to get scert .der file. I found the cacert.pem in emqx/etc/certs the file cacert.pem and I tried to convert it to .der with command:
openssl x509 -outform der -in cacert.pem -out serverCert.der
However if I pass this serverCert.der file to leshan client demo I get error:

java -jar leshan-client-demo.jar -n hitx -u 192.168.1.100:5683 -ccert crtx509/self_signed_cert.der -cprik crtx509/cprik.der -scert crtx509_emq/serverCert.der

Unable to load X509 files : X.509 algorithm is not supported, Only EC algorithm is supported java.security.cert.CertificateException: X.509 algorithm is not supported, Only EC algorithm is supported at org.eclipse.leshan.core.util.SecurityUtil$3.decode(SecurityUtil.java:61) at org.eclipse.leshan.core.util.SecurityUtil$3.decode(SecurityUtil.java:53) at org.eclipse.leshan.core.credentials.CredentialsReader.decode(CredentialsReader.java:58) at org.eclipse.leshan.core.credentials.CredentialsReader.readFromFile(CredentialsReader.java:38) at org.eclipse.leshan.client.demo.LeshanClientDemo.main(LeshanClientDemo.java:407) usage: java -jar leshan-client-demo.jar [OPTION]

I also read https://docs.emqx.io/broker/v3/en/protocol.html
I can see here at EMQX-LWM2M plugin Configurations, that the port is mentioned 5683, however in the table below it is 5783. Can you clarify which port should be written in emqx_lwm2m.conf?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.