CANDY-LINE / node-red-contrib-lwm2m

Step-by-step tutorial is available at
http://candy-line.tumblr.com/post/166976363228/oma-lwm2m-node-red-node
Apache License 2.0
7 stars 3 forks source link

Write Boolean resource always true #5

Closed sblabreu closed 6 years ago

sblabreu commented 6 years ago

Hi,

Testing a write boolean operation from Server to lwm2m client and the node always respond with true

See example:

Write FALSE From LwM2M Server

2088 133.528924155 104.40.191.33 100.93.48.204 CoAP 105 CON, MID:6083, PUT, TKN:f8 45 4b 3d a8 1f 2d f5, /3306/0/5850

Frame 2088: 105 bytes on wire (840 bits), 105 bytes captured (840 bits) on interface 0 Linux cooked capture Internet Protocol Version 4, Src: 104.40.191.33, Dst: 100.93.48.204 User Datagram Protocol, Src Port: 5684, Dst Port: 56830 Datagram Transport Layer Security Constrained Application Protocol, Confirmable, PUT, MID:6083 01.. .... = Version: 1 ..00 .... = Type: Confirmable (0) .... 1000 = Token Length: 8 Code: PUT (3) Message ID: 6083 Token: f8454b3da81f2df5 Opt Name: #1: Uri-Path: 3306 Opt Name: #2: Uri-Path: 0 Opt Name: #3: Uri-Path: 5850 Opt Name: #4: Content-Format: application/vnd.oma.lwm2m+tlv End of options marker: 255 [Response In: 2089] [Uri-Path: /3306/0/5850] Payload: Payload Content-Format: application/vnd.oma.lwm2m+tlv, Length: 4 Payload Desc: application/vnd.oma.lwm2m+tlv [Payload Length: 4] > Lightweight M2M TLV 55830: TLV header Value: 00 As String: As Integer: 0 As Boolean: False

2089 133.530104274 100.93.48.204 104.40.191.33 CoAP 85 ACK, MID:6083, 2.04 Changed, TKN:f8 45 4b 3d a8 1f 2d f5, /3306/0/5850

Frame 2089: 85 bytes on wire (680 bits), 85 bytes captured (680 bits) on interface 0 Linux cooked capture Internet Protocol Version 4, Src: 100.93.48.204, Dst: 104.40.191.33 User Datagram Protocol, Src Port: 56830, Dst Port: 5684 Datagram Transport Layer Security Constrained Application Protocol, Acknowledgement, 2.04 Changed, MID:6083 01.. .... = Version: 1 ..10 .... = Type: Acknowledgement (2) .... 1000 = Token Length: 8 Code: 2.04 Changed (68) Message ID: 6083 Token: f8454b3da81f2df5 [Request In: 2088] [Response Time: 0.001180119 seconds] [Uri-Path: /3306/0/5850]

I think this is where the error happends

I do not understand this message back why true??

2092 133.531220068 100.93.48.204 104.40.191.33 CoAP 95 NON, MID:42534, 2.05 Content, TKN:a1 4d 13 28 c9 76 a9 40, /3306/0/5850

Frame 2092: 95 bytes on wire (760 bits), 95 bytes captured (760 bits) on interface 0 Linux cooked capture Internet Protocol Version 4, Src: 100.93.48.204, Dst: 104.40.191.33 User Datagram Protocol, Src Port: 56830, Dst Port: 5684 Datagram Transport Layer Security Constrained Application Protocol, Non-Confirmable, 2.05 Content, MID:42534 01.. .... = Version: 1 ..01 .... = Type: Non-Confirmable (1) .... 1000 = Token Length: 8 Code: 2.05 Content (69) Message ID: 42534 Token: a14d1328c976a940 Opt Name: #1: Observe: 3 Opt Name: #2: Content-Format: application/vnd.oma.lwm2m+tlv End of options marker: 255 [Request In: 1212] [Response Time: 48.726789312 seconds] [Uri-Path: /3306/0/5850] Payload: Payload Content-Format: application/vnd.oma.lwm2m+tlv, Length: 4 Payload Desc: application/vnd.oma.lwm2m+tlv [Payload Length: 4] Lightweight M2M TLV 55830:  TLV header Value: 01 As String: \001 As Integer: 1 As Boolean: True

I have the following objects configured on the client

{
    "3306": {
        "0": {
            "5850": {
                "type": "BOOLEAN",
                "acl": "RW",
                "value": false
            }
        }
    },
    "3316": {
        "0": {
            "5821": {
                "type": "STRING",
                "acl": "RW",
                "value": "Remi"
            }
        }
    }
}

My application relies on the response from the client (in this case True) to confirm the status.

dbaba commented 6 years ago

Sorry for late response. I fixed it. The coming release includes the update.

dbaba commented 6 years ago

Can you please try it again with 1.3.0?

sblabreu commented 6 years ago

Thanks, Works for Boolean/String Great work.

I took the chance to test remaining types and see similar issue for Float/Integer.

{"type":"FLOAT","acl":"RW","value":null}

{"type":"INTEGER","acl":"RW","value":null}