Install on Raspberry Pi Zero - Solved

Hi, I thought this might help anyone who wants to try Edge Impulse on a Raspberry Pi Zero W. I wrote it as post on my wordpress site https://gerardwknight.duckdns.org/index.php/2022/02/12/how-to-install-edge-impulse-on-a-raspberry-pi-zero/

Gerry

Edge Impulse does not officially support the Raspberry Pi Zero W hardware, and if you attempt to follow the official documentation meant for installing it on an a Raspberry Pi 4, on a Pi Zero W, the installation will fail.

Since the only hardware I had on hand was the Pi Zero W, I experimented for a while and managed to get it working. If you would like to try this for yourself see the instructions below.

Install Pi OS Legacy (buster) on the Pi Zero W board using the Raspberry Pi Imager application. Do NOT install Bullseye.

These commands replace those from the official documentation in the section 2. Installing dependencies . At the time of writing this, the version was: Edge Impulse Linux client v1.3.1

sudo apt update
sudo apt upgrade
wget https://unofficial-builds.nodejs.org/download/release/v12.13.0/node-v12.13.0-linux-armv6l.tar.xz
tar xvf node-v12.13.0-linux-armv6l.tar.xz
cd node-v12.13.0-linux-armv6l
sudo cp -R bin/* /usr/bin/
sudo cp -R lib/* /usr/lib/

sudo apt install -y gcc g++ make build-essential sox gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps

npm config set user root && sudo npm install edge-impulse-linux -g --unsafe-perm

3 Likes

Hi @Gerry,

Thank you for posting your solution! Let us know if you have any further questions.

– Jenny

Thank you so much, I tried this but was getting error for npm config set user root && sudo npm install edge-impulse-linux -g --unsafe-perm

Resolved this by upgrading npm version to 6.14.15,
sudo npm install -g npm@6.14.15
and then –
npm config set user root && sudo npm install edge-impulse-linux -g --unsafe-perm

1 Like

Hey, that’s really great and I see you managed to get the C++ library compiled as well!

1 Like

For me this is what worked, basically I my pi zero 2 was crashing due to lack of memory, so I increased the allocated swap memory and then installed:

sudo apt update
sudo apt upgrade


#increase swap file memory
free -h
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
free -h

# install NVM (node version management)
sudo apt update
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm —version
# install node
nvm install --lts
source ~/.bashrc
node --version
# install npm
npm install -g npm@10.4.0
source ~/.bashrc

# https://forum.edgeimpulse.com/t/install-on-raspberry-pi-zero-solved/3722
sudo apt install -y gcc g++ make build-essential sox gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps

sudo npm install edge-impulse-linux -g --unsafe-perm

# change permisions on file
sudo chmod +x /usr/local/bin/edge-impulse-linux
sudo chmod +x /usr/local/bin/edge-impulse-linux-runner

# Run edge impulse
edge-impulse-linux