Skip to content

Commit 90202b9

Browse files
committed
first commit
1 parent be9f8cb commit 90202b9

File tree

14 files changed

+470
-0
lines changed

14 files changed

+470
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
additional_search_terms:
3+
- cloud
4+
- deploy
5+
6+
layout: installtoolsall
7+
minutes_to_complete: 15
8+
author: Fidel Makatia
9+
multi_install: false
10+
multitool_install_part: false
11+
official_docs: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
12+
test_images:
13+
- ubuntu:latest
14+
test_maintenance: true
15+
title: AWS CLI
16+
tool_install: true
17+
weight: 1
18+
---
19+
20+
[AWS CLI](https://docs.aws.amazon.com/cli/index.html) is a cross-platform command-line tool that can be installed on development computers. The AWS Command Line Interface (AWS CLI) is a unified tool that provides a consistent interface for interacting with all parts of Amazon Web Services.
21+
22+
It is available for a variety of operating systems and Linux distributions, supports the Arm architecture and has multiple ways to install it.
23+
24+
## What should I do before installing AWS CLI?
25+
26+
This article provides quick solutions to install the latest version of AWS CLI, version 2, for Ubuntu on Arm.
27+
28+
Confirm you are using an Arm computer with 64-bit Linux by running:
29+
30+
```bash { target="ubuntu:latest" }
31+
uname -m
32+
```
33+
34+
The output should be:
35+
36+
```output
37+
aarch64
38+
```
39+
40+
If you see a different result, you are not using an Arm computer running 64-bit Linux.
41+
42+
## How do I download and install AWS CLI version 2?
43+
44+
The easiest way to install the latest version of the AWS CLI for Ubuntu on Arm is to download and run the installer from AWS.
45+
46+
Before starting, install `unzip`:
47+
48+
```bash { target="ubuntu:latest" }
49+
sudo apt update
50+
sudo apt install unzip -y
51+
```
52+
53+
Download the zip file with `curl`, extract the installer, and run it.
54+
55+
```bash { target="ubuntu:latest" }
56+
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
57+
unzip awscliv2.zip
58+
sudo ./aws/install --update
59+
```
60+
61+
Confirm the CLI version 2 is available by invoking the `aws` command to print the version.
62+
63+
```bash { target="ubuntu:latest" }
64+
aws --version
65+
```
66+
67+
Review [AWS CLI v2 is now generally available](https://aws.amazon.com/blogs/developer/aws-cli-v2-is-now-generally-available/) to review the new features in version 2.
68+
69+
You now have the latest version of the AWS CLI installed. Follow [this guide](/install-guides/aws_access_keys/) to generate and configure access keys needed to use the AWS CLI.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Build a Local GenAI Smart Home System on Arm SBC
3+
4+
minutes_to_complete: 30
5+
6+
who_is_this_for: Anyone who wants a private, cloud-free smart home powered by GenAI on Arm
7+
8+
learning_objectives:
9+
- "Deploy a local Large Language Model (LLM) for smart home control"
10+
- "Integrate natural language processing with GPIO control"
11+
- "Build and run everything on Arm-based single-board computers (no cloud required)"
12+
- "Optimize for speed, privacy, and offline operation"
13+
prerequisites:
14+
- "Basic Python knowledge"
15+
- "A text editor (e.g., VS Code, Sublime, Notepad++)"
16+
- "An Arm-based single board computer (e.g., Raspberry Pi, Jetson Xavier AGX)"
17+
- "Basic electronic components such as LEDs, sensors (e.g., temperature), and actuators (e.g., relays or DC motors)"
18+
19+
author: "Fidel Makatia Omusilibwa"
20+
21+
### Tags
22+
skilllevels: "Introductory"
23+
subjects: "ML"
24+
armips:
25+
- "Arm Cortex A"
26+
tools_software_languages:
27+
- "Python"
28+
- "Ollama"
29+
- "VS Code or your preferred code editor"
30+
- "Jetson SDK (for NVIDIA Jetson SBC users)"
31+
- "(Optional) Docker"
32+
operatingsystems:
33+
- "Windows , Linux, MacOS"
34+
35+
further_reading:
36+
- resource:
37+
title: "Advanced Edge AI on Arm with llama.cpp/ONXX"
38+
link: "https://github.com/fidel-makatia/EdgeAI_llamacpp"
39+
type: "source"
40+
- resource:
41+
title: "llama.cpp docummentation"
42+
link: "https://github.com/ggml-org/llama.cpp"
43+
type: "documentation"
44+
- resource:
45+
title: "Ollama documentation"
46+
link: "https://ollama.com/blog/python-javascript-libraries"
47+
type: "documentation"
48+
- resource:
49+
title: "ONNX documentation"
50+
link: "https://github.com/onnx/tutorials"
51+
type: "documentation"
52+
- resource:
53+
title: "Jetson Xavier AGX documentation"
54+
link: "https://developer.download.nvidia.com/embedded/L4T/r32-3-1_Release_v1.0/jetson_agx_xavier_developer_kit_user_guide.pdf?t=eyJscyI6IndlYnNpdGUiLCJsc2QiOiJkZXZlbG9wZXIubnZpZGlhLmNvbS9zZGstbWFuYWdlciJ9"
55+
type: "documentation"
56+
57+
### FIXED, DO NOT MODIFY
58+
# ================================================================================
59+
weight: 1 # _index.md always has weight of 1 to order correctly
60+
layout: "learningpathall" # All files under learning paths have this same wrapper
61+
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
62+
---
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# ================================================================================
3+
# FIXED, DO NOT MODIFY THIS FILE
4+
# ================================================================================
5+
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
6+
title: "Next Steps" # Always the same, html page title.
7+
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
8+
---
Loading
Loading
Loading
Loading
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Overview
3+
weight: 2
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Overview
10+
11+
Imagine controlling your smart home using natural language—no cloud connection, no third-party servers, just your own hardware. With rapid advances in Generative AI and the widespread availability of **Arm architecture**, it’s now possible to bring large language models (LLMs) directly into your home, running on accessible, affordable Arm-based devices.
12+
13+
**Arm processors** power a vast ecosystem of single-board computers (SBCs) and edge AI platforms—from Raspberry Pi and NVIDIA Jetson to Khadas and Odroid boards—enabling efficient, high-performance AI processing close to where your data is generated. By building on Arm, you benefit from energy efficiency, scalability, and support from a massive global developer community.
14+
15+
This learning path will show you how to create a fully local, privacy-first GenAI-powered smart home system leveraging the unique strengths of the Arm architecture. You’ll use open-source tools like **Ollama** to run powerful language models on your Arm-based hardware. With this approach, your voice commands and automations stay private and fast, unlocking advanced AI experiences for any room—**all made possible by the performance and versatility of Arm.**
16+
17+
## Why Local GenAI for Smart Homes?
18+
19+
Most commercial smart home assistants depend on cloud services, meaning your voice and data are constantly sent to external servers for processing. While convenient, this raises privacy concerns, creates dependence on internet connectivity, and introduces unpredictable latency. By running everything locally, you gain:
20+
21+
- **Total Privacy:** Your conversations and routines never leave your device.
22+
- **Reliability:** Works even if your internet connection drops.
23+
- **Low Latency:** Get instant responses without waiting on the cloud.
24+
- **Customization:** Add new “skills” and device integrations as you wish.
25+
26+
Whether you’re a maker, developer, or privacy-conscious smart home enthusiast, this project gives you complete control.
27+
28+
## Supported Devices
29+
30+
You can run this project on a wide variety of Arm-powered single-board computers and edge AI devices, including:
31+
32+
- **Raspberry Pi 4 / 5**
33+
34+
A versatile and affordable platform for home automation and prototyping, powered by Arm Cortex-A cores.
35+
36+
- **NVIDIA Jetson Xavier AGX, Nano, Xavier NX, Jetson Orin**
37+
38+
Powerful Arm single-board computers designed for AI at the edge, supporting accelerated inference using integrated NVIDIA GPUs.
39+
40+
- **Any device running Arm Cortex‑A processors**
41+
42+
This includes a wide ecosystem of embedded and edge hardware—if your device features a Cortex‑A CPU, you can likely run this project.
43+
44+
> _If your device is Arm-based, supports Python, and can run Ollama, you can likely adapt this learning path to your hardware._
45+
46+
**Ready to unlock a new level of smart home privacy and control?**
47+
Let’s get started building your own local GenAI smart home system—one step at a time.
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
---
2+
title: Installation Guide
3+
weight: 3
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
# Installation Guide
10+
11+
{{% notice Note %}}
12+
This guide assumes you have already set up your Raspberry Pi or NVIDIA Jetson board with an operating system and network connectivity.For board setup help, see: [Raspberry Pi Getting Started](https://www.raspberrypi.com/documentation/) or [Jetson Getting Started](https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit).
13+
{{% /notice %}}
14+
15+
### Step 1: Connect to Your Board via SSH
16+
17+
Before proceeding, make sure your SBC is connected to the same network as your host computer. Then, access your device remotely via SSH. You can use the terminal in Visual Studio Code on your host PC, the built-in terminal, Command Prompt, or any other preferred SSH client.
18+
19+
Replace `<user>` with your device’s username , and `<board-ip>` with your device’s IP address.
20+
21+
**General SSH Command:**
22+
23+
```bash
24+
ssh <user>@<board-ip>
25+
26+
```
27+
28+
Create a directory called smart-home in your home directory and navigate into it by running the following commands:
29+
30+
```bash
31+
mkdir ~/smart-home
32+
cd ~/smart-home
33+
```
34+
35+
### Step 2: System Preparation
36+
37+
Update your system and ensure Python 3 and pip are installed.
38+
39+
```bash
40+
sudo apt update && sudo apt upgrade
41+
sudo apt install python3 python3-pip python3-venv git
42+
```
43+
44+
### Step 3: Requirements Installation
45+
46+
Create and activate a Python virtual environment using the following commands. This is recommended, as it keeps your project dependencies isolated and prevents conflicts with system-wide packages:
47+
48+
```bash
49+
python3 -m venv venv
50+
source venv/bin/activate
51+
```
52+
53+
This approach helps ensure that your system’s Python environment remains stable and avoids breaking other projects.
54+
55+
Next, install all the required libraries and dependencies for the project by running the appropriate command for your board:
56+
57+
{{< tabpane code=true >}}
58+
{{< tab header="Jetson (NVIDIA)" language="bash">}}
59+
pip install flask flask-cors requests schedule ollama adafruit-blinka adafruit-circuitpython-dht Jetson.GPIO
60+
61+
{{< /tab >}}
62+
{{< tab header="Raspberry Pi" language="bash">}}
63+
pip install flask flask-cors requests schedule ollama adafruit-blinka adafruit-circuitpython-dht RPi.GPIO
64+
{{< /tab >}}
65+
{{< /tabpane >}}
66+
67+
If you prefer, you can also run the above pip install commands directly, without creating a virtual environment. However, using a virtual environment is strongly recommended for most development workflows.
68+
69+
### Step 4: Install Ollama
70+
71+
Run the following command to install **Ollama**
72+
73+
```bash
74+
curl -fsSL https://ollama.com/install.sh | sh
75+
```
76+
77+
On most recent Linux distributions (including Raspberry Pi OS and Ubuntu for Jetson), curl is usually pre-installed by default. However, in some minimal installations, it might not be present. If you get a **command not found** error for curl, you can easily install it with:
78+
79+
```bash
80+
sudo apt update
81+
sudo apt install curl
82+
```
83+
84+
After installation, verify it by running the following command:
85+
86+
```bash
87+
ollama --version
88+
```
89+
90+
### Step 5: Download and Test a Language Model
91+
92+
Ollama supports a variety of models. This guide uses Deepseek-R1:7B as an example, but you can also use other models such as Mistral or Phi. To pull and run Deepseek-R1:7B:
93+
94+
```bash
95+
ollama run deepseek-r1:7b
96+
```
97+
98+
Ollama will automatically download deepseek -r1:7b first before running it. You’ll see download progress in the terminal, followed by the interactive prompt once it’s ready. An example is shown in the image below:
99+
100+
![deepseek test image alt-text#center](deepseek.png "Figure 1. deepseek test image caption")
101+
102+
### Step 6: Verify GPIO Functionality
103+
104+
To test the GPIO functionality, you’ll begin by connecting an LED to your board. For **Jetson Xavier AGX**, connect the anode (the long leg) of an LED, in series with a suitable resistor, to pin 12 . For **Raspberry Pi**, connect the anode of the LED (again, in series with a resistor) to GPIO 17 . In both cases, connect the cathode (the short leg) of the LED to a ground (GND) pin on your SBC. Once your wiring is complete, create a Python script named `testgpio.py` using your favorite editor.
105+
106+
```bash
107+
vim testgpio.py
108+
```
109+
110+
Copy the appropriate code below into the testgpio.py file you just created, then save and close the file.
111+
112+
{{< tabpane code=true >}}
113+
{{< tab header="Jetson" language="python" output_lines="8">}}
114+
import Jetson.GPIO as GPIO
115+
import time
116+
117+
GPIO.setmode(GPIO.BOARD)
118+
GPIO.setup(12, GPIO.OUT)
119+
GPIO.output(12, GPIO.HIGH)
120+
time.sleep(2)
121+
GPIO.output(12, GPIO.LOW)
122+
GPIO.cleanup()
123+
{{< /tab >}}
124+
{{< tab header="Raspberry Pi" language="python" output_lines="8">}}
125+
import RPi.GPIO as GPIO
126+
import time
127+
128+
GPIO.setmode(GPIO.BCM)
129+
GPIO.setup(17, GPIO.OUT)
130+
GPIO.output(17, GPIO.HIGH)
131+
time.sleep(2)
132+
GPIO.output(17, GPIO.LOW)
133+
GPIO.cleanup()
134+
{{< /tab >}}
135+
{{< /tabpane >}}
136+
137+
Once you’ve saved your script, run the code using the following command in your terminal:
138+
139+
```bash
140+
python testgpio.py
141+
```
142+
143+
The LED should blink according to the set timing in your script—turning on for two seconds and then off. If you see this behavior, your GPIO setup is working correctly.
144+
![Xavier AGX LED image alt-text#center](hardware2.png "Figure 1. Jetson Xavier AGX GPIO Test")
145+
146+
### Troubleshooting
147+
148+
- Missing dependencies?
149+
150+
Run the following command to resolve the issue:
151+
152+
```bash
153+
sudo apt-get install -f
154+
```
155+
156+
- GPIO permission errors?
157+
158+
- Run Python scripts with **sudo**.
159+
160+
- Model download issues?
161+
162+
- Confirm you have internet access and sufficient storage space on your device.
163+
164+
- Check the model size before downloading to ensure your SBC has enough space to store and run it.
165+
- Try downloading a smaller model
166+
- If you encounter errors, clear up storage or try connecting to a more stable network
167+
168+
- Hardware not responding?
169+
170+
- Double-check wiring and pin numbers.

0 commit comments

Comments
 (0)