The Cogdeck is a cyberdeck showcasing Azure AI services for makers, leveraging a straightforward design. The current model features a Raspberry Pi 4 and a 7-inch display, and can run on any system that supports .NET 8 or higher, including Linux/Raspbian, macOS, and Windows. For additional interactive capabilities, it can be outfitted with a camera module, microphone, and speaker.
This repository includes the application, 3D models for the case, hardware list, and instructions to build and run the Cogdeck.
Read time: __ minutes Build time: __ minutes
Cost:
- Hardware
- Software
- Azure AI Services - FREE!
- Speech-to-text, up to 5 audio hours per month
- Text-to-speech, up to 500,000 characters per month
- Translation, up to 2,000,000 characters per month
- Content Safety, up to 5,000,000 characters per month (in blocks of 1000)
- Sentiment analysis, up to 5,000,000 characters per month (in blocks of 1000)
- Summarization, up to 5,000,000 characters per month (in blocks of 1000)
- Azure AI Services - FREE!
Create an Azure account, if you don't have one already.
- In a web browser, navigate to https://azure.microsoft.com/free and click on
Free
orPay-as-you-go
. - Sign in with your Microsoft or GitHub account.
- After signing in, you will be prompted to enter some information.
Even though this is a free account, Azure may require credit card information. You will not be charged unless you change settings later.
Azure AI Services was formally called "Azure Cognitive Services", so you still may see that term in some places.
- Sign into your Azure account at https://portal.azure.com.
- In the top-left menu, select
Create a resource
. - Under
Categories
, selectAI + Machine Learning
. - Look for
Azure AI Services
and click onCreate
. - Select a subscription. You will likely only have one to choose from.
- For the resource group, select
Create new
and choose a name (e.g. "rg-cogdeck-001"). Make a note of this name for later.Naming things is hard, see Azure Naming Conventions for recommendations.
- Select an appropriate region (e.g. "WestUS2"). See Products-by-region for feature availability.
Regions only applies to regional AI services - some services are considered global and regionality will not apply.
- Choose a name for your resource (e.g. "ai-cogdeck-wus2-001").
Naming things is still hard, see Azure Naming Conventions for recommendations.
- Select a pricing tier, accept the terms, and click on
Review + Create
. - After validation passes, click Create.
- When deployment has completed (usually in a few seconds), click
Go to resource
to view your Azure AI Services resource. - On the left side navigation bar, expand
Resourse Management
, then selectKeys and Endpoint
. - Copy either of the two keys, the location/region, and endpoint. Save these values in a secure location for later.
- Sign into your Azure account at https://portal.azure.com.
- In the top-left menu, select
Create a resource
. - In the seach box, type in
content safety
and selectAzure AI Content Safety
. - On the next screen, find the box labeled
Azure AI Content Safety
and click onCreate
. - Select a subscription. You will likely only have one to choose from.
- For the resource group, select the resource group you created before (e.g. "rg-cogdeck-001").
- Select an appropriate region (e.g. "WestUS2").
- Choose a name for your resource (e.g. "ai-cogdeck-wus2-001-safety").
Naming things is still hard, see Azure Naming Conventions for recommendations.
- Select a pricing tier, accept the terms, and click on
Review + Create
. - After validation passes, click Create.
- When deployment has completed (usually in a few seconds), click
Go to resource
to view your Azure AI Services resource. - On the left side navigation bar, expand
Resourse Management
, then selectKeys and Endpoint
. - Copy either of the two keys, the location/region, and endpoint. Save these values in a secure location for later.
The Cogdeck software works on any system supporting dotnet 8+, such as Linux, Raspberry PI OS, macOS, and Windows. If you will be using a Raspberry PI for your Cogdeck, check out Getting Started with your Raspberry PI for setup. We recommend using the Raspberry PI OS as your operating system.
-
On the Raspberry Pi or your PC, open a command-line terminal.
-
Install .NET 8 SDK.
- For Raspberry Pi and Linux:
After installation is complete (it may take a few minutes), add dotnet to the command search paths.
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 8.0
Verify dotnet was installed successfully by checking the version.echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc echo 'export PATH=$PATH:$HOME/.dotnet' >> ~/.bashrc source ~/.bashrc
dotnet --version
- For Windows, go to https://aka.ms/maker/dotnet/download, under .NET 8.0 click
Download .NET SDK x64
, and run the installer.
- For Raspberry Pi and Linux:
-
Clone the repo.
git clone https://github.com/adrianwyatt/azure-ai-cyberdeck.git
-
Update your
configuration.json
with the Azure service endpoints and regions from the Azure sections above.- Windows:
notepad ~/azure-ai-cyberdeck/src/cogdeck/configuration.json
- Linux:
nano ~/azure-ai-cyberdeck/src/cogdeck/configuration.json
(When you are done pressCTRL-O
to save thenCTRL-X
to exit from nano)
The beginning of your
configuration.json
file should look something like this (with your service names and regions):{ "AzureAiServices": { "Endpoint": "https://ai-cogdeck-wus2-001.cognitiveservices.azure.com/", "Region": "westus2" }, "ContentSafety": { "Endpoint": "https://ai-cogdeck-wus2-001-safety.cognitiveservices.azure.com/", "Region": "westus2" } }
- Windows:
-
Set your Azure service keys as dotnet user-secrets.
Never store your keys in a repository. If you accidentally expose an Azure service key, invalidate the exposed key by regenerating them on the
Keys and Endpoint
page of your resource.- Open a terminal window and change directory to
src/cogdeck
in the repo (e.g.cd ~/azure-ai-cyberdeck/src/cogdeck
) - Set the Azure service keys as user-secrets.
- Windows:
dotnet user-secrets set "AzureAiServices:Key" "{Your AI Services key}" dotnet user-secrets set "ContentSafety:Key" "{Your Content Safety key}"
- Linux:
~/.dotnet/dotnet user-secrets set "AzureAiServices:Key" "{Your AI Services key}" ~/.dotnet/dotnet user-secrets set "ContentSafety:Key" "{Your Content Safety key}"
- Windows:
- Open a terminal window and change directory to
-
Build and run the code!
- Open a terminal window and change directory to
src/cogdeck
in the repo (e.g.cd ~/azure-ai-cyberdeck/src/cogdeck
) - Build and run the code.
dotnet build dotnet run
- Open a terminal window and change directory to
If you are running the Cogdeck on a Raspberry PI, you can configure it to start the Cogdeck application automatically when the system boots. This setup will start the Cogdeck everytime a bash terminal starts and will set your Raspberry PI to boot directly to a full-screen bash terminal.
- Open a terminal windows.
- Run
sudo nano ~/.bashrc
- Scroll to bottom of the file
- Add
~/.dotnet/dotnet run --project ~/azure-ai-cyberdeck/src/cogdeck
to the end of the file.
- Open a terminal window.
- run
sudo raspi-config
- Select
1 System Options
- Select
S5 Boot / Auto Login
- Select
B2 Console Autologin
- Select
Finish
and reboot.
The Cogdeck interface is designed with a dual-panel layout; the left panel offers a suite of Azure AI services, while the right panel serves as a type of workspace.
Keyboard:
W
/S
to select left-side menu items andENTER
to run the selected menu item.UP
/DOWN
arrows to scroll the right-side workspace text.
Cogdeck:
- Use the momentary toggle switch to select left-side menu items
- Use the momentary button to run the selected menu item.