# 重置 ###### tags: `Speaker` `System` ## 流程架構圖 - [Flow-chart](https://whimsical.com/reset-process-flow-chart-sketch-HDAyZAb3jMnfmPCiNMW1CE) ## 功能介紹 重置會將智慧音箱內的**使用者資料以及裝置設定去除**,並將智慧音箱回復至原廠設定狀態,目的在於: - 排除裝置運作問題 - 重新設定智慧音箱 - 出售智慧音箱之前置作業 - 丟棄智慧音箱之前置作業 ## 輸入 ### 按鍵觸發 長按位於音箱上的按鍵後,觸發重置 於此同時音箱會以燈光訊號 / 語音以顯示重置過程 :::info - **長按 <TBD/> 秒**以觸發重置 - 重置期間,LED 燈**發出 <TBD/> 色燈光** - 重置正式觸發前,**播放語音**以提醒重置即將進行 ::: ## 輸出 智慧音箱將恢復至原廠設定,包括: - 格式化 / 刪除非原廠設定之資料 - 將裝置設定恢復為原廠設定 音箱將透過燈光訊號 / 語音給予重置完成之回饋 :::info - 詳細之刪除資料以及裝置設:<TBD/> - 已和智慧音箱配對之裝置資訊 - 已開通之 Wifi 連線 (SSID/password) - 已開通之 Bluetooth 連線 - 重置後,LED 燈**發出 <TBD/> 色燈光** - 重置觸發後,**播放語音**以提醒重置已完成 ::: ## 研發方式 **自行研發** - 按鍵觸發 透過 樹梅派 4 上的 GPIO 腳位進行按鈕的輸入,觸發系統中的重置程序來執行重置 ## 資源需求 ### 硬體方面 | 物品名稱 | 數量 | 備註 | | -------- | ---- | ------------------------------------ | | 按鈕 | 1 | 用於觸發重置功能 | | 麵包板 | 1 | 用於架構及測試電路線 | | 電阻 | - | 用以避免短路以保護裝置 | | 跳線 | 1 | 用於連接樹梅派之 GPIO 以及按鈕 | | LED 燈 | 1 | 用以顯示智慧音箱目前正在啟用那些功能 | (如果有官方套件應該會更好) ### 軟體方面 - [RPi.GPIO](https://sourceforge.net/p/raspberry-gpio-python/wiki/Home/) GPIO 輸入 ### 實作細節 - 如何呈現重置提示? - 提示語音是如何運作的? - 使用者資料定義? - Wi-fi - SSID - Password - Gmail account info. (front-end) - Email - Id - Username - Speaker - Name - Location - Phone call function - Call table - 錯誤處裡 ## 參考文獻 - [Wikipedia - Factory Reset](https://en.wikipedia.org/wiki/Factory_reset) - [Device Reset and Recovery - Microsoft Docs](https://docs.microsoft.com/zh-tw/windows/iot/iot-enterprise/device-management/reset-and-recovery) - [Raspberry Pi: Using GPIO Inputs (Youtube)](https://www.youtube.com/watch?v=NAl-ULEattw) ## 筆記 (非報告部分) - The purpose of reseting a smart speaker - Resolve issues of the speaker - Erase user data before selling / desposing the speaker - The effects of reset on smart speakers - Format the storage of user data (thus erasing all user data) - Return all settings of the device driver to factory settings - The common methods of reseting smart speakers - Pressing (Holding) a designated button to initiate reset - Unplugging the power source then reconnect it to initiate reset - The methods of reseting user data in Raspberry 4 OS - External methods - Have a GPIO input that can trigger the reset function from the speaker driver - Internal reseting-process - Have a factory image stored in memory, flashing it when reseting (?) - Have a function / method to both clear any user data and re-initiate provisioning ## Components of the speaker - far field microphone - speaker - processor ## Software Requirement - Minimum - blue tooth audio streaming - Bonus - internet radio - spotify/youtube music premium - Critical - local media server - home assistant - Additional - speech to text (vice versa) module ## Potential User data - functions that relates to user account data - music stream through third party platform - asking weather (region)