Closed djDuff closed 5 years ago
Thank you for spotting the missing description regarding MULTIPLE_RESOURCE
.
For the first question, here is how to define MULTIPLE_RESOURCE
type value in JSON format:
(will update README.md)
MULTIPLE_RESOURCE
The type is a collection having Resource Instance ID and Resource value pairs.
{
"type": "MULTIPLE_RESOURCE",
"value": {
"100": 999,
"101": true,
"999": {
"type": "FLOAT",
"value": 987654.321
}
}
}
If the Resource Instance ID starts with "0" and its following IDs are 1,2,3... (increases by 1), you can provide a JSON Array like this.
{
"type": "MULTIPLE_RESOURCE",
"value": [
123,
false,
{
"type": "FLOAT",
"value": 1234.567
}
]
}
This is equivalent to:
{
"type": "MULTIPLE_RESOURCE",
"value": {
"0": 123,
"1": false,
"2": {
"type": "FLOAT",
"value": 1234.567
}
}
}
And in terms of the second one, you cannot provide the string value in Payload as you showed. Instead, you need to use JSON format in Payload.
JSON
rather than az
(string) in the typed input area) could be like this:{
"0": "10.29.8.45"
}
or
["10.29.8.45"]
/4/0/4
The Resource Instance ID (0
) cannot be included in URI at all.
@dbaba san, thank you! I tested: Part 1 - it is correct, Part 2 - only "array" format works correctly Inject node, topic /4/0/4
Payload returns error
{ "0": "10.29.8.45" }
"lwm2m error" in debug window: format is object
["10.29.8.45"]
works correctly:
all ok in Debug window, data is sent correctly. The only difference, format is array here
@djDuff My fault! Found the issue and will fix it soon. Thanks!
How do I send measurements for a multiple ressource definition? Lets say I have /6/0 (location object) with ressource /0 (latitude) and /1 (longitude). msg.topic /6/0 and payload { "0" : 46.123 , "1": 9.345} dos not work.
@dbaba san, According to OMA spec, there are multiple instance resources. For example, in SmartObject "Connectivity Monitoring", resource "Ip Address" is Multiple Instance. It means, I need to send values as /4/0/4/0 =
How can I do this using node-red-contrib-lwm2m ?
1. Define Object I need to define this object in Objects of Client Out node. How? i didn't find example in https://github.com/CANDY-LINE/node-red-contrib-lwm2m#management-object-json-format But there is
Well, I was thinking about this format -> but this doesn't work
1. Send data using Inject node I was thinking about using this format - is it correct way to send measurements for resource instance?
Regards, Andrey