Skip to content

Instantly share code, notes, and snippets.

@tstellanova
Last active April 26, 2024 07:47
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save tstellanova/0a6d8a70acc58a0d5be13ebaa7c935d4 to your computer and use it in GitHub Desktop.
Save tstellanova/0a6d8a70acc58a0d5be13ebaa7c935d4 to your computer and use it in GitHub Desktop.
Install rust development environment on Raspberry Pi Zero W (rpi0w)

Purpose

Setup your Raspberry Pi 0 w to develop with the Rust language.

Initial configuration

  • Ensure your rpi0 has a network connection so it can download and install packages
  • Install Raspbian based on Debian Stretch

Configure pigpio

If you're working with the rpi0's GPIO, the pigpio library can be very handy. By default the pigpio library is now included with Raspbian, but you may need to enable it

Check: sudo service pigpiod status Should show Active: active (running) -- if it does not:

Setup pigpiod to run at boot

  • sudo systemctl enable pigpiod
  • After reboot, verify with: sudo service pigpiod status

Optional: Install python pigpio access

Some pigpio examples are provided in the Python language: In order to run these you'll need to have these packages installed:

sudo apt-get update
sudo apt-get install python-pigpio python3-pigpio

Install rustup

  • From the rpi3 command line: curl https://sh.rustup.rs -sSf | sh
  • You can uninstall rustup at any time with rustup self uninstall
  • Installing rust can take some time, especially on slow wifi connection
@Dygear
Copy link

Dygear commented Jul 31, 2023

For the Raspberry Pi W 2, you will need to increase the swap size to 512MB in order to install the rust toolchain with rustup.

sudo dphys-swapfile swapoff
sudo nano /etc/dphys-swapfile

Change CONF_SWAPSIZE=100 to CONF_SWAPSIZE=512

sudo dphys-swapfile setup
sudo dphys-swapfile swapon
sudo reboot

@youngoris
Copy link

youngoris commented Sep 1, 2023

For the Raspberry Pi W 2, you will need to increase the swap size to 512MB in order to install the rust toolchain with rustup.

sudo dphys-swapfile swapoff
sudo nano /etc/dphys-swapfile

Change CONF_SWAPSIZE=100 to CONF_SWAPSIZE=512

sudo dphys-swapfile setup
sudo dphys-swapfile swapon
sudo reboot

Thank you for the tip, helps a lot.

@Jonahss
Copy link

Jonahss commented Dec 18, 2023

Thank you for the comment! worked really well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment