Events

Events#

IoT devices often trigger events. An event is a significant change in the state of a device or its environment. As an example, there could be a machine that is monitored by an IoT device using multiple sensors. An event is triggered by an unusual combination of sensor readings. It is important to aggregate several states into a single event, so an application in the cloud can analyze the event in detail to know the environmental conditions at that moment.

The database model defines the Events table that represents events generated by endpoints.

Events via LwM2M Send#

In order to group multiple resources together in an unambiguous way, the IoT device (endpoint) sends them in one LwM2M Send. Leshan forwards the Send with all its values to Django. Django stores the individual resources in the database. If the Send contains more than one path or more than one timestamp, Django also creates a new event. The individual resources within the event may have individual timestamps, the event itself has a separate timestamp in addition. See Gateway Contract for the request format.