Changes

Jump to: navigation, search

Orange Pi Zero

130 bytes removed, 20:12, 30 June 2022
no edit summary
== '''Orange pi Introduction''' ==
<br>
=== '''What is orange pi zeroOrange Pi Zero?''' ===
<br>
 It’s an open-source single-board computer. It can run Android 4.4, Ubuntu, Debian, Rasberry Pi Image. It uses the AllWinner H2 SoC, and has 256MB/512MB DDR3 SDRAM(256MB version is Standard version).<br>
* Scratch
* ......
* Pretty much anything else, because orange pi Orange Pi Zero is open source
<br>
=== '''Whom is it for?''' ===
|}
<br>
<div style="display:flex;padding-left:200px;">
<div style="text-align:center;">
[[File:Orange-pi-pc2-img9.png|200px200px|]]<br>
</div>
<br>
<div style="display:flex;padding-left:200px;">
<div style="text-align:center;">
[[File:Orange-pi-r1-img-4.png|100px|]]<br>
</div>
c.Download the operating system image file from the download page, the page address is as following:<br>
http://www.orangepi.org/downloadresourceshtml/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero.html<br>
d.Unzip the downloaded file (in addition to the Android system, this method can be used to burn to write, the Android system need another burn, the following will introduce)<br>
e.Right click to download the file, select "Unzip file" to write image to TF card
<br>
c.Download the OS image from download page <br>
http://www.orangepi.org/`downloadresourceshtml/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero.html<br>
<br>
d.Unzip and right click the downloaded file, select " Unzip file"<br>
https://drive.google.com/file/d/0B_VynIqhAcB7NTg2UkRDdHRWX2s/edit?usp=sharing<br>
Download Android OS image from here: <br>
http://www.orangepi.org/downloadresourceshtml/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero.html<br>
b.Format the TF card<br>
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img15.png|400px|]]</div>
<br>
c.Please make sure the inserted TF card is in accordance with the chosen TF card, click "format to normal" button for TF card formatting.<br>
<br>
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img16.png|600px|]]</div>
<br>
d.Click "OK" button after successfully formatted the TF card to normal.<br>
e.Burn the Android OS image into your TF card. Please pay attention to the following with red marks.<br>
<br>
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img17.png|600px|]]</div>
<br>
f.Click "Burn" button for writing to TF card and wait for it finish<br>
<br>
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img18.png|600px|]]</div>
<br>
g.Click "Exit" button after burn Android image to TF card successfully.<br>
<br>
<br>
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img19.png|400px|]]</div>
<br>
ii. Select the image file path that has been unzipped<br>
<br>
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img20.png|600px|]]</div>
<br>
iii. Click "start" button and wait for the image to write.<br>
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img21.png|600px|]]</div>
<br>
<br>
'''1)Hardware Connection Sketch Map'''<br>
<br>
<div style="padding-left:200px;">
[[File:Orange-pi-zero-img3.png|400px|]]<br>
[[File:Orange-pi-plus-2e-img10.png|400px|]]<br>
</div>
<br>
<div style="padding-left:200px;">
[[File:Orange-pi-plus-2e-img11.png|400px|]]<br>
<div style="width:400px;text-align:center;">Orange Pi Zero runs on Debian system</div>
</div>
<br>
<div style="padding-left:200px;">
[[File:Orange-pi-plus-2e-img12.png|400px|]]<br>
<div style="width:400px;text-align:center;">Orange Pi Zero runs on Ubuntu system</div>
* Modify ssh configuration file /etc/ssh/sshd_config
<br>
<div style="padding-left:200px;">
[[File:Orange-pi-pc2-img28.png|400px|]]
</div>
* Check the IP with ifconfig, login via ssh of root user
<br>
<div style="padding-left:200px;">
[[File:Orange-pi-pc2-img29.png|600px|]]
</div>
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.Switch It needs to graphical interface<br>Open smplayermodify configuration on file system for output on 3.5mm of /etc/asound.conf,select preferences on optionsmodify card1 into card0, select alsa(audiocodec)or use amixer to modify. It could only open The default one of HDMI is configured, or audiocodec in one timeyou 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>
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; ">
[[File:Orange-pi-pc2-img30.png|400px|]]
</div>
c.$ groupmod -n zhangsan orangepi Change group
<div style="padding-left:100px; ">
[[File:Orange-pi-pc2-img31.png|400px|]]
</div>
http://luyou.xunlei.com/thread-12545-1-1.html. <br>
Download Xware1.0.31_cubieboard zip file.
<div style="padding-left:200px;">[[File: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>
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;">[[File:Orange-pi-pc2-img42.png|400px|]]</div>
<br>
iii chmod +x etm_monitor<br>
<br>
Enter into the system and extend via shell Before partition
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img43.png|400px|]]</div>
<br>
Eneter into system and expend via resize_rootfs.sh
<div style="padding-left:200px;">[[File: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;">[[File:Orange-pi-pc2-img45.png|400px|]]</div>
<br>
a.Expand file system<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;">[[File:Orange-pi-zero-plus-img4.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>
You could download the source code from the official website:<br>
http://www.orangepi.org/downloadresourceshtml/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero.html
<br>
Subsection and compress the file, then unzip it after finish downloaded:
<div style="padding-left:200px;">[[File:Orange-pi-r1-img-9.png|600px|]]</div>
<br>
buildroot: Project compilation script<br>
brandy: gcc-linaro, boot and uboot source code and open source cross compiler tool<br>
linux-3.104: Kernel source code <br>
tools: Tools of project compilation <br>
build.sh: compilation script<br>
<div>[[File:Orange-pi-pc2-img51.png|800px|]]</div>
<br>
At this point the system will prompt the choice of the chip, as shown below, for OrangePi, select sun50iw2p1sun8iw7p1<br>
At this point, the system will be prompted the choice of the board, for the OrangePi, select dragonboard,dolphin and dolphin-p2<br>
<div style="padding-left:200px;">[[File:Orange-pi-zero-plus-img6.png|400px|]]</div>
<br>
Appear this interface indicates waiting for the compiler.
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img53.png|400px|]]</div>
<br>
Wait fifteen minutes or so, compile complete.
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img54.png|400px|]]</div>
<br>
<br>
* After compilation is finished, the following files will be generated in the directory:
libs: lichee/out/sun50iw2p1sun8iw7p1/android/common/lib/modules/3.104.65 39<br>
Download image from official website:<br>
http://www.orangepi.org/downloadresourceshtml/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero.html<br>
<br>
* Write the image:<br>
uboot uboot source code<br>
<br>
Execute./build.sh enter into graphical interface and select Zero plus2, the interface for Zero Plus is same as Zero plus2<div style="padding-left:200px;">[[File:Orange-pi-zero-plus-img8img5.png|600px500px|]]</div>
<br>
Enter password of root
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img62.png|600px|]]</div>
<br>
Update Kernel directory and module
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img63.png|600px|]]</div>
<br>
Select corresponding file directory and update uImage and modules
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img64.png|600px|]]</div>
<br>
<br>
Hardware: Orange Pi development board*1, Card reader*1, TF card*1, power supply*1
<div style="padding-left:200px;">[[File:Orange-pi-zero-plus-img4.png|800px|]]</div>
<br>
Software<br>
<div>[[File:Orange-pi-pc2-img68.png|800px|]]</div>
<br>
* Command line input Jav and press tab to see whether it can auto completion (Java), which indicates it can successfully installed version1.6.<br>
<br>
 
=== Install Platform Supported Software ===
<br>
=== '''Download Android Source Package''' ===
<br>
Download website: http://www.orangepi.org/downloadresourceshtml/ hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero.html<br>
Then you will obtain the following directories:<br>
<div style="padding-left:200px;">[[File:Orange-pi-pc2-img69.png|300px|]]</div>
<br>
$ cd lichee<br>
$ ./build.sh lunch <br>
Select sun50iw2p1sun8iw7p1<br>
Print information of successful compilation
<div>[[File:Orange-pi-primezero-img16img6.png|400px|]]</div>
<br>
=== '''Compile Command of Android Source Code Compilation''' ===
<br>
Input the command:<br>
<br>
$ make The rear values of # is for the simultaneous compilation process, dependent on the host configuration
<div>[[File:Orange-pi-primezero-img20img7.png|600px|]]</div>
<br>
$ pack #Packaged into firmware
<br>
The sys_config.fex is a binary configuration file that used by the SOC kernel driver or LiveSuit for a particular target board, including how to set up a variety of peripherals, ports, and I/O which based on the target version.<br>
For OrangePi, the location of the project configuration document is: <br>lichee/tools/pack/chips/sun50iw2p1sun8iw7p1/configs/dolphin-p1/sys_config.fex<br>
Copy the file to the directory of /lichee, use command:<br>
$ cd ./lichee<br>
$ cp ./tools/pack/chips/sun50iw2p1sun8iw7p1/configs/dolphin-p1/sys_config.fex ./ <br>You could personalized configuration of sys_config.fex according tosysconfig1.fex_manul_linux_BSP_v0.4.pdf.<br>Direcotory of sysconfig1.fex_manul_linux_BSP_v0.4.pdf is /lichee/buildroot/docs.<br>
<br>
 
=== '''Examples''' ===
<br>
<br>
Hardware: Orange Pi development board*1, Card reader*1, TF card*1, power supply*1
<div style="padding-left:200px;">[[File:Orange-pi-zero-plus-img4.png|600px]]</div>
<br>
=== '''Device driver and application programming''' ===
=== '''Compile device driver''' ===
<br>
Copy the OrangePi_misc.c to the */lichee/linux-3.104/driver/misc directory:<br>
<div>[[File:Orange-pi-pc2-img83.png|800px]]</div>
<br>
Enter to */lichee/linux-3.104/drivers/misc/, and modify makefile<br>
<div>[[File:Orange-pi-pc2-img84.png|800px]]</div>
<br>
<br>
$ ./build.sh<br>
After compiled the kernel, there will be an orangepi_misc.ko file generated on the directory of lichee/linux-3.104/output/lib/modules/3.104.6539<br>
<div>[[File:Orange-pi-prime-img16.png|400px]]</div>
<br>
There is a .ko module which generated after compiled of OrangePi_misc.c on */lichee/linux-3.104/output/lib/modules/3.104.6539/<br>
<div>[[File:Orange-pi-pc2-img88.png|800px]]</div>
<br>
<div>[[File:Orange-pi-i96-img55.png|800px]]</div>
<br>
Copy the OrangePi_misc.ko file to /media/*/lib/modules/3.104.6539.<br>$ cp OrangePi_misc.ko /media/*/lib/modules/3.104.6539<br>
<br>
=== '''Corss-complile or compiled Cross compiler Application codeProgram''' ===
<br>
Here will take arm-linux-gnueabihf-gcc as an example. Check whether there is the cross compiler, if not, then download and install it.<br>
<br>
== '''Using Debug tools on OrangePi Orange Pi ''' ==
<br>
Hardware: Orange Pi development board*1, Card reader*1, TF card*1, power supply*1
<div style="padding-left:200px;">[[File:Orange-pi-zero-plus-img4.png|800px]]</div>
<br>
'''TTL to USB cable'''
<div style="padding-left:200px;">[[File:Orange-pi-i96-img67.png|800px]]</div>
<br>
=== '''Operations on Windows''' ===
* Open it after installed, shown as below:
<br>
<div style="padding-left:200px;">[[File:Orange-pi-i96-img73.png|600px]]</div>
<br>
'''3)Connect method'''<br>
<br>
* Select control panel on Start menu
<div style="padding-left:200px;">[[File:Orange-pi-i96-img75.png|400px]]</div>
<br>
<div style="padding-left:200px;">[[File:Orange-pi-i96-img76.png|600px]]</div>
<br>
* Click on the device manager to check the port number
<div style="padding-left:200px;">[[File:Orange-pi-i96-img77.png|400px]]</div><div style="padding-left:200px;">[[File:Orange-pi-i96-img78.png|400px]]</div>
<br>
'''5)Putty configuration'''
<div style="padding-left:200px;">[[File:Orange-pi-i96-img79.png|400px]]</div>
<br>
Serial port should set to the corresponding port number (COM5), the speed should set to 115200<br>
'''6)Start debug'''<br>
Power Orange Pi on and boot it, the serial port will automatic print out debug log.
<div style="padding-left:100px; ">[[File:Orange-pi-i96-img80.png|600px]]</div>
<br>
set window 5
</div>
<div style="padding-left:200px;">[[File:Orange-pi-i96-img83.png|600px]]</div>
<br>
'''2)Connect method for debug'''
<br>
$ ls /dev/ (Input command in the PC terminal to check the device number of TTL to the serial cable)
<div style="padding-left:100px; ">[[File:Orange-pi-i96-img85.png|800px]]</div>
<br>
* It can be seen from the figure that TTL to the serial port cable is identified as ttyUSB0, configure the /ect/kermit/kermitc file, update the serial port information.<br>
 $ sudo vi /etc/kermit/kermitc
* Set the value of setline into /dev/ttyUSB0
<div style="padding-left:100px; ">[[File:Orange-pi-i96-img86.png|800px]]</div>
<br>
'''4)Start debug'''
* Input command in the host computer terminal, enter the Kermit mode:
 $ sudo kermit –c
<div style="padding-left:100px; ">[[File:Orange-pi-i96-img87.png|800px]]</div>
<br>
* Power on and boot OrangePi, the serial port will print debug log automatically
<br>
 == '''Download Orange Pi Zero User Manual''' ==<br>For more information on using the orange pi zeroOrange Pi Zero, please see the [https://drive.google.com/open?id=1lrtE6lbpXqxXTMmq7IxROOaZbOQ0U8uP <span style="color:red;">orange pi zero Orange Pi Zero User Manual</span>]. (Click to download)

Navigation menu