Concerning the design and implementation of the gateway device, there are significant differences with respect to the device which measures air pollution (publisher). The functionality of this gateway is simple; on the one hand, to receive the data collected by the different publishers that are capturing measurements by the city and, on the other hand, to upload the sensor information both to our database (CouchDB) and to the OrganiCity technical environment. To achieve these goals, the Technical University of Cartagena group has implemented the appropriate software to provide the gateway with the appropriate functions. The programmed code satisfies the following features: (i) the complete automation of its operation in order to facilitate the deployment to potential end-users and (ii) the adjustment of the data captured by the publishers to the asset of the OrganiCity platform.
Regarding the second item, sensor data will be included in a JSON message. In this message, the information dispatched to OrganiCity is as follows:
- Values. It is a JSON attribute and contains all device information. These values are divided into the following fields:
- Hostname. The device identifier.
- Version. The device version. This value is used to differentiate whether a device has a greater or lesser number of sensors.
- GPS. It is divided into in three items: (i) GPS date and time, (ii) latitude and (iii) longitude.
- Sensor. It corresponds to the contamination values measured by the set of sensors of each publisher.
- Hash. In each device, a hash is generated once the information is collected with the goal of avoiding to store repeated measurements, thus contributing to the robustness and reliability of the communication. The hash functionality is also employed as a file security system.
- Location. It is a “geopoint” attribute which contains the latitude and longitude of each measurement. This attribute is used to locate assets on the corresponding map belong to OrganiCity.
- TimeInstant. This attribute saves the date and time when a data is uploaded to OrganiCity.
- Version. It corresponds to the same data inserted in the attribute “Values”.