## 3 Materials and Methods
### Layer 2: Local Hub  
The aim of layer 2 is to collect data coming from the sensor cards and organize them in ASCII files ready to be read by whatever editor program. This function is generally executed by a Personal Computer (PC) [12,16] which, by means of its operative system, offers all the functionalities needed to collect and show the data. Unluckily the use of PCs often has problems which could be critical in particular applications like ours. For example, the electrical energy consumption could be too high when a battery is used, the reliability of a PC in a hostile environment (too humid and/or too dusty) could be less than what is necessary, and a more reliable PC, such as an industrial one, could be expensive on a limited budget. In order to face these problems, a hub composed by an ARDUINO with a ZigBee tx/rx and a Raspberry-Pi card has been used. As already shown in Table 1, ARDUINO is advantageous for acquiring data from analog sensors, but it has not all the software features offered by Raspberry-Pi and Beaglebone necessary to create an internet connection. In order to limit the energy needs of the hub, the ARDUINO card plays a fundamental role in the management of the system. In fact, because its low power consumption, it is better to use it as a data collecting card instead of the Raspberry-Pi and to use the latter only for the data transmission to the server. It wakes up at a prefixed time and collects data coming from the sensors card managing all the synchronization tasks for both the sensor cards, and the server. Usually, only one time a day, it, by means of a specific switch, activates the Raspberry-Pi downloading onto it the acquired data. After that, the Raspberry-Pi stores this data and can send it toward the server. If there are particular requests by the server, such as more pictures in a/per day or more environmental measurements, the Raspberry-Pi will change the internal cycle variables to satisfy these exigencies driving also its ARDUINO and the sensor cards. The Raspberry-Pi is a small, barebones computer conceived with the intention of providing low-cost computers and free open-source software. It is a credit card-sized computer powered by the Broadcom BCM2835 system-on-a-chip (SoC). This SoC includes a 32-bit ARM1176 JZFS processor, clocked at 700 MHz, and a Videocore IV GPU. It also has 256 MB of RAM in a POP package above the SoC. The Raspberry-Pi is powered by a 5 V micro USB AC charger. While the ARM CPU delivers real-world performance similar to that of a 300 MHz Pentium 2, the Broadcom GPU is a graphics core capable of hardware decoding several high definition video formats. In that regard, the Videocore IV GPU is rather potent as it is capable of hardware decoding 1080p30 H.264 with bit-rates up to 40 Mb/s. The Raspberry-Pi features HDMI and composite video outputs, two USB 2.0 ports, a 10/100 Ethernet port, SD card slot, General Purpose I/O Expansion Board (GPIO) connector, and analog audio output. It only costs 25$ [31, 32, 33, 34]. The ARDUINO card is connected to the Raspberry-Pi by the serial port and sends information following the standard serial protocol. Figure 2 shows an image of the naked (without its box) hub. Connected to the hub there is also a high resolution camera directly driven by the Raspberry-Pi. The camera is a Logitech HD Webcam C525 with a resolution of 8 Megapixels [47]. To obtain the best view, an external 12 V LED flash light driven by the hub software accompanies the webcam. The flash is always connected to the hub and supplied by the battery. Normally the flash is disconnected by the battery to avoid energy loss. When the researchers request a picture, the hub drives the supply circuit that gives energy to the LEDs. The flash is switched on for two seconds before the picture is taken. Obviously, the use of flash must be authorized in order not to cause damage to the painting.