# Voice Assistant Application for Avoiding Sedentarism in Elderly People Based on IoT Technologies
## 4 Case Study and Results
### Hardware Used
#### 4.1.2 Edge Computing Device  
The ECD has been implemented using a Raspberry Pi 4 4 GB, but another device with less computational power could be used as long as it has a Bluetooth interface, connection to the wide area network--either through a WiFi or Ethernet interface--and the capability to run software of a certain complexity, as it communicates with real-time databases.  
As introduced in Section 3.2, intelligent voice assistant policies have some limitations in terms of the proactivity they can have with the user, and they can condition the way in which applications, Google Actions in this case, are developed. Through the software developed for the ECD in combination with the smart bracelet of the elder, a more proactive dialogue can be established by the system that reminds the user about his/her progress.  
As for the functions performed by this device, as introduced in the Section 3, they are divided into two threads that are in charge of adding the proactivity of the system: performing the monitoring and the assignment of the smart bracelet.  
For the implementation of these threads, the Raspbian Buster operating system was used on the Raspberry Pi 4 and a Node JS application was developed. The PM2 process manager [57] was used to deploy the application. The application initially performs a setup process and then remains running in the background (in Daemon mode).  
The first thread aims to search in 2 s intervals for the user's smart bracelet, and if it finds it, it connects to it andumps the data that the smart bracelet has collected to send it to the database used, Cloud Firestore in this case study. The changes produced in the Cloud Firestore collection are monitored by a Cloud Function that is in charge of processing the new data. After processing, the Cloud Function will establish whether it is necessary to transmit an encouragement message to the user. This message will be transmitted and processed by the Mailbox thread detailed at the end of this subsection.  
In terms of the most important data obtained from the associated smart bracelet, the following should be noted:  
* Smart bracelet's MAC: This feature corresponds to the MAC of the smart bracelet and is necessary to check whether the detected smart bracelet is the one assigned to the user.
* Battery: This feature corresponds to data related to the smart bracelet's battery, such as the remaining battery percentage, the last time the bracelet was charged, or whether it is charging.
* Pedometer information: This characteristic corresponds to the daily physical activity data recorded in the smart bracelet. This data corresponds to calories, distance, and steps travelled. The latter are the ones that are checked to see if the daily challenge has been met or not, and to generate a notification to the user if necessary.
* Time: Corresponds to the time of the moment when the smart bracelet data have been obtained.  
The second thread, Mailbox thread, is in charge of handling the messages received by the platform, stored in Cloud Firestore, carrying out the necessary functions for the assignment of the smart bracelet, and the sending of notifications to the senior. In the smart bracelet assignment process, the Raspberry Pi 4 is connected to a new smart bracelet and the procedure described in Section 3.3.2 is carried out. As for tell or show progress messages, these messages are stored in Cloud Firestore, and when the daemon checks that a new message has been added, this thread performs the necessary function, sending the tell message to the Google Home via the CastV2 protocol for playback, or generating the progress chart and displaying it on the Lenovo's screen, in case this type of message is received.