overview on IOT directory and management:
Some devices can be more easy to be registered and thus be connected and used in the platform and exploited in the dashboards and IOT applications. In order to guarantee the security from the device to the cloud (IOT Brokers) both have to support TLS that means in most cases HTTPS and authentication. To this end, in most of our cases we work with HTTPS and in addition to increase security we avoid to perform authentication on the basis of username and password, but we use a couple of KEYS for each device which aer generated by the system, our IOT Directory or SigFOX Portal and Service, for example.
The registration of an IOT Device always starts from the IOT Directory https://iotdirectory.snap4city.org by pressing the "New Device" button. The registration is strongly simplified for final users, while developers may have more control on the paramters of IOT Devices. In any cases, all parameters are accessible for all users. The IOT Devices easy be registered can be classified in the following cases, for each case there are some models to simplify the registration process. During the registration the IOT Directory is asking you the IOT Device MODEL, so that please read the following classification to identify the MODEL of your IOT Device. Then the registration is also asking you the geo position and the NAME ID you would like to assign at the device.
A) Raspberry totally compliant with Snap4City: those having a Raspberry operating system created by starting from our image of the SD, 32Gbyte. They include in the SD an IOT Application based on NodeRED and can be registerd in short timeform IotDirectory. They may have a predefined IOT Model defining also the set of connected sensors, which is coded in the SD, for example:
- Model 001: two temperature, two humidity sensors obtained connecting two DHT11, DHT22 sensors
- Model 002: one temperature, one humidity, one relay, one proximity sensor ultrasoun
Once inserted the Model, in the registration on the IOT Directory, it also asked to provide DEVICE NAME ID and the position on the map of the IOT device. Thus as a second step IOT Directory is providing you a couple of Keys: K1, K2 (in some cases Username and Password) to perform the safe registration and establish a secure communication level from the device to the platform. Those Keys have to be included into the registration block in the IOT Application, together with the NAME ID, you assigned. Therefore, the IOT Application and thus the IOT device performs the self registration, and your IOT Device will appear with its list of sensors/actuators according to the model selected into the IOT Directory, and in the Dashboard Wizard table on your Private devices/sensors/actuators. Your IOT Device will be automatically registered in your profile in the ownership table and also the VariableNames of the corresponding sensors will be assigned to you. Follow this link to create your own IOT device Raspberry totally compliant with Snap4City
B) Arduino base sensors, with code based on Snap4City (see details on page Snap4City: Arduino & ESP8266 IOT Device NGSI): those having an Arduino operating system created by starting from our image of the SD. They may have a predefined IOT Model defining also the set of connected sensors, for example:
- Model 003: two temperature, two humidity sensors obtained connecting two DHT11, DHT22 sensors
- Model 004: one temperature, one humidity, one relay, one proximity sensor ultrasound
We can provide code for programming them: the code can read sensors, and in the code itself one has to inserte some parameter.
Once inserted the Model, in the registration on the IOT Directory, it is also asked to provide DEVICE NAME ID and the position on the map of the IOT Device. Thus as a second step the IOT Directory is providing you: (i) a couple of Keys: K1, K2 (in some cases Username and Password) to perform the safe registration and establish a secure communication level fro mthe IOT Device to the platform, (ii) a URL of the assigned IOT Broker. All these parameters (K1, K2, NAMEID and URL of the BROKER) have to be inserted in the specific parts of the C code provided. Then you have to compile the Code and load into the Arduino and put in execution as usually done in those devices. Thus put in running the registration will be finalized by the Device and will be completed. Your device will appear in the IOT Directory with its list of sensor/actuator according to the model selected, and in the Dashboard Wizard table on your Private devices/sensors/actuators. Your IOT Device will be automatically registered in your profile in the ownership table and also the VariableNames of the corresponding sensors will be assigned to you.
C) SigFOX: you can buy a SigFOX device from the market and connect to the system. After the registration of the device on the SigFOX portal you can get from that portal a couple of keys K1, K2, and the ID (device name assigned by the builder, it is also writte on the box). They will be useful for the registration of the SigFOX IOT Device on Snap4City. These sensors may have a predefined IOT Model defining also the set of connected sensors, for example:
- Model 005: one temperature sensor obtained connecting a DHT11 or DHT22 sensor.
Then selecting Model 005, the IOT Directory recognises that you are asking for registering a SigFOX device and will pass to ask you: (i) IOT Device DEVICE NAME ID(accessible on the box of the sensor), (ii) the position of your device (on the map), (iii) K1 and K2, (iv) ValueName (what is passed in the field Data of SigFOX), (v) ValueType (type of the ValueName passed into the field Data of SigFox). Thus the registration is completed and your Sig FOX IOT Device will appear with its list of sensor/actuator according to the model selected, and in the Dashboard Wizard table. All the values you have been asked to insert will be used by the system to create an IOT Application which will play the role of IOT broker for your sensor. So that, it will be accessible as the other sensors of the Snap4City Solution. Your IOT Device will be autoamtically registered in your profile in the ownership table and also the VariableNames of the corresponding sensors will be assigned to you.
see also: TC2.16
E) none of the above your IOT Device is not compliat to one of the above described MODELS. Thus you have to pass at the manual registration where a higher number of parameters will be requested. The registration performed so far wil be considered a first first of the full registration, so that you have not lost time in following the above procedure. As a first step you need to understand:
- IOT protocol used, the sensors you have in the device, their ValueName, ValueType, ValueUnit (for the definition see the Dashboard Wizard examples)
- verify if the Snap4City has an IOT Broker that potentially is capable to cope with it, see the list of Broker on IOT Directory.
- see how the IOT device you have can be configured.
- set if you perform an IOT Connection based on Keys (K1, K2), or authentication (Username, password), or NONE; (for each of these cases, additional parameters will be asked/generated)
- Insert these paramerers in the editing of your draft IOT Device to complete the IOT Registration.
- the IOT Directory is going to ask/generate for you K1,K2
- test the connection and sensor reading.
If, despite to have followed the above procedure, you still have not been capable to succesfully complete the registration and access data, you can still connect your IOT device if its communication protocol is supported by the IOT Application microservices click here. In that case, you can create an IOT Application or a simple IOT Application Flow in an application you already have to simply reading the sensor and transforming the read data/message on some output message of the provided IOT Application toward some working IOT Broker: see the list on the IOT Directory. For example, one can directly connect your SixFOX devices from your IOT Application using the MicroService SigFOX and inserting K1,K2 in that block.
In all cases, as soon as you have completed the registration, you can seen the list of IOT Device sensors/actuators with their ValueName and ValueType. For example Temp1 and Temperature. You can refer to those ValueNames to get the data into the IOT Application and Dashboard. If you would like to change other parameter of the IOT Device you can still do it, as you can see all paramter by clicking on the + on the left side in the IOT Device/sensors table.
Similarly, you can find your IOT Device sensor/actuators into the Wizard of the Dashboard Buillder tool, where you can select the data for your dashboards, and you can even decide to create an IOT application, if you need to define some logic or mathematics behind your Dashboard.