Looking around in my home for things annoying me, for which I could do the work easier with voice control I finally choosed my file and backup server (raspberry pi).
From time to time I have to execute system commands on this server for example a system update, a shutdown or a reboot. It would be nice just to say 'shutdown' or 'update' to get things done.
So I asked myself if it was possible and practical to execute system commands via voice control.
For the case study I choosed the linux 'shutdown' command, it touches the main points and I should be easy to adapt the project for other commands.
As an additional feature it I decided to start the dialog not via the hotword ('hey snips') but by an external event. I want to avoid the problem that there are more local voice devices around all waking up on the wakeword and I get a mess.
For this case study I use the button on the respeaker hat (BCM/GPIO 17) as dialog starter, just to verify the concept. It should be easy to extend it, for example for a RFID-card.
Possible commands- reboot
- shutdown
- halt
- stop shutdown
- help
Additionally the commands reboot, shutdown and halt can be timed, like 'shutdown in ten minutes', 'reboot tomorrow at noon".
For the full documentation of the commands see the app github repository (https://github.com/netzzwergeGithub/bootcontrol)
How it will work- Push the button
- You get asked, which command you want to execute
- choose the command to execute
- confirm/cancel the execution of the choosen command.
Setting up this project it's essential to have some Linux experience.
- You should know how to handle user, user rights, groups and so on
- It's good to understand the impact of extending the sudoers
- Experience with the main text editors of debian
- Understanding of use and configuration of system services on debian/linux
- Understand that there are security impacts and not to use it in a production system as the project is now
All steps are explained, but without the prerequisites it would be hardly possible to revert the changes if you decide so.
Having installed a snips system on a raspberry pi (e.g. https://docs.snips.ai/getting-started/quick-start-raspberry-pi) and the ReSpeaker 2-Mics Pi HAT ( http://wiki.seeedstudio.com/ReSpeaker_2_Mics_Pi_HAT/#getting-started)
Install and configure the ReSpeaker 2-Mics Pi HAT via sam adds the user '_snipps_skills' to the group 'gpio'. This is needed to use the button of the ReSpeaker to start the conversion.
Alternatively you can add the user to the group by the commandline:
sudo usermod -a -G gpio _snips-skills
Integrate bootcontrol app to your assistantAfter deploying the assistant on your rapberry pi device, you have to configure the system from a console to get it run.
Please refer to the github project for details (https://github.com/netzzwergeGithub/bootcontrol#adaption-of-the-underlying-system).
In ActionTake a look at the system in use.
ExtendingThere are some ideas for extending the project:
- Activate the dialog a more sophisticated way, like an using RFID instead of a button. Takling security issues.
- Add more system commands like updating the system, or activating/deactivating services (ssh, mounting file systems...).
- Integrate satelite systems or other servers to drive via voice commands.
Comments