출처

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

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

OMV-Extras 추가 확인

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

공유 폴더 추가

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

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

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

토렌토 클라이언트 Web 화면

출처

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 파티션(파일 시스템) 추가

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

파일 시스템 생성

파일 시스템 생성 완료

추가된 파티션 확인

Orange Pi Zero Plus (H5) : 원격데스크탑(RDP) 설치

OS/Orange PI 2018.09.29 01:03 Posted by 파란크리스마스

출처

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

원격데스크탑 접속

Orange Pi Zero Plus2

OS/Orange PI 2018.01.06 00:28 Posted by 파란크리스마스

Orange Pi Zero Plus2

출처 : 스터디메이크 :: 오렌지파이 제로 보드 간단 사용기
Xunlong Orange Pi Zero

 

 

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

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


Orange Pi Zero - node.js 설치

OS/Orange PI 2017.12.17 20:18 Posted by 파란크리스마스

출처 : 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 

Orange Pi Zero - pi4j

OS/Orange PI 2017.12.17 19:19 Posted by 파란크리스마스

출처 : 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

Orange Pi Zero - WiringOP

OS/Orange PI 2017.12.17 00:05 Posted by 파란크리스마스

출처 : 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

Orange Pi Zero 512MB

OS/Orange PI 2017.12.15 00:58 Posted by 파란크리스마스

Orange PI Zero

출처 : 스터디메이크 :: 오렌지파이 제로 보드 간단 사용기
Xunlong Orange Pi Zero

 

OS 설치

OS 다운로드 - Orange Pi Zero – armbian

UART USB 케이블 연결

부팅후 계정 설정

Ubuntu 16.04.3 LTS orangepizero ttyS0

orangepizero 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.35 user-built Ubuntu 16.04.3 LTS 3.4.113-sun8i   
System load:   0.03 0.14 0.07   Up time:       4 min
Memory usage:  6 % of 494MB     IP:            
CPU temp:      46°C           
Usage of /:    71% of 1.4G   

[ General system configuration (beta): armbian-config ]

Warning: a reboot is needed to finish resizing the filesystem  
Please reboot the system as soon as possible  
New to Armbian? Check the documentation first: https://docs.armbian.com


Thank you for choosing Armbian! Support: www.armbian.com

Creating a new user account. Press  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 []: pi
        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.



Warning: a reboot is needed to finish resizing the filesystem  
Please reboot the system now  

root@orangepizero:~# 

Wifi 설정

출처 : 014. Raspberry Pi 라즈베리 파이 - wheezy무선랜 ... - Tsunami - Tistory

$ cd /etc/ifplugd/action.d/
$ sudo mv ifupdown ifupdown.bk
$ sudo cp /etc/wpa_supplicant/ifupdown.sh ./ifupdown

armbian 와이파이 설정

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

$ sudo nmtui

SD 확장

SD 확장전 용량확인

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            181M     0  181M   0% /dev
tmpfs            50M  1.2M   49M   3% /run
/dev/mmcblk0p1  7.2G  1.1G  6.1G  15% /
tmpfs           248M     0  248M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           248M     0  248M   0% /sys/fs/cgroup
tmpfs           248M     0  248M   0% /tmp
log2ram          50M  1.3M   49M   3% /var/log
tmpfs            50M     0   50M   0% /run/user/1000

SD FDisk

pi@orangepizero:~$ 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): p
Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 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: 0xa3a6ea09

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       8192 15213343 15205152  7.3G 83 Linux

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): p
Partition number (1-4, default 1): 1
First sector (2048-31116287, default 2048): 8192
Last sector, +sectors or +size{K,M,G,T,P} (8192-31116287, default 31116287): 

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

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

pi@orangepizero:~$ sudo shutdown -r now

SD 확장

$ sudo resize2fs /dev/mmcblk0p1
[sudo] password for pi: 
resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/mmcblk0p1 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p1 is now 3888512 (4k) blocks long.

SD 확장 확인

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            181M     0  181M   0% /dev
tmpfs            50M  1.2M   49M   3% /run
/dev/mmcblk0p1   15G  1.1G   14G   8% /
tmpfs           248M     0  248M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           248M     0  248M   0% /sys/fs/cgroup
tmpfs           248M     0  248M   0% /tmp
log2ram          50M  1.5M   49M   3% /var/log
tmpfs            50M     0   50M   0% /run/user/1000

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)

Orange PI Zero - pi4j로 PWM 제어

OS/Orange PI 2017.03.25 12:10 Posted by 파란크리스마스

Orange PI Zero - pi4j로 PWM 제어

Orange PI Zero는 하나의 PWM만 지원

배선

Java 소스

import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.OrangePiZeroGpioProvider;
import com.pi4j.wiringpi.Gpio;
import com.pi4j.wiringpi.SoftPwm;

public class SG90PWMMain {

	private static int PIN_NUMBER = 7;

	public static void main(String[] args) throws Exception {
		//
		//GpioFactory.setDefaultProvider(new RaspiGpioProvider(RaspiPinNumberingScheme.BROADCOM_PIN_NUMBERING));
		//GpioFactory.setDefaultProvider(new OrangePiPc2GpioProvider());
		//GpioFactory.setDefaultProvider(new NanoPiNEOAirGpioProvider());
		GpioFactory.setDefaultProvider(new OrangePiZeroGpioProvider());

		// initialize wiringPi library, this is needed for PWM
		Gpio.wiringPiSetup();

		// softPwmCreate(int pin, int value, int range)
		// the range is set like (min=0 ; max=100)
		SoftPwm.softPwmCreate(PIN_NUMBER, 0, 50);
		int counter = 0;
		while (counter < 3) {
			// fade LED to fully ON
			for (int i = 0; i <= 100; i++) {
				// softPwmWrite(int pin, int value)
				// This updates the PWM value on the given pin. The value is
				// checked to be in-range and pins
				// that haven't previously been initialized via softPwmCreate
				// will be silently ignored.
				SoftPwm.softPwmWrite(PIN_NUMBER, i);
				Thread.sleep(25);
			}
			// fade LED to fully OFF
			for (int i = 100; i >= 0; i--) {
				SoftPwm.softPwmWrite(PIN_NUMBER, i);
				Thread.sleep(25);
			}
			counter++;
		}
	}

}

실행

$ sudo java -cp .:pi4j-core.jar:pi4j-gpio-extension.jar SG90PWMMain

실행 영상

Orange PI Zero GPIO 설치, pi4j

OS/Orange PI 2017.03.25 03:01 Posted by 파란크리스마스

Orange PI Zero GPIO 설치

출처 : WiringOP for Orange pi zero - Beginners - OrangePi - Powered by

현재 pi4j는 Orange PI PC2 지원하지 않아 수정한 jar를 배포합니다.

pi4j-core.jar

$ sudo apt-get install build-essential
$ git clone https://github.com/zhaolei/WiringOP.git -b h3
$ cd WiringOP
$ chmod +x ./build
$ sudo ./build
$ gpio -v
gpio version: 2.20
Copyright (c) 2012-2014 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty
 
Banana Pro Details:
  Type: Banana Pro, Revision: 1.2, Memory: 1024MB, Maker: LeMaker 
orangepi@OrangePizero:~/WiringOP$ gpio readall
 +-----+-----+----------+------+---+-Orange Pi+---+---+------+---------+-----+--+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 |     |     |     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 | ALT3 | TxD3     | 15  | 13  |
 |     |     |       0v |      |   |  9 || 10 | 0 | ALT3 | RxD3     | 16  | 14  |
 |   1 |   0 |     RxD2 | ALT5 | 0 | 11 || 12 | 0 | ALT3 | GPIO.1   | 1   | 110 |
 |   0 |   2 |     TxD2 | ALT5 | 0 | 13 || 14 |   |      | 0v       |     |     |
 |   3 |   3 |     CTS2 | ALT3 | 0 | 15 || 16 | 0 | ALT3 | GPIO.4   | 4   | 68  |
 |     |     |     3.3v |      |   | 17 || 18 | 0 | ALT3 | GPIO.5   | 5   | 71  |
 |  64 |  12 |     MOSI | ALT4 | 0 | 19 || 20 |   |      | 0v       |     |     |
 |  65 |  13 |     MISO | ALT4 | 0 | 21 || 22 | 0 | ALT3 | RTS2     | 6   | 2   |
 |  66 |  14 |     SCLK | ALT4 | 0 | 23 || 24 | 0 | ALT4 | CE0      | 10  | 67  |
 |     |     |       0v |      |   | 25 || 26 | 0 | ALT3 | GPIO.11  | 11  | 21  |
 |  19 |  30 |    SDA.1 | ALT4 | 0 | 27 || 28 | 0 | ALT4 | SCL.1    | 31  | 18  |
 |   7 |  21 |  GPIO.21 | ALT3 | 0 | 29 || 30 |   |      | 0v       |     |     |
 |   8 |  22 |  GPIO.22 | ALT3 | 0 | 31 || 32 | 0 | ALT3 | RTS1     | 26  | 200 |
 |   9 |  23 |  GPIO.23 | ALT3 | 0 | 33 || 34 |   |      | 0v       |     |     |
 |  10 |  24 |  GPIO.24 |  OUT | 0 | 35 || 36 | 0 | ALT3 | CTS1     | 27  | 201 |
 |  20 |  25 |  GPIO.25 |  OUT | 1 | 37 || 38 | 0 | ALT5 | TxD1     | 28  | 198 |
 |     |     |       0v |      |   | 39 || 40 | 0 | ALT5 | RxD1     | 29  | 199 |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+-Orange Pi+---+------+----------+-----+-----+

C언어 샘플 소스

#include <wiringPi.h>
  
int main()
{
  wiringPiSetup();
  pinMode(7, OUTPUT);
  while(1) {
    digitalWrite(7,HIGH);
    delay(500);
    digitalWrite(7,LOW);
    delay(500);
  }
  return 0;
}

컴파일

$ gcc -Wall -o blink blink.c -lwiringPi -lpthread

실행

$ sudo ./blink

java 샘플 소스

/*
 * #%L
 * **********************************************************************
 * ORGANIZATION  :  Pi4J
 * PROJECT       :  Pi4J :: Java Examples
 * FILENAME      :  ControlGpioExample.java
 *
 * This file is part of the Pi4J project. More information about
 * this project can be found here:  http://www.pi4j.com/
 * **********************************************************************
 * %%
 * Copyright (C) 2012 - 2016 Pi4J
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Lesser Public License for more details.
 *
 * You should have received a copy of the GNU General Lesser Public
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/lgpl-3.0.html>.
 * #L%
 */
 
import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.GpioPinDigitalOutput;
import com.pi4j.io.gpio.OrangePiZeroGpioProvider;
import com.pi4j.io.gpio.OrangePiZeroPin;
import com.pi4j.io.gpio.PinState;
 
/**
 * This example code demonstrates how to perform simple state
 * control of a GPIO pin on the Raspberry Pi.
 *
 * @author Robert Savage
 */
public class ControlGpioExample {
 
    public static void main(String[] args) throws InterruptedException {

        //GpioFactory.setDefaultProvider(new OrangePiPc2GpioProvider());
        //GpioFactory.setDefaultProvider(new NanoPiNEOAirGpioProvider());
    	GpioFactory.setDefaultProvider(new OrangePiZeroGpioProvider());

        System.out.println("<--Pi4J--> GPIO Control Example ... started.");
 
        // create gpio controller
        final GpioController gpio = GpioFactory.getInstance();
 
        // provision gpio pin #01 as an output pin and turn on
        final GpioPinDigitalOutput pin = gpio.provisionDigitalOutputPin(OrangePiZeroPin.GPIO_07, "MyLED", PinState.HIGH);
 
        // set shutdown state for this pin
        pin.setShutdownOptions(true, PinState.LOW);
 
        System.out.println("--> GPIO state should be: ON");
 
        Thread.sleep(5000);
 
        // turn off gpio pin #01
        pin.low();
        System.out.println("--> GPIO state should be: OFF");
 
        Thread.sleep(5000);
 
        // toggle the current state of gpio pin #01 (should turn on)
        pin.toggle();
        System.out.println("--> GPIO state should be: ON");
 
        Thread.sleep(5000);
 
        // toggle the current state of gpio pin #01  (should turn off)
        pin.toggle();
        System.out.println("--> GPIO state should be: OFF");
 
        Thread.sleep(5000);
 
        // turn on gpio pin #01 for 1 second and then off
        System.out.println("--> GPIO state should be: ON for only 1 second");
        pin.pulse(1000, true); // set second argument to 'true' use a blocking call
 
        // stop all GPIO activity/threads by shutting down the GPIO controller
        // (this method will forcefully shutdown all GPIO monitoring threads and scheduled tasks)
        gpio.shutdown();
 
        System.out.println("Exiting ControlGpioExample");
    }
}

실행

$ sudo java -cp .:pi4j-core.jar:pi4j-gpio-extension.jar ControlGpioExample

실행결과

Orange PI Zero

OS/Orange PI 2017.03.25 02:01 Posted by 파란크리스마스

Orange PI Zero

출처 : 스터디메이크 :: 오렌지파이 제로 보드 간단 사용기
Xunlong Orange Pi Zero

OS 설치

OS 다운로드 - Orange Pi Zero – armbian

vi 설치

$ sudo apt-get install vim

armbian 와이파이 설정

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

$ sudo nmtui

SD 확장

SD 확장전 용량확인

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       1.6G  1.2G  349M  78% /
devtmpfs        168M     0  168M   0% /dev
tmpfs           224M     0  224M   0% /dev/shm
tmpfs           224M  8.5M  216M   4% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           224M     0  224M   0% /sys/fs/cgroup
tmpfs           224M  4.0K  224M   1% /tmp
/dev/mmcblk0p1   63M  4.6M   59M   8% /media/boot
tmpfs            45M     0   45M   0% /run/user/107
tmpfs            45M     0   45M   0% /run/user/1000

SD FDisk

orangepi@OrangePizero:~$ sudo fdisk /dev/mmcblk0

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


Command (m for help): p
Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 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: 0x000b04ea

Device         Boot  Start     End Sectors  Size Id Type
/dev/mmcblk0p1       40960  172031  131072   64M  b W95 FAT32
/dev/mmcblk0p2      172032 3514367 3342336  1.6G 83 Linux


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

Partition 2 has been deleted.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2048-15523839, default 2048): 172032
Last sector, +sectors or +size{K,M,G,T,P} (172032-15523839, default 15523839): 

Created a new partition 2 of type 'Linux' and of size 7.3 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

orangepi@OrangePizero:~$ sudo shutdown -r now

SD 확장

$ sudo resize2fs /dev/mmcblk0p2
resize2fs 1.42.12 (29-Aug-2014)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p2 is now 1918976 (4k) blocks long.

SD 확장 확인

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       7.3G  1.2G  5.8G  17% /
devtmpfs        168M     0  168M   0% /dev
tmpfs           224M     0  224M   0% /dev/shm
tmpfs           224M  8.5M  216M   4% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           224M     0  224M   0% /sys/fs/cgroup
tmpfs           224M  4.0K  224M   1% /tmp
/dev/mmcblk0p1   63M  4.6M   59M   8% /media/boot
tmpfs            45M     0   45M   0% /run/user/107
tmpfs            45M     0   45M   0% /run/user/1000

vnc 설치

출처 : Armbian: Access the Remote Desktop of Orange Pi with VNC

vnc 설치

$ sudo apt-get update && apt-get upgrade
$ sudo apt-get install tightvncserver

vnc 사용자 추가

$ su - 
# adduser vnc
Adding user `vnc' ...
Adding new group `vnc' (1001) ...
Adding new user `vnc' (1001) with group `vnc' ...
Creating home directory `/home/vnc' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for vnc
Enter the new value, or press ENTER for the default
        Full Name []: VNCuser
        Room Number []: 
        Work Phone []: 
        Home Phone []: 
        Other []: 
Is the information correct? [Y/n] 

vnc 사용자 추가

# gpasswd -a vnc sudo
Adding user vnc to group sudo

vnc 서버 실행

# su - vnc
$ vncserver :1
 
You will require a password to access your desktops.
 
Password: 
Verify:   
Would you like to enter a view-only password (y/n)? 
*** buffer overflow detected ***: vncpasswd terminated
xauth:  file /home/vnc/.Xauthority does not exist
 
New 'X' desktop is OrangePizero:1
 
Creating default startup script /home/vnc/.vnc/xstartup
Starting applications specified in /home/vnc/.vnc/xstartup
Log file is /home/vnc/.vnc/OrangePizero:1.log

JDK 설치

$ sudo apt install -t jessie-backports openjdk-8-jre openjdk-8-jre-headless openjdk-8-jdk openjdk-8-jdk-headless ca-certificates-java

JAVA_HOME 환경변수 추가

$ sudo vi /etc/profile

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

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-armhf

Orange PI PC2 GPIO 설치, pi4j

OS/Orange PI 2017.03.17 01:53 Posted by 파란크리스마스

Orange PI PC2 GPIO 설치

출처 : This is a modified WiringPi for OrangePi. We call it WiringOP. Test fo Orangepi pc
OrangePi-PCを使ってみる WiringPiとWiringOP
Orange PI PC 2 GPIO доступ через sysfs

현재 pi4j는 Orange PI PC2 지원하지 않아 수정한 jar를 배포합니다.

pi4j-core.jar

$ git clone https://github.com/kazukioishi/WiringOP.git -b h5
$ cd WiringOP
$ chmod +x ./build
$ sudo ./build
$ gpio -v
gpio version: 2.20
Copyright (c) 2012-2014 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty
 
Banana Pro Details:
  Type: Banana Pro, Revision: 1.2, Memory: 1024MB, Maker: LeMaker 
$ gpio readall
 +-----+-----+----------+------+---+-Orange Pi+---+---+------+---------+-----+--+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 |     |     |     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  | 13  |
 |     |     |       0v |      |   |  9 || 10 | 0 | ALT5 | RxD3     | 16  | 14  |
 |   1 |   0 |     RxD2 | ALT5 | 0 | 11 || 12 | 0 | ALT3 | GPIO.1   | 1   | 110 |
 |   0 |   2 |     TxD2 | ALT5 | 0 | 13 || 14 |   |      | 0v       |     |     |
 |   3 |   3 |     CTS2 | ALT5 | 0 | 15 || 16 | 0 | ALT3 | GPIO.4   | 4   | 68  |
 |     |     |     3.3v |      |   | 17 || 18 | 0 | ALT3 | GPIO.5   | 5   | 71  |
 |  64 |  12 |     MOSI | ALT4 | 0 | 19 || 20 |   |      | 0v       |     |     |
 |  65 |  13 |     MISO | ALT0 | 0 | 21 || 22 | 0 | ALT5 | RTS2     | 6   | 2   |
 |  66 |  14 |     SCLK | ALT4 | 0 | 23 || 24 | 0 | ALT4 | CE0      | 10  | 67  |
 |     |     |       0v |      |   | 25 || 26 | 0 | ALT3 | GPIO.11  | 11  | 21  |
 |  19 |  30 |    SDA.1 | ALT4 | 0 | 27 || 28 | 0 | ALT4 | SCL.1    | 31  | 18  |
 |   7 |  21 |  GPIO.21 | ALT3 | 0 | 29 || 30 |   |      | 0v       |     |     |
 |   8 |  22 |  GPIO.22 | ALT3 | 0 | 31 || 32 | 0 | ALT5 | RTS1     | 26  | 200 |
 |   9 |  23 |  GPIO.23 | ALT3 | 0 | 33 || 34 |   |      | 0v       |     |     |
 |  10 |  24 |  GPIO.24 | ALT3 | 0 | 35 || 36 | 0 | ALT5 | CTS1     | 27  | 201 |
 |  20 |  25 |  GPIO.25 |  OUT | 1 | 37 || 38 | 0 | ALT5 | TxD1     | 28  | 198 |
 |     |     |       0v |      |   | 39 || 40 | 0 | ALT5 | RxD1     | 29  | 199 |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+-Orange Pi+---+------+----------+-----+-----+

C언어 샘플 소스

#include <wiringpi.h>
 
int main()
{
  wiringPiSetup();
  pinMode(7, OUTPUT);
  while(1) {
    digitalWrite(7,HIGH); 
    delay(500);
    digitalWrite(7,LOW); 
    delay(500);
  }
  return 0;
}

컴파일

$ gcc -Wall -o blink blink.c -lwiringPi -lpthread

실행

$ sudo ./blink
wiringPi: wiringPiSetup called
piboardRev: Hardware string: Hardware   : sun50iw2
Hardware:Hardware       : sun50iw2
piboardRevH3:  3
piboardRev: Hardware string: Hardware   : sun50iw2
Hardware:Hardware       : sun50iw2
piboardRevH3:  3
piboardRev: Hardware string: Hardware   : sun50iw2
Hardware:Hardware       : sun50iw2
piboardId: Revision string: 0000
pinMode,1947,pin:7,mode:1
func:sunxi_set_gpio_mode pin:6, MODE:1 bank:0 index:6 phyaddr:0x1c20800
read reg val: 0x71222222 offset:24
Out mode ready set val: 0x71222222
Out mode set over reg val: 0x71222222
digitalWrite,2270
func:sunxi_digitalWrite pin:6, value:1 bank:0 index:6 phyaddr:0x1c20810
befor write reg val: 0x100040,index:6
HIGH val set over reg val: 0x100040
digitalWrite,2270
func:sunxi_digitalWrite pin:6, value:0 bank:0 index:6 phyaddr:0x1c20810
befor write reg val: 0x100040,index:6
LOW val set over reg val: 0x100000
digitalWrite,2270
func:sunxi_digitalWrite pin:6, value:1 bank:0 index:6 phyaddr:0x1c20810
befor write reg val: 0x100000,index:6
HIGH val set over reg val: 0x100040
digitalWrite,2270
func:sunxi_digitalWrite pin:6, value:0 bank:0 index:6 phyaddr:0x1c20810
befor write reg val: 0x100040,index:6
LOW val set over reg val: 0x100000
digitalWrite,2270
func:sunxi_digitalWrite pin:6, value:1 bank:0 index:6 phyaddr:0x1c20810
befor write reg val: 0x100000,index:6
HIGH val set over reg val: 0x100040

java 샘플 소스

import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.OrangePiPc2GpioProvider;
import com.pi4j.wiringpi.Gpio;

public class Blink {

	public static void main(String[] args) throws InterruptedException {
		
		GpioFactory.setDefaultProvider(new OrangePiPc2GpioProvider());

		// setup wiring pi
		if (Gpio.wiringPiSetup() == -1) {
			System.out.println(" ==>> GPIO SETUP FAILED");
			return;
		}

		Gpio.pinMode(7, Gpio.OUTPUT);
		while (true) {
			Gpio.digitalWrite(7, Gpio.HIGH);
			Gpio.delay(500);
			Gpio.digitalWrite(7, Gpio.LOW);
			Gpio.delay(500);
		}
	}
}

실행

$ sudo java -cp .:pi4j-core.jar:pi4j-gpio-extension.jar Blink

실행결과