The Official Raspberry Pi Projects Book - Projects_Book_v4

(singke) #1

Tutorial STEP BY STEP


(^150) The Official Raspberry Pi Projects Book raspberrypi.org/magpi
SIRICONTROL:
SiriControl is a framework, written in Python, which implements
an ingenious hack to enable you to add Siri voice control to any project
iri is an intelligent personal assistant,
integrated with Apple devices. From setting
reminders to hailing taxis, Siri can do many
things to make life easier. However, wouldn’t it be
awesome if you could control anything with Siri?
Welcome to SiriControl – a Python framework
which provides a simple way of using Siri voice
commands to add fantastic voice control to any
project. The possibilities for SiriControl are endless,
and as no extra hardware is required: you can get
started right away!
S
Siri creates a note with your
command, which syncs with
your Gmail account



OS device i
SiriControl:
magpi.cc/
2t3Bh4v
You’ll
Need
SANJEET CHATTERJEE
16-year-old technology enthusiast and
self-taught programmer with a knack
for creativity. Passionate about studying
robotics and AI.
magpi.cc/2t3oJtK
CONTROL YOUR PI WITH SIRI
STEP-01
How it works
Siri can create Notes by using the command word
‘note’. The new Note is then synced with the linked
Gmail account. SiriControl fetches the new Note from
the Gmail account, and executes the appropriate
function from the dynamically loaded modules created
by the user. This ingenious hack enables you to add
fantastic voice control capabilities to any project,
with minimal setup required.
STEP-02
Configure Gmail
A Gmail account is required for SiriControl. For
security reasons, we suggest creating a new Gmail
account specifically for SiriControl, as you will have to
enter your credentials in a Python script.
Access for less secure apps needs to be enabled for
your new account as Google identifies the connection
between the Python script and mail servers as less
secure – see magpi.cc/2u3gprx.
IMAP must also be enabled. This is found in the Gmail
account settings, as shown in the image (on next page).
This is the protocol SiriControl uses to fetch new Notes.
SiriControl fetches the
commands from your Gmail
account, and runs the
appropriate module
Above You will need to add your Gmail account so that the Notes can be synced with it


Free download pdf