Skip to content

austin-bowen/rizmo

Repository files navigation

Rizmo

Code for my robot, Rizmo.

Hardware

Software Setup

  1. Install OS:
    1. Write the Jetson Nano Developer Kit SD card image to a microSD card (instructions).
    2. Power up and install OS.
      • Hostname: rizmo
    3. Remove unnecessary programs. Install updates.
    4. Register for Ubuntu Pro for additional security updates: sudo pro attach <token>, where token comes from here.
  2. Setup SSH:
    1. Copy ~/.ssh/id_rsa.pub of dev machine to ~/.ssh/authorized_keys on Jetson Nano.
    2. Set permissions: chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys
  3. Install gcc-9 and g++-9 (required by latest numpy versions):
    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
  4. Install and setup pyenv (instructions).
    • To update: pyenv update
  5. 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
  6. Set default Python version: pyenv global 3.12
  7. Set the default audio IO device:
    1. List devices:
      pactl list short sinks
      pactl list short sources
      
    2. Append lines to /etc/pulse/default.pa:
      set-default-sink <sink-name>
      set-default-source <source-name>
      
  8. Install the jetson_inference library:
    1. Follow these instructions to install it from source to the system's Python 3.6 site packages.
    2. Create a Python 3.6 venv:
      python3.6 -m venv --system-site-packages --symlinks venv36
    3. 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"
      

Repository Setup

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 $USER

Setup 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/tokens

Create 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

Upgrading Python on Jetson Nano

# 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>

About

Code for my robot, Rizmo

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors