There are two methods to create devices:
- Create one device at a time using the web interface (recommended for tests or if you have to register few devices) see https://www.snap4city.org/590
- Create all the devices at once (bulk load) using a CSV file in which are specified the information of the devices and their sensors: see THE ONE PRESENTED IN THIS PAGE
Type of user: Tool Admin
Features: This procedure allows you to create new devices based on the newly created IoTModel
General guidelines to create new Devices:
- Bulk guidelines with file example: https://www.snap4city.org/drupal/node/289
- Create a csv file containing the static information of each individual sensor of each device
- To automatically generate the csv file, see the section IoTApp – Static Data
- Upload the created csv file on Snap4City platform
Guidelines on csv file structure accepted by the platform:
- The csv file must contain the following columns, and where each row corresponds to a device sensor:
- name, devicetype, mac, frequency, kind, protocol, format, producer, lat, long, valuename, data_type, value_type, editable, value_unit, health_criteria, healthiness_value, K1, k2
- The csv file must conform to the created model (each row of the csv corresponds to a Device Model sensor)
- To download a csv template conformant to the chosen model, please press the button EXPORT available on the Model view, under the chosen model, in the section visible with pressing the button +
- Device nomenclature (“name” column): always insert an indicative prefix of the Device Model (e.g. “[deviceID]” -> “FlorenceAirQuality_[deviceID]” where deviceID is a string that identifies the single device)
- Spaces in names are not allowed because the name is used to compose URI, also for this reason the name, once assigned to the device, cannot be changed
- It would be a good practice to test with test sensors to avoid incorrect entries
- There must be no devices with coincident geographic coordinates (the decimal places taken into consideration by the system are 5, if you change the fifth, two points are not coincident)
- K1 and K2:
- K1 and K2 are the keys necessary to read and write access to the device. They must be different from each other.
- Each group of devices, that has the same IoTModel, should have the same K1 and K2 because, in this way, it is possible to read or write all the devices of the same group at the same time.
- These keys are in the UUID v4 format and can be generated online on this website: https://www.uuidgenerator.net/
Florence Charging Stations (open data municipality of Florence) – Florence organization
As can be seen from the model in the previous examples, Florence Charging Stations has five sensors, so each device will have five lines (one for each sensor).
CSV file (only two devices are shown):
Guidelines to upload the csv file: ………….in progress………….