Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wip/jonas rem/implement send operation #75

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

jonas-rem
Copy link
Member

@jonas-rem jonas-rem commented Sep 11, 2024

TODO:

  • Test
  • update documentation.

When using the LWM2M SEND operation, leshan uses a different format,
called timestamped. In order to process SEND requests, this commit adds
a new timestamped serializer.

An Endpoint can send multiple resources with the SEND request at once.
In case multiple endpoints are send, django summarizes all of them
(regardless of the object) and links them to a new event. The name of
the event is the object of the first resource. In the example payload
below, the event name would be "3303".

Example SEND Operation:

{
  "ep" : "urn:imei:100000000000000",
  "val" : {
    "empty" : false,
    "timestamps" : [ null ],
    "nodes" : {
      "/3303/0/5700" : {
        "kind" : "singleResource",
        "id" : 5700,
        "type" : "FLOAT",
        "value" : "21.13306311567618"
      },
      "/3304/0/5700" : {
        "kind" : "singleResource",
        "id" : 5700,
        "type" : "FLOAT",
        "value" : "54.92426540118741"
      }
    }
  }
}

@jonas-rem jonas-rem force-pushed the WIP/jonas-rem/implement_send_operation branch from 9980160 to 3f7155d Compare September 14, 2024 08:41
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
When using the LWM2M SEND operation, leshan uses a different format,
called timestamped. In order to process SEND requests, this commit adds
a new timestamped serializer.

An Endpoint can send multiple resources with the SEND request at once.
In case multiple endpoints are send, django summarizes all of them
(regardless of the object) and links them to a new event. The name of
the event is the object of the first resource. In the example payload
below, the event name would be "3303".

Example SEND Operation:
{
  "ep" : "urn:imei:100000000000000",
  "val" : {
    "empty" : false,
    "timestamps" : [ null ],
    "nodes" : {
      "/3303/0/5700" : {
        "kind" : "singleResource",
        "id" : 5700,
        "type" : "FLOAT",
        "value" : "21.13306311567618"
      },
      "/3304/0/5700" : {
        "kind" : "singleResource",
        "id" : 5700,
        "type" : "FLOAT",
        "value" : "54.92426540118741"
      }
    }
  }
}

Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Observe operations are currently problematic. The observations become
invalid, in case the endpoint changes it's ip address, route or port.
Once DTLS is activated, observe operations should work reliably.

For sending temperature values or generally frequent sensor values, send
operations are better suited anyways as each value is guaranteed to be
send. With observe operations, only the most recent value is send.

Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Redis showed some instabilities, this commit adds logging to the common
logging files. In addition it sets the memory usage to max 20 MB and
disables persistence.

Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
@jonas-rem jonas-rem force-pushed the WIP/jonas-rem/implement_send_operation branch from 3f7155d to 75e4c1e Compare September 14, 2024 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant