Project to create "N" number of devices, send data from "N" number devices to an IOT hub.
Steps to follow
-
Open the "Constants.Java" file and fill up below values
a. Connection String - It is IOT Hub connection String you have send the simulated values.
b. no of Device - Total number of devices you have to create for your simulation
c. interval_Seconds - Time interval the simulation has to send data into IOTHub.
d. deviceIdPrefix - It the prefix we will used to create unique device Id's. Numbers will be appended into devicePrefix to generate unique id.
e. avgTemp - Avg temperature to use to mock the data.
f. avgHumidity - Avg Humidity to use to mock the data.
g. scale- Scale needs to use to generate mock data.
-
Run CreateDevice.java file to create the devices. It will print the device id and primary key, if it created successfully.
The code is fail safe. It don't create duplicate device. if you re-run again.
-
By default, we are sending auto simulated temperature and humidity information to IOT Hub.
if you like to add more information, change the POJO "MessageSender.java".
-
Run "App.java" to start sending the values
We did it.
All the best.
Please feel free to contribute.