728x90

출처

omv-extras 설치 (root 계정으로 설치)

$ su - root
# wget -O - http://omv-extras.org/install | bash

OMV-Extras 추가 확인

[플러그인] 목록에서 openmediavault-transmissionbt 선택하고 [설치] 버튼 선택

공유 폴더 추가

공유 폴더는 omv 설치시 생성된 debian-transmission 계정으로 생성된 폴더를 지정

[서비스] > [BitTorrent] > [설정] 화면에서 활성화하고 [저장] 버튼 선택하여 저장

[RPC] 화면에서 활성화하고 [저장] 버튼 선택하여 저장하고, [Show] 버튼을 선택하려 클라이언트 화면 보기 

토렌토 클라이언트 Web 화면

728x90
728x90

출처

Orange Pi Zero Plus (H5) : Orange Pi NAS Expansion Board

Orange Pi Zero Plus (H5)

Orange Pi NAS Expansion Board

3D 프린터로 출력한 케이스

  

케이스 적용

  

  

one.sh - omv 패키지 리파지스토리에 등록

cat <<EOF >> /etc/apt/sources.list.d/openmediavault.list
deb http://packages.openmediavault.org/public arrakis main
# deb http://downloads.sourceforge.net/project/openmediavault/packages arrakis main
## Uncomment the following line to add software from the proposed repository.
# deb http://packages.openmediavault.org/public arrakis-proposed main
# deb http://downloads.sourceforge.net/project/openmediavault/packages arrakis-proposed main
## This software is not part of OpenMediaVault, but is offered by third-party
## developers as a service to OpenMediaVault users.
# deb http://packages.openmediavault.org/public arrakis partner
# deb http://downloads.sourceforge.net/project/openmediavault/packages arrakis partner
EOF

two.sh - openmediavault 4 (Arrakis) 패키지 설치

export LANG=C
export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none
apt-get update
apt-get --allow-unauthenticated install openmediavault-keyring
apt-get update
apt-get --yes --auto-remove --show-upgraded \
    --allow-downgrades --allow-change-held-packages \
    --no-install-recommends \
    --option Dpkg::Options::="--force-confdef" \
    --option DPkg::Options::="--force-confold" \
    install postfix openmediavault
# Initialize the system and database.
omv-initsystem

설치 스크립트(one.sh, two.sh) 실행가능하도록 모드 변경

$ chmod a+x one.sh two.sh

설치 스크립트(one.sh, two.sh) 실행

$ sudo ./one.sh
$ sudo ./two.sh

관리 페이지 접속

기본계정과 암호 - root/openmediavault

NAS에 장착한 msata ssd 확인

NAS에 장착한 msata ssd 파티션(파일 시스템) 추가

[파일 시스템]메뉴에서 [생성] 버튼을 선택하여 파일 시스템 생성 

파일 시스템 생성

파일 시스템 생성 완료

추가된 파티션 확인

728x90
728x90

출처

OS 업데이트

$ sudo apt-get update
$ sudo apt-get upgrade

linux 정보 확인

$ grep . /etc/*armbian-release
## PLEASE DO NOT EDIT THIS FILE
BOARD=orangepizeroplus
BOARD_NAME="Orange Pi Zero Plus"
BOARDFAMILY=sun50iw2
VERSION=5.60
LINUXFAMILY=sunxi64
BRANCH=next
ARCH=arm64
IMAGE_TYPE=stable
BOARD_TYPE=conf
INITRD_ARCH=arm64
KERNEL_IMAGE_TYPE=Image

디스크 용량 확인

$ sudo fdisk -l | grep Disk  
Disk /dev/mmcblk0: 14.5 GiB, 15523119104 bytes, 30318592 sectors
Disklabel type: dos
Disk identifier: 0xc61d9af9
Disk /dev/zram0: 50 MiB, 52428800 bytes, 12800 sectors
Disk /dev/zram1: 60.3 MiB, 63254528 bytes, 15443 sectors
Disk /dev/zram2: 60.3 MiB, 63254528 bytes, 15443 sectors
Disk /dev/zram3: 60.3 MiB, 63254528 bytes, 15443 sectors
Disk /dev/zram4: 60.3 MiB, 63254528 bytes, 15443 sectors

LightDM 설치

$ sudo apt-get -y install xorg lightdm xfce4 tango-icon-theme gnome-icon-theme
$ sudo apt-get install dbus-x11

xrdp 설치

$ sudo apt-get install xrdp
$ sudo apt-cache policy xrdp
xrdp:
  Installed: 0.9.1-9+deb9u3
  Candidate: 0.9.1-9+deb9u3
  Version table:
     0.9.6-1~bpo9+1 100
        100 http://httpredir.debian.org/debian stretch-backports/main arm64 Packages
 *** 0.9.1-9+deb9u3 500
        500 http://httpredir.debian.org/debian stretch/main arm64 Packages
        100 /var/lib/dpkg/status

xorgxrdp 설치

$ sudo apt-get install xorgxrdp
$ sudo apt-cache policy xorgxrdp
xorgxrdp:
  Installed: 0.9.1-9+deb9u3
  Candidate: 0.9.1-9+deb9u3
  Version table:
 *** 0.9.1-9+deb9u3 500
        500 http://httpredir.debian.org/debian stretch/main arm64 Packages
        100 /var/lib/dpkg/status

원격데스크탑 접속

728x90
728x90

Orange Pi Zero Plus2 H5 - Expansion Board

출처 : How to setup Infrared Remote Control in Orange pi Zero using lircd and python – Codelectron
버섯돌이의 허큘렉스 다루기 - IR 입문(2.LIRC 설정및 테스트) - 국내 최대 전자부품 전문 쇼핑몰 아이씨뱅큐
Orange Pi Zero + USB audio card + LIRC - Allwinner H2 & H3 - Armbian forum
Guide: Configuring Orange PI PC+ to receive IR with LIRC - Allwinner H2 & H3 - Armbian forum

Armbian verion 확인

$ cat /etc/armbian-release
## PLEASE DO NOT EDIT THIS FILE
BOARD=orangepizeroplus2-h5
BOARD_NAME="Orange Pi Zero Plus 2"
VERSION=5.34.171121
LINUXFAMILY=sunxi64
BRANCH=next
ARCH=arm64
IMAGE_TYPE=nightly
BOARD_TYPE=conf
INITRD_ARCH=arm64
KERNEL_IMAGE_TYPE=Image

IR Receiver 모듈 설치

$ sudo armbian-config

IR Receiver 모듈 설치 확인

$ dmesg | grep sunxi-ir
[    5.845560] rc rc1: sunxi-ir as /devices/platform/soc/1f02000.ir/rc/rc1
[    5.845702] input: sunxi-ir as /devices/platform/soc/1f02000.ir/rc/rc1/input3
[    5.851001] rc rc1: lirc_dev: driver ir-lirc-codec (sunxi-ir) registered at minor = 0
[    5.851144] sunxi-ir 1f02000.ir: initialized sunXi IR driver
$ lsmod | grep ir
ir_xmp_decoder         16384  0
ir_mce_kbd_decoder     16384  0
ir_sharp_decoder       16384  0
ir_sanyo_decoder       16384  0
ir_sony_decoder        16384  0
ir_jvc_decoder         16384  0
ir_rc6_decoder         16384  0
ir_nec_decoder         16384  0
ir_rc5_decoder         16384  0
ir_lirc_codec          16384  0
lirc_dev               16384  1 ir_lirc_codec
sunxi_cir              16384  0
rc_core                32768  15 ir_sanyo_decoder,ir_rc6_decoder,ir_nec_decoder,ir_mce_kbd_decoder,ir_xmp_decoder,ir_sony_decoder,ir_lirc_codec,ir_sharp_decoder,cec,lirc_dev,ir_jvc_decoder,sunxi_cir,ir_rc5_decoder
$ ls /dev/lirc*
/dev/lirc0

lirc 패키지 설치

$ sudo apt install lirc

mode2 실행하고 리모콘으로 신호 받기

$ mode2 -d /dev/lirc0
space 16777215
pulse 152
space 16944
pulse 216
space 93673
pulse 112
^C
728x90
728x90

출처

 

 

OS 설치

OS 다운로드 - Orange Pi Zero 2+ H5

부팅후 계정 설정

Ubuntu 16.04.3 LTS orangepizeroplus2 ttyS0
 
orangepizeroplus2 login: root
Password: [1234]
You are required to change your password immediately (root enforced)
Changing password for root.
(current) UNIX password: [1234]
Enter new UNIX password: [orangepi]
Retype new UNIX password: [orangepi]
  ___  ____  _   _____                ____  _             ____
 / _ \|  _ \(_) |__  /___ _ __ ___   |  _ \| |_   _ ___  |___ \
| | | | |_) | |   / // _ \ '__/ _ \  | |_) | | | | / __|   __) |
| |_| |  __/| |  / /|  __/ | | (_) | |  __/| | |_| \__ \  / __/
 \___/|_|   |_| /____\___|_|  \___/  |_|   |_|\__,_|___/ |_____|
 
 
Welcome to ARMBIAN 5.34.171121 nightly Ubuntu 16.04.3 LTS 4.13.14-sunxi64
System load:   0.42 0.12 0.04   Up time:       0 min
Memory usage:  8 % of 482MB     IP:
CPU temp:      27°C
Usage of /:    4% of 29G
 
[ General system configuration (beta): armbian-config ]
 
New to Armbian? Check the documentation first: https://docs.armbian.com
 
 
You are using an Armbian nightly build meant only for developers to provide
constructive feedback to improve build system, OS settings or user experience.
If this does not apply to you, STOP NOW!. Especially don't use this image for
daily work since things might not work as expected or at all and may break
anytime with next update. YOU HAVE BEEN WARNED!
 
This image is provided AS IS with NO WARRANTY and NO END USER SUPPORT!.
 
Creating a new user account. Press <Ctrl-C> to abort
 
Please provide a username (eg. your forename): pi
Trying to add user pi
Adding user `pi' ...
Adding new group `pi' (1000) ...
Adding new user `pi' (1000) with group `pi' ...
Creating home directory `/home/pi' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: [orangepi]
Retype new UNIX password: [orangepi]
passwd: password updated successfully
Changing the user information for pi
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n]
 
 
 
Dear pi, your account pi has been created and is sudo enabled.
Please use this account for your daily work from now on.
 
root@orangepizeroplus2:~#

Wifi 설정

armbian 와이파이 설정

출처 : 오렌지파이 제로 무선인터넷 설정 1.2 암비안 와이파이 설정

$ sudo nmtui

eMMC os 설치

출처 : #Test: Orange Pi Plus 2e: unpacking and installing Armbian on eMMC memory • DIY Projects

$ sudo nand-sata-install

XFCE 4.x Desktop 설치

$ su -
# apt-get purge xorg lightdm
# apt-get autoremove
# apt-get -y install xorg lightdm xfce4 tango-icon-theme gnome-icon-theme

JDK 설치

출처 : Install Java 8 on Armbian (Orange Pi Lite or higher) • DIY Projects

저장소 추가

$ sudo add-apt-repository ppa:webupd8team/java

추가한 저장소 반영

$ sudo apt-get update

JDK 설치

$ sudo apt-get install oracle-java8-installer

JAVA_HOME 환경변수 추가

$ sudo vi /etc/profile

내용 추가 export JAVA_HOME=/usr/lib/jvm/java-8-oracle

export JAVA_HOME=/usr/lib/jvm/java-8-oracle

JDK 설치 확인

$ $JAVA_HOME/bin/java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) Client VM (build 25.151-b12, mixed mode)

SD 추가

출처 : Setting up the bootable SD card - Orange Pi

디스크 확인

$ sudo fdisk -l
Disk /dev/mmcblk2: 7.3 GiB, 7818182656 bytes, 15269888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2e3d2df2
 
Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk2p1       8192 15117183 15108992  7.2G 83 Linux
 
 
Disk /dev/mmcblk2boot1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
 
Disk /dev/mmcblk2boot0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
 
Disk /dev/zram0: 60.3 MiB, 63270912 bytes, 15447 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 
 
Disk /dev/zram1: 60.3 MiB, 63270912 bytes, 15447 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 
 
Disk /dev/zram2: 60.3 MiB, 63270912 bytes, 15447 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 
 
Disk /dev/zram3: 60.3 MiB, 63270912 bytes, 15447 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 
 
Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x67c048bb
 
Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       8192 61710591 61702400 29.4G 83 Linux

기존 파이션 삭제 및 파티션 생성

pi@orangepizeroplus2:~$ sudo fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): d
Partition number (1,2, default 2): [Enter]

Partition 2 has been deleted.

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): [Enter]

Using default response p.
Partition number (1-4, default 1): [Enter]
First sector (2048-62333951, default 2048): [Enter]
Last sector, +sectors or +size{K,M,G,T,P} (2048-62333951, default 62333951): [Enter]

Created a new partition 1 of type 'Linux' and of size 29.7 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

pi@orangepizeroplus2:~$ 

디스크 포맷

$ sudo mkfs.ext4 /dev/mmcblk0p1
mke2fs 1.42.13 (17-May-2015)
Discarding device blocks: done                            
Creating filesystem with 7791488 4k blocks and 1949696 inodes
Filesystem UUID: 620c3235-2471-45b6-bd2e-5ead5fc11350
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000
 
Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 

마운트

$ sudo mount /dev/mmcblk0p1 /mnt

마운트 확인

$ df -k
Filesystem     1K-blocks    Used Available Use% Mounted on
udev              178792       0    178792   0% /dev
tmpfs              49432    2440     46992   5% /run
/dev/mmcblk2p1   7304800 1201820   5708872  18% /
tmpfs             247148       0    247148   0% /dev/shm
tmpfs               5120       0      5120   0% /run/lock
tmpfs             247148       0    247148   0% /sys/fs/cgroup
tmpfs             247148       0    247148   0% /tmp
log2ram            51200    1320     49880   3% /var/log
tmpfs              49432       0     49432   0% /run/user/0
tmpfs              49432       0     49432   0% /run/user/1000
/dev/mmcblk0p1  30545420   44992  28925748   1% /mnt

eMMC 백업

$ sudo dd bs=4M if=/dev/mmcblk2 of=/mnt/emmc_backup.img
1864+0 records in
1864+0 records out
7818182656 bytes (7.8 GB, 7.3 GiB) copied, 474.25 s, 16.5 MB/s


728x90
728x90

출처 : orange-pi-gpio - npm
GitHub - BorisKotlyarov/orange-pi-gpio
Arduino Slovakia - Orange Pi Zero and Node.js

node.js 6.X 설치

$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo apt-get install -y nodejs

node.js 8.X 설치

$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
$ sudo apt-get install -y nodejs

node.js 설치 확인

$ node -v
v8.9.3
$ npm -v
5.5.1

orange-pi-gpio 라이브러리 설치

출처 : GitHub - BorisKotlyarov/orange-pi-gpio

$ npm i orange-pi-gpio
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.
 
+ orange-pi-gpio@1.0.2
added 1 package in 6.975s

LED 제어

소스

const Gpio = require('orange-pi-gpio');

let gpio14 = new Gpio({pin:14, mode: 'out', ready: ()=>{
    let value = 1;

    setInterval(function() {
        process.stdout.write('\x1B[2J\x1B[0f\u001b[0;0H');

        if(value){
            console.log('\x1b[32m%s\x1b[0m', `ON`);
        } else {
            console.log('\x1b[31m%s\x1b[0m', `OFF`);
        }
        
        gpio14.write(value);
        value = +!value;
    }, 50);

}});

실행

$ node LEDDemo.js 

728x90
728x90

출처 : ORANGE PI ZERO PIN · Issue #333 · Pi4J/pi4j · GitHub

pi4 다운로드

$ wget http://get.pi4j.com/download/pi4j-1.2-SNAPSHOT.zip

pi4 압축풀기

$ unzip pi4j-1.2-SNAPSHOT.zip

LED 제어

소스

import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.GpioPinDigitalOutput;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;

public class LEDDemo {

	public static void main(String[] args) throws InterruptedException {
		
		// GPIO controller
		final GpioController gpio = GpioFactory.getInstance();
		
		// 14번 핀 모드 변경
		GpioPinDigitalOutput myLed = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_14, // PIN NUMBER
				"My LED", // PIN FRIENDLY NAME (optional)
				PinState.LOW); // PIN STARTUP STATE (optional)
		
		// LED 켜기
		myLed.setState(PinState.HIGH);

		// 5초 대기
		Thread.sleep(5000);

		// LED 끄기
		myLed.setState(PinState.LOW);

		// GPIO controller 리스스 반환
		gpio.shutdown();
	}
}

컴파일

$ javac -cp .:pi4j-1.2-SNAPSHOT/lib/* -d . LEDDemo.java

실행

$ sudo java -cp .:pi4j-1.2-SNAPSHOT/lib/* -Dpi4j.linking=dynamic LEDDemo

728x90
728x90

출처 : GitHub - xpertsavenue/WiringOP-Zero: WiringPi / WiringPi / WiringOP libary for the Orange Pi Zero with 26 pin GPIO header

WiringOP-Zero 설치

WiringOP-Zero 소스 다운로드

$ git clone https://github.com/xpertsavenue/WiringOP-Zero.git

WiringOP-Zero 컴파일및 설치

$ cd WiringOP-Zero
$ chmod +x ./build
$ sudo ./build
 
.. 생략 ...
 
[Install Headers]
[Install Dynamic Lib]
 
WiringPi Devices Library
[UnInstall]
make: Nothing to be done for 'all'.
[Install Headers]
[Install Dynamic Lib]
 
GPIO Utility
[Link]
[Install]
 
All Done.
 
NOTE: To compile programs with wiringBP v2, 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).

설치 확인

$ gpio readall
 +-----+-----+----------+------+--Orange Pi Zero--+---+------+---------+-----+--+
 | H2+ | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | H2+ |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 |     |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |     |
 |  12 |   8 |    SDA.0 | ALT5 | 0 |  3 || 4  |   |      | 5V       |     |     |
 |  11 |   9 |    SCL.0 | ALT5 | 0 |  5 || 6  |   |      | 0v       |     |     |
 |   6 |   7 |   GPIO.7 | ALT3 | 0 |  7 || 8  | 0 | ALT5 | TxD3     | 15  | 198 |
 |     |     |       0v |      |   |  9 || 10 | 0 | ALT5 | RxD3     | 16  | 199 |
 |   1 |   0 |     RxD2 | ALT5 | 0 | 11 || 12 | 0 | ALT3 | GPIO.1   | 1   | 7   |
 |   0 |   2 |     TxD2 | ALT5 | 0 | 13 || 14 |   |      | 0v       |     |     |
 |   3 |   3 |     CTS2 | ALT3 | 0 | 15 || 16 | 0 | ALT4 | GPIO.4   | 4   | 19  |
 |     |     |     3.3v |      |   | 17 || 18 | 0 | ALT4 | GPIO.5   | 5   | 18  |
 |  15 |  12 |     MOSI | ALT5 | 0 | 19 || 20 |   |      | 0v       |     |     |
 |  16 |  13 |     MISO | ALT5 | 0 | 21 || 22 | 0 | ALT3 | RTS2     | 6   | 2   |
 |  14 |  14 |     SCLK | ALT5 | 0 | 23 || 24 | 0 | ALT5 | CE0      | 10  | 13  |
 |     |     |       0v |      |   | 25 || 26 | 0 | ALT3 | GPIO.11  | 11  | 10  |
 +-----+-----+----------+------+---+---LEDs---+---+------+----------+-----+-----+
 |  17 |  30 | STAT-LED |  OUT | 0 | 27 || 28 |   |      | PWR-LED  |     |     |
 +-----+-----+----------+------+---+-----+----+---+------+----------+-----+-----+
 | H2+ | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | H2+ |
 +-----+-----+----------+------+--Orange Pi Zero--+---+------+---------+-----+--+

LED 제어

GPIO 모드 변경

$  gpio mode 14 out

LED 켜기

$ gpio write 14 1

LED 끄기

$ gpio write 14 0

728x90

+ Recent posts