Skip to content

bethago/TinyIoT_Resource_Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyIoT Resource Generator

This project is a Python script designed to generate entities on a TinyIoT server based on a JSON file created by the oneM2M Design Tool.

📌 Description

The script reads JSON files located in the /data/ folder and sends requests to a TinyIoT server to create entities such as AE (Application Entity) and CNT (Container) in the specified order.

📌 Requirements

  • Python 3.x
  • requests library (Install using pip install requests)

🔧 Setup

  1. Clone this repository.
  2. Place your JSON files in the /data/ folder.
  3. Install the requests library:
pip install requests

📌 Configuration

The server URL is set to http://127.0.0.1:3000/. You can change it in the resourceGenerator.py file:

SERVER_URL = 'http://127.0.0.1:3000/'

🚀 Usage

Run the script with Python:

python resourceGenerator.py

You will see a prompt listing all the JSON files available in the /data/ folder. Enter the number corresponding to the file you want to use.

Example Output

[0] testdata.json
[1] yourdata.json
Enter the number of the file you want to read: 0
AE 'myAE1' is ready.
AE 'myAE2' is ready.
CNT 'myCNT4' is ready under 'TinyIoT/myAE2'.
CNT 'myCNT1' is ready under 'TinyIoT/myAE1'.
CNT 'myCNT2' is ready under 'TinyIoT/myAE1'.
CNT 'myCNT3' is ready under 'TinyIoT/myAE1'.
CNT 'mySUBCNT1' is ready under 'TinyIoT/myAE1/myCNT1'.
CNT 'mySUBCNT2' is ready under 'TinyIoT/myAE1/myCNT1'.
CNT 'mySUBCNT3' is ready under 'TinyIoT/myAE1/myCNT1'.

📌 JSON File Example

The JSON files can be generated by the oneM2M Design Tool or you can make it yourself. Generated JSON files must be placed in the /data/ folder. The tool generates files that describe entities hierarchically.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages