Code for my robot, Rizmo.
- Head:
- Computer:
- Power:
- Install OS:
- Write the Jetson Nano Developer Kit SD card image to a microSD card (instructions).
- Power up and install OS.
- Hostname:
rizmo
- Hostname:
- Remove unnecessary programs. Install updates.
- Register for Ubuntu Pro for additional security updates:
sudo pro attach <token>, where token comes from here.
- Setup SSH:
- Copy
~/.ssh/id_rsa.pubof dev machine to~/.ssh/authorized_keyson Jetson Nano. - Set permissions:
chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys
- Copy
- Install gcc-9 and g++-9 (required by latest
numpyversions):sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y sudo apt install gcc-9 g++-9 -y sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 70 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 90 gcc --version # Verify version is 9.x g++ --version # Verify version is 9.x
- Install and setup
pyenv(instructions).- To update:
pyenv update
- To update:
- Install Python 3.12 (with optimizations):
env PYTHON_CONFIGURE_OPTS='--enable-optimizations --with-lto' PYTHON_CFLAGS='-march=native -mtune=native' pyenv install --verbose 3.12 - Set default Python version:
pyenv global 3.12 - Set the default audio IO device:
- List devices:
pactl list short sinks pactl list short sources - Append lines to
/etc/pulse/default.pa:set-default-sink <sink-name> set-default-source <source-name>
- List devices:
- Install the
jetson_inferencelibrary:- Follow these instructions to install it from source to the system's Python 3.6 site packages.
- Create a Python 3.6 venv:
python3.6 -m venv --system-site-packages --symlinks venv36 - Update pip and make sure the lib can be imported:
. venv36/bin/activate pip install -U pip pip install -r requirements.py36.txt python -c "import jetson_inference"
git clone https://github.com/austin-bowen/rizmo.git
cd rizmo
python -m venv --symlinks venv
. venv/bin/activate
pip install -U pip
pip install -r requirements.<rizmo|potato>.txt
# For sounddevice lib
sudo apt install libportaudio2
# For serial communication
sudo usermod -aG dialout $USERSetup git:
git config --global user.name "<name>"
git config --global user.email "<email>"
git config credential.helper store
# When trying to push, enter username, and paste personal access token
# generated from here: https://github.com/settings/tokensCreate file rizmo/secrets.py with the following contents:
AWS_ACCESS_KEY_ID: str = ...
AWS_SECRET_ACCESS_KEY: str = ...
OPENAI_API_KEY: str = ...
# Get from: https://developer.wolframalpha.com/access
# Make sure it has "Full Results API" permissions
WOLFRAM_ALPHA_APP_ID: str = ...Make Rizmo start on system boot:
./bin/install-rizmo-service
sudo systemctl start rizmo# Install latest Python version
pyenv update
env PYTHON_CONFIGURE_OPTS='--enable-optimizations --with-lto' PYTHON_CFLAGS='-march=native -mtune=native' pyenv install --verbose 3.12
# Create new venv
echo 3.12.x> .python-version
mv venv venv.old
python -m venv --symlinks venv
. venv/bin/activate
python -V
# <verify it is using latest version>
# Install requirements
pip install -U pip
pip install -r requirements.<hostname>.txt
# <verify everything is working>
# Cleanup
rm -r venv.old
pyenv versions
pyenv uninstall <old-version>