Turning a Disk Phone into a Digital Assistant Using Google Assistant and Raspberry Pi

Disk telephones, unfortunately, are almost nowhere to be found, and a whole era has gone with them. But there is something special in these devices that attracts both ordinary people and developers. As for the latter, they use disk systems for a variety of projects, and we will talk about one of them today.

It’s about transforming your phone into a digital assistant who is always ready to help. To implement the project, you need a Raspberry Pi Zero board and a connection to the Google Assistant. Well, now – more about the project.

To make it immediately clear what is at stake, here is a video of an already assembled phone with an activated assistant.

A little more about the required components

Us will need:

  • Raspberry Pi Zero with soldered pins, memory card with Raspberry Pi OS and power adapter.
  • An old rotary telephone with a working handset (microphone and speaker) and a working toggle switch, which will have to be customized.
  • All sorts of cables, soldering iron, screwdrivers and other little things.
  • 1 USB audio adapter compatible with Linux.
  • 1 male to male 3.5mm audio cable.
  • 1 Raspberry Pi Zero micro USB to USB A adapter.

How to install Google Assistant on an old phone

There are several stages of work:

  • Sign up with Google (the easiest one).
  • Authenticate with Google (also easy).
  • Phone customization.
  • Setting up Google Assistant.

Sign up with Google

This, of course, is not about simply registering an account in the company’s services, but about registering with a raspberry pi. This step can be a little tricky for those who have never worked with Google Cloud Platform, so it’s best to read this paragraph so as not to waste time. If you know everything, you can skip it.

We clone the repository to “raspberry”.

cd ~/
git clone https://github.com/rydercalmdown/google_assistant_telephone

We open console.actions.google.com in the browser. This is where the Google Assistant Actions control center is located.

Select “new project” and fill in the fields that appear.

In a new tab, we confirm the name of the project and select “Enable” to enable the API.

Next, on the first tab, scroll down the page to the end and select “Are you looking for device registration? Click here ”

Now you need to register the device by filling in all the fields and copying the received ID into a separate file – you will need it later.

We select “Download OAuth 2.0 credentials” in order to download the corresponding file, which “Malinka” will use to form requests.

Rename the downloaded file to oauth_config_credentials.json and transfer it to the Raspberry Pi. You need to place it in the folder of the copied repository downloaded at the very beginning.

# Rename your downloaded file
cd ~/Downloads
mv your_unique_secret_file_name.json oauth_config_credentials.json
# Move the file into your repository
scp oauth_config_credentials.json pi@your_pis_ip_address:/home/pi/google_assistant_telephone

We return to the browser. After downloading and renaming, click “Next” and select “Save Traits” without changing the settings.

Authenticating with Google

After registration is complete, it’s time to authenticate the device to be able to access your Google account and personalize the assistant.

Open the link console.cloud.google.com/apis/credentials/consent and check that the project name specified above matches the one displayed by the link.

Select “External” and click “Create”

Fill in the field with the name, select mail from the drop-down list and add this e-mail to the “Developer contact information” field and save everything.

On the next page, select “Add or Remove Scopes” and search for “Google Assistant API” in the search box. Select / auth / assistant-sdk-prototype scope, update by clicking on “upfate” and save everything.

Then select “OAuth Consent Screen” and “Add User” by adding your mail.

Now go to the folder of the downloaded repository on the Raspberry Pi and run the command:

cd ~/google_assistant_telephone
make authenticate

It completes the authentication process, after which you need to copy the resulting code to the console. If all is well, the message “credentials saved:” will appear.

This data is required to go to the current audience.

# credentials saved: /Users/test/Library/Application Support/google-oauthlib-tool/credentials.json
mv /Users/test/Library/Application Support/google-oauthlib-tool/credentials.json /home/pi/google/assistant/telephone/credentials.json

Customizing your phone

Of course, the models of rotary telephones differ from each other, but their schemes are more or less similar, so what is shown below can be used for all similar devices.

In any case, the phone must first be disassembled.

Next, we find the wires that go to the lever switch. They will need to be connected to the raspberry pins so that the board can determine whether the phone is off-hook or not.

The wires must be soldered to pin 18 and to ground.

Next, we connect the USB audio adapter to the raspberry pi zero, after which we solder two different 3.5mm wires to the tube wires. They will transmit the signal from the Raspberri Pi to the tube and vice versa. You may have to tinker with determining where which wire is, but in general there is nothing difficult here.

Finishing the customization of the phone by connecting the 3.5mm wires to the adapter.

All that remains is to close the phone case, not forgetting to remove the “raspberry” power cable.

Assistant setup

There is very little left – we set up the assistant and that’s it. There are also a few steps here.

Run the installation script. It will take more than one hour if you are using a Raspberry Pi Zero. It is best to start everything in the evening and leave it overnight.

cd google_assistant_telephone
make install

Setting up USB audio. This requires only one command.

make configure-audio

Now we are testing the audio adapter.

# Run, speak something into the microphone, and listen
make test

# Set volumes
alsamixer

We export the project ID. You can just go here by this link and choose
“Project Settings”

export PROJECT_ID=your-project-id

Exporting ID

export DEVICE_MODEL_ID=your-model-id-from-the-earlier-steps

Now we execute the command

make run

Then we test the phone. It’s simple – we pick up the phone and ask any question to the assistant. If everything is ok, the console will show you a specific action and the assistant will respond.

Finally, execute the command below to launch the helper.

make configure-on-boot

More details – on the page of the project itself

Similar Posts

Leave a Reply