8,367
edits
Changes
no edit summary
'''1)Hardware Connection Sketch Map'''<br>
<br>
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img22.png|400px|]]<br><div style="width:400px;text-align:center;">Orange Pi PC2 runs on Android 4.4 system</div></div>
<br>
<div style="padding-left:200px;">
[[文件:Orange-pi-pc2-img23.png|400px|]]<br>
<div style="width:400px;text-align:center;">Orange Pi PC2 runs on Android Debian system</div></div><br><div style="padding-left:200px;">[[文件:Orange-pi-pc2-img24.png|400px|]]<br><div style="width:400px;text-align:center;">Orange Pi PC2 runs on Ubuntu system</div></div><br><div style="padding-left:200px;">[[文件:Orange-pi-pc2-img25.png|400px|]]</div><br>'''2)Details of Booting Steps'''<br><br>a.Insert the TF card with written image in to the TF card slot.<br>b.It is HDMI interface on the bottom edge of the board. You could use HDMI cable to connect your Orange Pi to HDMI TV or monitor.You could also use AV interface and audio interface to connect output video and audio to analog TV or display.<br>c.Insert USB keyboard and mouse into the USB interface.<br>d.It is the network port in the middle of 3USB interfaces, which you can access Orange Pi to the wired network.<br>e.It is the power input interface on the right side for connecting a power adapter up to or bigger than 5V/2A. Avoid using smaller power GSM mobile phone charger, it is not able to output 2A even if it marked "5V/2A ".<br><br>Note: Micro-USB(OTG)cannot use as power input which may cause the fail boot of the OrangePi. Only the power interface could input power.<br><br>The Orange Pi will boot in a few minutes If the above steps are successful. There will be graphical interface in he monitor. It may take a long time to start the first time, please wait patiently. The next time will boot very fast.<br><br>=== '''Step 4: Turn off your Orange Pi Correctly''' ===<br>* You can use the shutdown button on the interface to safety close the Orange Pi.* You can also close the system by entering commands in the shell:<br>'''sudo halt''' or '''sudo shutdown –h'''<br><br>It will be safety to turn off the Orange Pi. If directly use the power button to shut down the system may damage the file system on TF Card. After the system is closed, the power can be cut off by more than 5 seconds’ press.<br><br>=== '''Other configuration''' ===<br>'''1)Connect to the wired network'''<br><br>If the Orange Pi has connect to wire cable, then the system would obtain the IP address automatically. If there is no wire cable connecting, then the system would fail at obtaining IP address which could cause the booting delay.<br>After connecting to wired network, it should be green LED lighting and yellow LED flashing. You need to make sure the image you wrote is correspondent since some boards are 100M Ethernet but some are 1000M Ethernet.<br>100M Ethernet is using internal phy, configuration just like the following:<br>2 indicates internal phy<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img26.png|600px|]]</div><br>1000M Ethernet is using external phy<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img27.png|600px|]]</div><br>The above configuration has been configured, you could refer to it when using.<br><br>'''2)Login via vnc and ssh'''<br><br>If there is no condition for connecting HDMI, you could enter the system via vnc or ssh remote login.<br>* Login via serial port and install ssh apt-get install ssh* Modify ssh configuration file /etc/ssh/sshd_config<br><div style="padding-left:200px;">[[文件:Orange-pi-pc2-img28.4 png|400px|]]</div><br>* Check the IP with ifconfig, login via ssh of root user<br><div style="padding-left:200px;">[[文件:Orange-pi-pc2-img29.png|600px|]]</div><br>'''3)HDMI or 3.5mm Sound Output'''<br><br>a.The sound was default to output via HDMI on image, it could check and change via alsamixer.<br>ls /etc/asound.conf<br>card indicates card number, device indicates device number.<br>aplay -l it could check the system to load the sound card number and details<br>cat /proc/asound/cards it also could check the sound card and details It could be used after use alsamixer to change the sound card.<br>alsactl store -f /var/lib/alsa/asound.state used for saving modified parameters<br>b.It needs to modify configuration on file systemfor output on 3.5mm of/etc/asound.conf, modify card1 into card0, or use amixer to modify. The default one is configured, or you could use player on graphical interface to switch via sound channel selection.<br>c.How to use mic sound recording <br>arecord -d 5 -f cd -t wav 123.wav<br>After recording, use the following to play <br>aplay 123.wav<br><br>=== '''Universal Software Configuration''' ===<br>'''1)Default Account Changing'''<br><br>The default log in account is orangepi. In order to secure, it is recommended to modify the default orangepi accounts to your own account, for example Zhangsan. Steps are as follows:<br>a.Use root account to login Orange Pi(please note that do not login with the account of orangepi<br>b.$ usermod -l zhangsan orangepi Change orangepi account into Zhangsan<div style="padding-left:100px;">[[文件:Orange-pi-pc2-img30.png|400px|]]</div>c.$ groupmod -n zhangsan orangepi Change group<div style="padding-left:100px;">[[文件:Orange-pi-pc2-img31.png|400px|]]</div>d.$ mv /home/ornagepi /home/zhangsan Change directory of original orangepi<div style="padding-left:80px;">[[文件:Orange-pi-pc2-img32.png|600px|]]</div>e.$ usermod -d /home/orangepi orangepi Set this directory to orangepi user's home directory<div style="padding-left:80px;">[[文件:Orange-pi-pc2-img33.png|600px|]]</div>f.$ cat /etc/passwd It should be shown as below:<div>[[文件:Orange-pi-pc2-img34.png|800px|]]</div>After the modification of the above iterms, it can be used the new account Zhangsan to land.<br><br>'''2)U Disk Automatic Mounted Configuration'''<br><br>a.sudo apt-get install usbmount<br>b.sudo vim /etc/udev/rules.d/automount.rules <br>ACTION=="add",KERNEL=="sdb*", RUN+="/usr/bin/pmount --sync--umask 000 %k"<br>ACTION=="remove", KERNEL=="sdb*", RUN+="/usr/bin/pumount %k" ACTION=="add",KERNEL=="sdc*", RUN+="/usr/bin/pmount --sync--umask 000 %k"<br>ACTION=="remove", KERNEL=="sdc*", RUN+="/usr/bin/pumount %k"<br><br>c.udevadm control –reload-rules <br>It could refer to this:<br>http://unix.stackexchange.com/questions/134797/how-to-automatically-mou nt-an-usb-device-on-plugin-time-on-an-already-running-sy<br><br>'''3)System Source Configuration'''<br><br>Take Ubuntu as an example:<br>a.Open the source file<br>$ sudo vi /etc/apt/sources.list<div>[[文件:Orange-pi-pc2-img35.png|800px|]]
</div>
b.Edit source file<br>
Replace the source file with your favorite source. Take an example of Ubuntu 16.04 on Zhonkeda source:<br>
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe<br>
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe<br>
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe<br>
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe<br>
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe<br>
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe<br>
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe<br>
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe<br>
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe<br>
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe<br>
Note: xenial is the version of the code name in this source, if the other version of Ubuntu needs to replace the corresponding version code which can be found on the internet.<br>
<br>
'''4)Remote desktop installation'''
<br>
There are a lot of software, such as VNG, XRDP, X2GO, etc. For X2GO, it has more functions, and desktop color restore is very good which does not need too much configuration. And XRDP is much more safety than VNC.<br>
a.$sudo apt-get install tightvncserver Install VNC
<div>[[文件:Orange-pi-pc2-img36.png|400px|]]</div>
<br>
b.vncpassw Set the password: do not execute this command but executing vncserver directly. It will prompt you to enter the password twice, when prompted whether can be read only to select the N.
<div>[[文件:Orange-pi-pc2-img37.png|800px|]]</div>
<br>
c.Open one or more of desktops by vncserver or vncserver:1(vncserver:2)… you can also transfer more parameters through the full command as below:<br>
vncserver :1 -geometry 1024x768 -depth 16 -pixelformat rgb565<br>
(Note: If it prompted you that cannot find the file or other error when installing, please run sudo apt-get update to update the software source and try installing again.)<br>
<br>
'''5)NAS and DLAN Configuration'''
<br>
a.NAS:<br>
There are many files could be reference from Internet, for example: http://www.geekfan.net/5003/, it detailed descriptions on the operation and the mounted of U disk is very useful.<br>
b.DLNA:<br>
Mainly through the minidlna software to achieve the sharing of media resources within the LAN, such as sharing video, music, etc.. The installation steps are as follows:<br>
i. sudo apt-get minidlna<br>
ii. Execute the following command to modify the configuration file: <br>
sudo nano /etc/minidlna.conf<br>
Note: you can also use other text editor to modify. <br>
iii. Add the following:<br>
media_dir=A,/nas, path: /DLNA/Music<br>
media_dir=V,/nas, path: /DLNA/Video <br>
media_dir=P,/nas, path: DLNA/Picture <br>
db_dir=/nas, path: /DLNA/log <br>
db_dir=/nas, path: /DLNA/db<br>
ctrl +o and enter, ctrl +x to save and exit.<br>
iv. Established above folders respectively, noted that path consistency and assigned to read and write permissions. In order for convenient, it could be Chmod 755, such as sudo Chmod 755 /nas path /DLNA/Music<br>
v. Re-start minidlna to take effect the configuration: /etc/init.d/minidlna restart.<br>
Transmit the corresponding file on the computer to the corresponding folder through samba.<br>
Note: It is recommended to download MoliPlayer on the mobile device. The effect is good and no blue light pressure on both Android and IOS.<br>
<br>
'''6)Thunder remote download'''
<br>
a.Go to the Thunder routing forum to download the required installation package first. The link for stable version:<br>
http://luyou.xunlei.com/thread-12545-1-1.html. <br>
Download Xware1.0.31_cubieboard zip file.
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img38.png|800px|]]</div>
<br>
Note: If you want to try the latest version, you can download the latest test version: http://luyou.xunlei.com/thread-15167-1-1.htm.<br>
b.Enter the directory after uploaded the unzip file to OrangePi. It is recommended to rename the file to xunlei<br>
c.Installation method of version 1.0.31:<br>
i $ cd /xxx/xunlei The xxx is the directory of installation xunlei file <br>
ii $ chmod 755 portal<br>
iii $ ./portal
<div>[[文件:Orange-pi-pc2-img39.png|800px|]]</div>
<br>
iv You will get an activation code after booting like the following:
<div>[[文件:Orange-pi-pc2-img40.png|800px|]]</div>
<br>
v Copy this activation code to http://yuancheng.xunlei.com (Which required to log in with account of Thunder). Then click the tab on the top right corner to add, fill in the activation code to complete the binding according to the following figure.
<div>[[文件:Orange-pi-pc2-img41.png|800px|]]</div>
<br>
vi Setting start up<br>
$ sudo nano /etc/rc.loacl<br>
add the following contents before exit 0 <br>
cd /xx/xunlei<br>
./portal &
ctrl +o and enter, ctrl +x to save and exit.<br>
d.Installation of version 3.0.32.253:<br>
i $ cd /xxx/xunlei The xxx is the directory of installation file of xunlei<br>
ii $ sudo nano thunder_mounts.cfg Modify the download path
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img42.png|400px|]]</div>
<br>
iii chmod +x etm_monitor<br>
iv Run ./etm_monitor, there will be an activation code page like
version 1.0.32. And then binding on the Thunder remote page (above steps 4, 5). There might be one or two errors while running, ignore it (selection type of shell and generation of INI file).<br>
v Setting start up<br>
sudo nano /etc/rc.loacl <br>
add the following contents before exit 0 <br>
cd /xx/xunlei<br>
./etm_monitor &<br>
ctrl +o and enter, ctrl +x to save and exit.<br>
It could be remote downloading on computer, mobile phone or tablet by login yuancheng.xunlei.com<br>
<br>
'''7)Modify the size of ext4 file system'''
<br>
After made the written image into SD card for booting, enter into rootfs partition’s expansion of file system. It could enhance the performance of SD card to avoid limited storage cause prblem.<br>
<br>
* Method 1
<br>
Extend rootfs file partition of TF card on PC:
Select the specified disk, right click and select the corresponding disk, select "change size" and adjust it into your desired size, click "resize", close the dialog box and click "apply all operations", select the application to complete the expansion operation<br>
<br>
* Method 2
<br>
Enter into the system and extend via shell Before partition
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img43.png|400px|]]</div>
<br>
Eneter into system and expend via resize_rootfs.sh
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img44.png|400px|]]</div>
<br>
Enter resize_rootfs.sh on command line, the system will expending automatically,
Reboot the system and use df -lh to check whether expending is successful
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img45.png|400px|]]</div>
<br>
a.Expand file system<br>
i. Boot to Linux, umount /dev/sdb1 and /dev/sdb2, if it prompts disk busy, then use fuser to clean the using disk(we will recommend using another Linux booting disk to lead the system).<br>
ii. Use fdisk /dev/sdb to adjust the partition size, after into it, enter p, and keep in mind about the initial position of needed extending size partition.<br>
iii. Enter d to delete the partition need to change the size(my file system is /dev/sdb2, which is the 2 partition ).<br>
iv. Enter n to build a new partition, make sure the initial position is the same as you deleted, and enter the number as you desire.<br>
v. Enter w to save the partition data.<br>
vi. Use the following command to check the file system(make sure it is a right file system)<br>
e2fsck -f /dev/sdb2<br>
vii. Adjust the partition size <br>
resize2fs /dev/sdb2<br>
viii. It could mount a disk partition, you could check whether it has changed.<br>
<br>
b.Shrink file system<br>
i. Boot to Linux, umount /dev/sdb1 and /dev/sdb2, if it prompts disk busy, then use fuser to clean the using disk(we will recommend using another Linux booting disk to lead the system).<br>
ii. Use the following command to check the file system(make sure it is a right file system)<br>
e2fsck -f /dev/sdb2<br>
iii. Modify the size of file system(Use resize2fs)<br>
resize2fs /dev/sdb2 900M<br>
The "s"after the number represents specifying the size of file system via the sectors(every sector calculated by 512 bite). You could also specify it into K(KB), M(MB), G(GB), etc.<br>
iv. Use fdisk /dev/sdb to adjust the partition size, after into it, enter p, and keep in mind about the initial position of needed extending size partition. You need to first delete the partition then build a new one because the fdisk could not modify the size dynamic(you need to calculate the size, it have to enough to contain the file system adjusted in last step).
v. Enter d to delete the partition need to change the size(my file system is /dev/sdb2, which is the 2 partition ).<br>
vi. Enter n to build a new partition, make sure the initial position is the same as you deleted, and enter the number as you desire. Besides, if it is bootable partition you want to change, note that need to keep the bootable mark in case cannot boot.<br>
The above illustration is using fdisk and resize2fs to modify partition and file system, you could also use gparted. Gparted has graphical interface and it could help you to re-size file system at the same time of re-sizing partition. Goarted is much easier to use and reduce the change to make mistake. For now our offial Lubuntu and Raspbian could not use it.<br>
<br>
'''8)How to use gc2035 on Linux'''
<br>
a.Use find command to find the location of the following files, and load it according to the specified order<br>
insmod videobuf-core.ko <br>
insmod videobuf-dma-contig.ko <br>
insmod uvcvideo.ko<br>
insmod cci.ko <br>
insmod vfe_os.ko<br>
insmod vfe_subdev.ko <br>
insmod gc2035.ko <br>
insmod vfe_v4l2.ko<br>
There should be generated video0 on /dev/ after loaded. After low-level driver install, then the Andoird could be used directory.<br>
b. Use camera in Linux<br>
i Load up driver<br>
sudo modprobe gc2035 <br>
sudo modprobe vfe_v4l2<br>
ii. Install motion<br>
sudo apt-get install motion<br>
iii. Modify configuration <br>
sudo nano /etc/motion/motion.conf <br>
stream_localhost off<br>
iv. Create folder for images saving <br>
mkdir ~/motion<br>
v. Modify permission <br>
chmod 777 motion<br>
vi. Continue modifying configuration <br>
sudo nano /etc/default/motion <br>
start_motion_daemon=yes<br>
vii. Boot the server <br>
Sudo /etc/init.d/motion start<br>
Enter the following in browser: localhost:8081 <br>
You could check image output from camera.<br>
Besides, you could also refer to this link:<br>
http://www.cnx-software.com/2015/09/26/how-to-use-orange-pi-camera-in-l inux-with-motion/<br>
<br>
'''9)eth0 and wlan0 static mac address setting'''
<br>
a.If the system do not use systemd, you could modify rc.local directory and add the following:<br>
$ vim /etc/rc.local <br>
MAC=00:e0:4c:a1:2b:d4<br>
ifconfig wlan0 down<br>
ifconfig wlan0 hw ether $MAC <br>
ifconfig wlan0 up<br>
dhclient &<br>
After rebooting, you could use ifconfig to check whether mac address has changed.<br>
b.If the system used systemd, you also need to add the following besides the above steps:<br>
$ cd /etc/systemd/system/<br>
$ vim change_mac_address.service (You could name the server, format just like the following)<br>
<br>
[unit]<br>
Description=Change OrangePi Wifi mac address<br>
<br>
[Service] <br>
ExecStart=/etc/rc.local RemainAfterExit=yes<br>
<br>
[Install]<br>
sWantedBy=multi-user.target<br>
<br>
$ systemctl enable change_mac_address.service<br>
Modify mac address of eth0 is same as modifying wlan0’s, just need to replace wlan0 into eth0.<br>
<br>
'''10)Orange Pi Android root'''
<br>
There is defaulted with root permission on Android pre-installed, but lacking authorization management software. The following is how to add authorization management software.<br>
<br>
You need to have UsbModeSwitch.apk and UPDATE-SuperSU-v2.46.zip, install kingroot and make sure OTG on Orange Pi could connect to PC.<br>
<br>
a.Open adb debug mode<br>
Use U disk or card reader to install UsbModeSwitch.apk into Orange Pi OS and open it, tick "enable usb device mode" and use debug cable to connect OTG port and PC (make sure it is micro usb-cable in case other cables could not be recognized). Normally PC would search and install adb driver software automatically. If PC failed to install, you could install PC version’s Peasecod to install the driver software.<br>
<br>
b.After connected Orange PI and PC, open command mode of PC, enter related command of adb(you need to install adb debug command, which Peasecod has adb command ). Here is the command:<br>
adb remount <br>
adb shell<br>
windows(win+r) command line enter into command mode, then enter into kingroot directory and execute the following steps:<br>
adb shell<br>
root@rabbit-p1:/ # mkdir /tmp <br>
root@rabbit-p1:/ # cd /system/bin<br>
root@rabbit-p1:/ # mount -o remount, rw /system<br>
root@rabbit-p1:/system/bin # ln -s busybox-smp unzip <br>
Logout adb shell Mode<br>
root@rabbit-p1:/exit (Or Ctrl + C) <br>
Unzip UPDATE-SuperSU-v2.46.zip<br>
You will obtain META-INF/com/google/android/update-binary and put it into specific catalog.<br>
adb push /path/UPDATE-SuperSU-v2.46.zip /data/local/tmp path is file’s path<br>
adb push /path/ update-binary /data/local/tmp <br>
adb shell<br>
root@rabbit-p1:/ #cd /data/local/tmp <br>
root@rabbit-p1:/ #sh update-binary 0 1<br>
/data/local/tmp/UPDATE-SuperSU-v2.46.zip<br>
<nowiki>......</nowiki><br>
<nowiki>......</nowiki><br>
After executed scripts, enter reboot command and reboot it, you could use the device authorization management software normally.<br>
After rebooted, there might be no super administrator icon, you need to delete the desk configuration file and reboot the board.<br>
<br>
'''11)WiringPi installation and usage'''
<br>
a. Install WiringPi<br>
i Install compilation tools for source code compilation<br>
$ sudo apt-get install gcc g++ make <br>
ii Compile GPIO driver of H5<br>
git clone https://github.com/kazukioishi/WiringOP.git -b h5 <br>
cd WiringOP<br>
chmod +x ./build <br>
sudo ./build<br>
iii GPIO print out information <br>
# gpio -v<br>
gpio version: 2.20<br>
Copyright (c) 2012-2014 Gordon Henderson<br>
This is free software with ABSOLUTELY NO WARRANTY. For details type: gpio -warranty<br>
<br>
Banana Pro Details:<br>
<br>
Type: Banana Pro, Revision: 1.2, Memory: 1024MB, Maker: LeMaker <br>
iv Display<br>
gpio readall
<div>[[文件:Orange-pi-pc2-img46.png|800px|]]</div>
<br>
== '''Linux Kernel Source Code Compilation''' ==
<br>
In order to support the rapid development of the project, we are writing this sections for project configuration options to the binary file. When the system is running, it can get the information of the system running by reading the binary file, which can greatly simplify the time of project development.<br>
This manual describes how to use the binary file to speed up the development of the project.<br>
Hardware: Orange Pi development board*1, Card reader*1, TF card*1, power supply*1
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img47.png|800px|]]</div>
<br>
Note: In the following sections, * indicates wild-cards, you need to fill in the actual values according to their file storage path.<br>
<br>
=== '''Download Linux Source Code''' ===