Skip to content

🍊 Instructions on how to get an Armbian image ready for use with an Orange Pi device, including its GPIO. 🍊

Notifications You must be signed in to change notification settings

bassamanator/armbian-orangepi-how-to

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

logo

* This page is a 4 minute read.

** I will be using the Orange Pi Zero 2W for the purposes of this guide.

Accompanying YouTube Video

Faster to just read the README, but here.

Purpose

I felt that the Debian image for the Orange Pi Zero 2W was a bit wonky, so I thought a pure Armbian image might be worth looking into.

Target Boards

These instructions will work without adjustment for many Orange Pi boards. This applies more to the wiringOP side of things (necessary for GPIO to work), as opposed to Armbian (which is easy to get up and running).

Should work on βœ…:

  • Orange Pi Zero 2W
  • Orange Pi 5 Plus
  • Orange Pi Zero 3

Known to not work ❌:

  • Orange Pi PC Plus

Orange Pi Zero 2W Armbian Setup

  1. Download your preferred image from Armbian.
  2. Burn the image onto a microSD card using something like USBImager.

Wireless Setup

πŸ“ For those who are not going headless, you have the option of skipping steps 1 and 2.

I will be doing a headless setup, so I need the Wifi to connect automatically on boot. Armbian lets you PRESET certain things, you can find the full list here. I'll be setting up the Wifi, and making other adjustments as well (you don't need to though).

  1. On your previously imaged microSD card, edit the file /root/.not_logged_in_yet. πŸ“ In linux, you will need root privileges to edit this file.
  2. These are the file contents. You must adjust to your needs:
# Required
PRESET_NET_CHANGE_DEFAULTS=1

# If both WIFI and ETHERNET are enabled, WiFi will take priority and Ethernet will be disabled.
PRESET_NET_WIFI_ENABLED=1
# Just as an example
PRESET_NET_ETHERNET_ENABLED=1
PRESET_NET_WIFI_SSID='Wifi network name'
PRESET_NET_WIFI_KEY='Wifi password'
# https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
PRESET_NET_WIFI_COUNTRYCODE='CA'
# Yes, the following is correct, if you want Wifi to connect automatically
PRESET_CONNECT_WIRELESS=n

# Optional
SET_LANG_BASED_ON_LOCATION=n
# Do not change en_US.UTF-8, or it will lead to an error with user creation
PRESET_LOCALE=en_US.UTF-8
# Type `timedatectl list-timezones` in a linux terminal
PRESET_TIMEZONE=America/Toronto
# Armbian default root password is 1234
PRESET_ROOT_PASSWORD=tester123
# Adds a new user to the `sudo` group
PRESET_USER_NAME=opi
PRESET_USER_PASSWORD=tester123
PRESET_DEFAULT_REALNAME=OrangePi
  1. Boot the device with the microSD card (first boot takes longer).
  2. SSH into the device: ssh root@ip.address.
  3. Do a full update and reboot.
sudo apt update && sudo apt full-upgrade --yes
sudo reboot now

GPIO

To be able to use the GPIO pins, certain packages must be installed.

wiringOP

πŸ“ You can find installation instructions for your particular Orange Pi board on the Orange Pi Wiki.

Original instructions source.

Clone the Repo

cd ~
sudo apt update && sudo apt install git
git clone https://github.com/orangepi-xunlong/wiringOP.git -b next

Compile and install wiringOP

cd ~/wiringOP
sudo ./build clean
sudo ./build

Test the installation

gpio readall
Expected output

gpio table

* Will vary depending on your device

wiringOP-Python

Original instructions source.

Install Packages

sudo apt install swig python3-dev python3-setuptools

Ready the Repo

cd ~
git clone --recursive https://github.com/orangepi-xunlong/wiringOP-Python -b next
cd wiringOP-Python
git submodule update --init --remote

Compile and Install

python3 generate-bindings.py > bindings.i
sudo python3 setup.py install

Test the Installation

 python3 -c "import wiringpi; help(wiringpi)"
Expected output
Help on module wiringpi:

NAME
    wiringpi

DESCRIPTION
    # This file was automatically generated by SWIG (https://www.swig.org).
    # Version 4.1.0
...

πŸŽ‰ If you've made it this far with the expected outputs, your Orange Pi is good to go! πŸŽ‰

Please star ⭐ the repo!

Useful Armbian Utils

  • armbian-config
    • You can use this to configure your device.
  • armbianmonitor
    • This is particularly useful if you want to see CPU speed, temperatures, etc.

Sources

About

🍊 Instructions on how to get an Armbian image ready for use with an Orange Pi device, including its GPIO. 🍊

Topics

Resources

Stars

Watchers

Forks