## 7 Results and Discussion
### Smart Cities: Portability of IoT Services in Different Districts
Zolertia RE-Mote also provides support for the well-known open source OS for embedded devices, Contiki, and intrinsically for its 6 LoWPAN implementation. Erbium, the Contiki REST engine and the CoAP implementation have been used to deploy the CoAP servers into Zolertia RE-Motes. As stated, Appadtivity is decoupled from devices, thus Zolertia RE-Mote and Contiki have been used to validate the system but other devices and CoAP frameworks like Intel Edison and Californium can also be used with Appadtivity. The fragmentation and reassembly mechanisms needed in 6 LoWPAN to enable the communication with IPv6 networks are done by edge routers using RPL. We have chosen the Zolertia Orion router (Zolertia Orion Ethernet: [[https://github.com/Zolertia/Resources/wiki/Orion](https://github.com/Zolertia/Resources/wiki/Orion)]([https://github.com/Zolertia/Resources/wiki/Orion](https://github.com/Zolertia/Resources/wiki/Orion))), an IPv4/IPv6 and 6 LoWPAN routing device with Ethernet interface and 2.4 GHz and 863-950 MHz IEEE 802.15.4 radio support. The CETIC 6 LBR (CETIC 6 LBR: [[https://github.com/cetic/6](https://github.com/cetic/6) lbr/wiki]([https://github.com/cetic/6](https://github.com/cetic/6) lbr/wiki)) border router solution has been installed into the Orion routers (one per district) to transparently enable users to communicate between IPv6 and 6 LoWPAN networks. CETIC 6 LBR also enables a Web UI to manage the router configuration and see its connected devices. A standard digital PIR sensor, the TSL2561 lux sensor with I2C connection, two DHT22 temperature and humidity digital sensors, and four standard digital LEDs were used as sensors and actuators in the use case. The experiments were performed in two of our laboratories (one per District), in the Research Building Ada Byron, University of Malaga. In each laboratory a NFC tag was place to change the location. The use case was active for one hour, with default max-age in the observe operation, thus generating approximately 300 CoAP messages. The CoAP++ framework has been used to allocate the RD, where the Zolertia RE-Motes register their resources and end points and Appadtivity observes it to get the status of the CoAP networks. Appadtivity has been deployed in local model along with CoAP++ framework in a 4 GB Xubuntu OS virtual machine running over a 8 GB Windows 7. The border routers and the PC are connected to a switch router by Ethernet and Wi-Fi respectively. Finally, the user application has been installed on a Android smartphone which is also connected by Wi-Fi to the switch router and can change the district with the NFC tags located in each one. Figure 13 shows an overview of the smart city use case proposed. As mentioned before, each district has a border router with a 6 LoWPAN network. End users can change the location with the NFC tags located in each district independently of the networks without interrupting the service continuity of Appadtivity. Figure 14a,b display the RAM and Flash usage in the Zolertia RE-Motes and Orion routers respectively. This information has been obtained from the Contiki OS once the sketches have been uploaded to the devices. As can be seen, the Zolertia Re-Motes have 90% free space of Flash and 67% of RAM, allowing the creation of a large variety of new resources and reducing the power consumption thanks to the lightweight sketches. This test corroborates with the requirements of an embedded solution to reach resource-constrained devices, and the adoption of a current standard (CoAP). On the  
Figure 13: Smart-city use case deployment scenario. other hand, the Orion router needs more requirements: 75% of free space in Flash and 6% in RAM, however their sketches do not suffer many changes and they are usually connected without batteries. The power consumption evaluation resulted in an average 42 mA in the Zolertia motes which decreases the consumption more than two times of other hardware development platforms using 802.15.4 radios, as described in our previous work in [45].