Task 1: Setting Up an Air Quality Node Using oneM2M
Objective: This assignment will guide you in creating an Application Entity (AE) for an Air
Quality Node on a oneM2M platform. You will configure containers, instances, and a database,
and set up API subscriptions. The focus is on understanding how an IoT device’s data can be
structured, managed, and retrieved in a simulated environment.
Instructions
1. Create an Application Entity (AE)
o Define an Application Entity with the name format: "AE-AirQualityNode".
o Confirm the AE is correctly created and ready for data.
2. Create Containers
o Create a main container with the name "AirQualitySensor" to hold device data.
o Add two sub-containers within it:
Descriptor Container: Holds metadata about the sensor, such as type and
location.
Data Container: Stores the actual sensor data points.
3. Define Content Instances
o Descriptor Content Instance: Create one content instance within the Descriptor
Container. This should describe the sensor details, like:
Sensor type: Air Quality
Measurement type: PM2.5, CO2, Temperature, Humidity
Location: Specify a sample location
o Data Container Content Instances:
Add at least 5 content instances in the Data Container with random data
for each sensor measurement (PM2.5, CO2, Temperature, Humidity).
Use Postman or a python script to simulate and post random data values
for each measurement.
4. Data Retrieval
o Retrieve and display:
The latest data instance from the Data Container.
The oldest data instance in the Data Container.
All data points from the Data Container.
5. Delete Descriptor Container
o Delete the Descriptor Container to observe the effects on the AE and data flow.
6. Create an API for Subscriptions
o Write an API to manage subscriptions with robust validation and exception
handling. The API should:
Validate correct input format for subscriptions.
Provide error messages for incorrect inputs or missing fields.
7. Create a Subscription
o Set up a subscription for the Air Quality Node.
8. Database Creation
o Design a database with relevant tables to store sensor data and subscription logs.
o Ensure the database can capture the complete flow, from AE creation to data
storage.
Deliverables
Screenshots and API call results for each task.
Code files for the API and database setup(will update if its mandatory)
A brief report summarizing each step(Screen Recording and Report) and any challenges
faced.