Git Product home page Git Product logo

armbian-orangepi-how-to's Introduction

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 [email protected].
  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

armbian-orangepi-how-to's People

Contributors

bassamanator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hqnicolas

armbian-orangepi-how-to's Issues

Compiling does not work on OrangePi PC Plus

Hi and thanks for your short instructions.

I tried it on a Oriange Pi PC Plus, but at the ent of compilation I get some warnings and the GPIO commands do not work.

GPIO Utility
[Compile] gpio.c
[Compile] readall.c
gpio.c: In function β€˜doUsbP’:
gpio.c:944:25: warning: unused parameter β€˜argc’ [-Wunused-parameter]
944 | static void doUsbP (int argc, char *argv [])
| ~~~~^~~~
gpio.c:944:37: warning: unused parameter β€˜argv’ [-Wunused-parameter]
944 | static void doUsbP (int argc, char *argv [])
| ~~~~~~^~~~~~~
readall.c:1616:13: warning: β€˜piPlusReadall’ defined but not used [-Wunused-function]
1616 | static void piPlusReadall (int model)
| ^~~~~~~~~~~~~
[Link]
[Install]
chown: warning: '.' should be ':': β€žroot.rootβ€œ

All Done.

NOTE: To compile programs with wiringPi, you need to add:
-lwiringPi
to your compile line(s) To use the Gertboard, MaxDetect, etc.
code (the devLib), you need to also add:
-lwiringPiDev
to your compile line(s).

pi@orangepipcplus:$ sudo gpio readall
wiringPiSetup: mmap (PWM) failed: Invalid argument
pi@orangepipcplus:
$

Any ideas?

Delete empty lines

Hey,
just curious. You mentioned

βš οΈβ— Delete all comments (lines starting with #) and all empty lines!

Why is this necessary? Did this cause trouble?

Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.