8,367
edits
Changes
no edit summary
<br>
<div>[[File:Orange-pi-zero-plus2-img4.png|600px|]]</div>
<br>
=== '''GPIO Specifications''' ===
<br>
A 40-pin GPIO interface on the Orange Pi PC2 is the same as Model A and Model B of Raspberry Pi. The picture below is GPIO pin define of Orange Pi PC2.
<div>[[File:Orange-pi-pc2-img5.png|800px]]</div>
<br>
<table style=" min-width: 800px;text-align: center;" border="1" bordercolor="#d8d8d8" cellspacing="0"
cellpadding="0">
<tr>
<td>OrangePi(H5)</td>
<td></td>
<td></td>
</tr>
<tr>
<td style="background-color: #5a5a5a;">CON3-P01</td>
<td style="background-color: #5a5a5a;">VCC-3V3</td>
<td></td>
</tr>
<tr>
<td style="background-color: #5a5a5a;">CON3-P02</td>
<td style="background-color: #5a5a5a;">VCC-5V</td>
<td></td>
</tr>
<tr>
<td style="background-color: #b1a0c6;">CON3-P03</td>
<td style="background-color: #b1a0c6;">TWI0-SDA</td>
<td style="background-color: #b1a0c6;">PA12</td>
</tr>
<tr>
<td style="background-color: #5a5a5a;">CON3-P04</td>
<td style="background-color: #5a5a5a;">VCC-5V</td>
<td></td>
</tr>
<tr>
<td style="background-color: #b1a0c6;">CON3-P05</td>
<td style="background-color: #b1a0c6;">TWI0-SCK</td>
<td style="background-color: #b1a0c6;">PA11</td>
</tr>
<tr>
<td style="background-color: #5a5a5a;">CON3-P06</td>
<td style="background-color: #5a5a5a;">GND</td>
<td></td>
</tr>
<tr>
<td style="background-color: #938a53;">CON3-P07</td>
<td style="background-color: #938a53;">PWM1</td>
<td style="background-color: #938a53;">PA6</td>
</tr>
<tr>
<td style="background-color: #d99694;">CON3-P08</td>
<td style="background-color: #d99694;">UART3_TX</td>
<td style="background-color: #d99694;">PA13</td>
</tr>
<tr>
<td style="background-color: #5a5a5a;">CON3-P09</td>
<td style="background-color: #5a5a5a;">GND</td>
<td></td>
</tr>
<tr>
<td style="background-color: #d99694;">CON3-P10</td>
<td style="background-color: #d99694;">UART3_RX</td>
<td style="background-color: #d99694;">PA14</td>
</tr>
<tr>
<td style="background-color: #c2d59a;">CON3-P11</td>
<td style="background-color: #c2d59a;">UART2_RX</td>
<td style="background-color: #c2d59a;">PA1</td>
</tr>
<tr>
<td style="background-color: #938a53;">CON3-P12</td>
<td style="background-color: #938a53;">PD14</td>
<td style="background-color: #938a53;">PD14</td>
</tr>
<tr>
<td style="background-color: #c2d59a;">CON3-P13</td>
<td style="background-color: #c2d59a;">UART2_TX</td>
<td style="background-color: #c2d59a;">PA2</td>
</tr>
<tr>
<td style="background-color: #5a5a5a;">CON3-P14</td>
<td style="background-color: #5a5a5a;">GND</td>
<td></td>
</tr>
<tr>
<td style="background-color: #c2d59a;">CON3-P15</td>
<td style="background-color: #c2d59a;">UART2_CTS</td>
<td style="background-color: #c2d59a;">PA3</td>
</tr>
<tr>
<td style="background-color: #f9c090;">CON3-P16</td>
<td style="background-color: #f9c090;">PC4</td>
<td style="background-color: #f9c090;">PC4</td>
</tr>
<tr>
<td style="background-color: #5a5a5a;">CON3-P17</td>
<td style="background-color: #5a5a5a;">VCC-3V3</td>
<td></td>
</tr>
<tr>
<td style="background-color: #f9c090;">CON3-P18</td>
<td style="background-color: #f9c090;">CAN_RX</td>
<td style="background-color: #f9c090;">PC7</td>
</tr>
<tr>
<td style="background-color: #92cddd;">CON3-P19</td>
<td style="background-color: #92cddd;">SPI0_MOSI</td>
<td style="background-color: #92cddd;">PC0</td>
</tr>
<tr>
<td style="background-color: #5a5a5a;">CON3-P20</td>
<td style="background-color: #5a5a5a;">GND</td>
<td></td>
</tr>
<tr>
<td style="background-color: #92cddd;">CON3-P21</td>
<td style="background-color: #92cddd;">SPI0_MISO</td>
<td style="background-color: #92cddd;">PC1</td>
</tr>
<tr>
<td style="background-color: #c2d59a;">CON3-P22</td>
<td style="background-color: #c2d59a;">UART2_RTS</td>
<td style="background-color: #c2d59a;">PA2</td>
</tr>
<tr>
<td style="background-color: #92cddd;">CON3-P23</td>
<td style="background-color: #92cddd;">SPI0_CLK</td>
<td style="background-color: #92cddd;">PC2</td>
</tr>
<tr>
<td style="background-color: #92cddd;">CON3-P24</td>
<td style="background-color: #92cddd;">SPI0_CS0</td>
<td style="background-color: #92cddd;">PC3</td>
</tr>
<tr>
<td style="background-color: #5a5a5a;">CON3-P25</td>
<td style="background-color: #5a5a5a;">GND</td>
<td></td>
</tr>
<tr>
<td style="background-color: #92cddd;">CON3-P26</td>
<td style="background-color: #92cddd;">PA21</td>
<td style="background-color: #92cddd;">PA21</td>
</tr>
<tr>
<td style="background-color: #528ed4;">CON3-P27</td>
<td style="background-color: #528ed4;">TWI1-SDA</td>
<td style="background-color: #528ed4;">PA19</td>
</tr>
<tr>
<td style="background-color: #938a53;">CON3-P28</td>
<td style="background-color: #938a53;">TWI1-SCK</td>
<td style="background-color: #938a53;">PA18</td>
</tr>
<tr>
<td style="background-color: #528ed4;">CON3-P29</td>
<td style="background-color: #528ed4;">PA7</td>
<td style="background-color: #528ed4;">PA7</td>
</tr>
<tr>
<td style="background-color: #5a5a5a;">CON3-P30</td>
<td style="background-color: #5a5a5a;">GND</td>
<td></td>
</tr>
<tr>
<td style="background-color: #528ed4;">CON3-P31</td>
<td style="background-color: #528ed4;">PA8</td>
<td style="background-color: #528ed4;">PA8</td>
</tr>
<tr>
<td style="background-color: #d99694;">CON3-P32</td>
<td style="background-color: #d99694;">UART1_RTS</td>
<td style="background-color: #d99694;">PG8</td>
</tr>
<tr>
<td style="background-color: #528ed4;">CON3-P33</td>
<td style="background-color: #528ed4;">PA9</td>
<td style="background-color: #528ed4;">PA9</td>
</tr>
<tr>
<td style="background-color: #5a5a5a;">CON3-P34</td>
<td style="background-color: #5a5a5a;">GND</td>
<td></td>
</tr>
<tr>
<td style="background-color: #528ed4;">CON3-P35</td>
<td style="background-color: #528ed4;">PA10</td>
<td style="background-color: #528ed4;">PA10</td>
</tr>
<tr>
<td style="background-color: #d99694;">CON3-P36</td>
<td style="background-color: #d99694;">UART1_CTS</td>
<td style="background-color: #d99694;">PG9</td>
</tr>
<tr>
<td style="background-color: #938a53;">CON3-P37</td>
<td style="background-color: #938a53;">PA20</td>
<td style="background-color: #938a53;">PA20</td>
</tr>
<tr>
<td style="background-color: #938a53;">CON3-P38</td>
<td style="background-color: #938a53;">UART1_TX</td>
<td style="background-color: #938a53;">PG6</td>
</tr>
<tr>
<td style="background-color: #5a5a5a;">CON3-P39</td>
<td style="background-color: #5a5a5a;">GND</td>
<td></td>
</tr>
<tr>
<td style="background-color: #938a53;">CON3-P40</td>
<td style="background-color: #938a53;">UART1_RX</td>
<td style="background-color: #938a53;">PG7</td>
</tr>
</table>
<br>
=== '''Specification of CSI Camera Connector''' ===
<br>
The CSI Camera Connector is a 24-pin FPC connector which can connect external camera module with proper signal pin mappings. The pin of CIS connector can be defined as follows. The connector marked with "CON 1" on the Orange Pi PC2 is camera connector.
<div>[[File:Orange-pi-pc2-img6.png|800px]]</div>
<br>
'''Orange Pi PC2-CSI'''
<br>
<table style=" min-width: 800px;text-align: center;" border="1" bordercolor="#d8d8d8" cellspacing="0"
cellpadding="0">
<tr>
<td style="background-color: #808080;">CON1-P01</td>
<td style="background-color: #808080;">NC</td>
<td></td>
</tr>
<tr>
<td style="background-color: #808080;">CON1-P02</td>
<td style="background-color: #808080;">GND</td>
<td></td>
</tr>
<tr>
<td style="background-color: #33cccc;">CON1-P03</td>
<td style="background-color: #33cccc;">TWI2-SDA</td>
<td style="background-color: #33cccc;">PE13</td>
</tr>
<tr>
<td style="background-color: #808080;">CON1-P04 </td>
<td style="background-color: #808080;">VCC-CSI</td>
<td></td>
</tr>
<tr>
<td style="background-color: #33cccc;">CON1-P05 </td>
<td style="background-color: #33cccc;">TWI2-SCK</td>
<td style="background-color: #33cccc;">PE12</td>
</tr>
<tr>
<td style="background-color: #33cccc;">CON1-P06 </td>
<td style="background-color: #33cccc;">CSI-RESET#</td>
<td style="background-color: #33cccc;">PE15</td>
</tr>
<tr>
<td style="background-color: #ff9900;">CON1-P07 </td>
<td style="background-color: #ff9900;">CSI-VSYNC</td>
<td style="background-color: #ff9900;">PE3</td>
</tr>
<tr>
<td style="background-color: #33cccc;">CON1-P08 </td>
<td style="background-color: #33cccc;">CSI-STBY-EN</td>
<td style="background-color: #33cccc;">PE15</td>
</tr>
<tr>
<td style="background-color: #ff9900;">CON1-P09 </td>
<td style="background-color: #ff9900;">CSI-HSYNC</td>
<td style="background-color: #ff9900;">PE2</td>
</tr>
<tr>
<td style="background-color: #808080;">CON1-P10 </td>
<td style="background-color: #808080;">VDD1V8-CSI</td>
<td></td>
</tr>
<tr>
<td style="background-color: #808080;">CON1-P11 </td>
<td style="background-color: #808080;">VCC-CSI</td>
<td></td>
</tr>
<tr>
<td style="background-color: #ff9900;">CON1-P12 </td>
<td style="background-color: #ff9900;">CSI-D7</td>
<td style="background-color: #ff9900;">PE11</td>
</tr>
<tr>
<td style="background-color: #ff9900;">CON1-P13 </td>
<td style="background-color: #ff9900;">CSI-MCLK</td>
<td style="background-color: #ff9900;">PE1</td>
</tr>
<tr>
<td style="background-color: #ff9900;">CON1-P14 </td>
<td style="background-color: #ff9900;">CSI-D6</td>
<td style="background-color: #ff9900;">PE10</td>
</tr>
<tr>
<td style="background-color: #808080;">CON1-P15 </td>
<td style="background-color: #808080;">GND</td>
<td></td>
</tr>
<tr>
<td style="background-color: #ff9900;">CON1-P16 </td>
<td style="background-color: #ff9900;">CSI-D5</td>
<td style="background-color: #ff9900;">PE9</td>
</tr>
<tr>
<td style="background-color: #ff9900;">CON1-P17 </td>
<td style="background-color: #ff9900;">CSI-PCLK</td>
<td style="background-color: #ff9900;">PE0</td>
</tr>
<tr>
<td style="background-color: #ff9900;">CON1-P18 </td>
<td style="background-color: #ff9900;">CSI-D4</td>
<td style="background-color: #ff9900;">PE8</td>
</tr>
<tr>
<td style="background-color: #ff9900;">CON1-P19 </td>
<td style="background-color: #ff9900;">CSI-D0</td>
<td style="background-color: #ff9900;">PE4</td>
</tr>
<tr>
<td style="background-color: #ff9900;">CON1-P20 </td>
<td style="background-color: #ff9900;">CSI-D3</td>
<td style="background-color: #ff9900;">PE7</td>
</tr>
<tr>
<td style="background-color: #ff9900;">CON1-P21 </td>
<td style="background-color: #ff9900;">CSI-D1</td>
<td style="background-color: #ff9900;">PE5</td>
</tr>
<tr>
<td style="background-color: #ff9900;">CON1-P22 </td>
<td style="background-color: #ff9900;">CSI-D2</td>
<td style="background-color: #ff9900;">PE6</td>
</tr>
<tr>
<td style="background-color: #808080;">CON1-P23</td>
<td style="background-color: #808080;">GND</td>
<td></td>
</tr>
<tr>
<td style="background-color: #808080;">CON1-P24</td>
<td style="background-color: #808080;">AFVCC-CSI</td>
<td></td>
</tr>
</table>
<br>
== '''Using Method Introduction''' ==
<br>
Follow these steps, you can configure and run your Orange Pi in a very short period of time. Boot your Orange Pi need to complete the following steps.<br>
<br>
=== '''Step 1: Prepare Accessories Needed''' ===
<br>
You need at least some accessories like the following if it is your first time to use the Orange Pi.<br>
<br>
{| class="wikitable" style="width:800px;background:#fff;"
|-
! No. !! Items !! Requirements and Instructions
|-
| 1|| TF card|| 8GB min.; class 10. Branded TF cards would be reference which are much more reliable.
|-
| 2|| HDMI to HDMI cable or HDMI to DVI cable|| HDMI to HDMI cable is used to connect HD TV or HD monitor
|-
| 3|| AV video cable|| A standard AV video cable can be used to connect stimulated monitor if a HDMI monitor is unavailable.
|-
| 4|| Keyboard and mouse|| Any keyboard and mouse with USB port is applicable; Keyboard and mouse are
high-power, so a USB concentrator is required.
|-
| 5|| Ethernet cable/USB WiFi(Optional)|| Network is optional, It makes more convenient to mount and upgrade software in your Orange
Pi PC.
|-
| 6|| DC power adapter|| 5V/2V min. high qualified power adapter, OTG can not used a power supply.
|-
| 7|| Audio cable (Optional)|| You can select an audio cable with 3.5mm jack to feel stereo audio.
|}
<br>
<div style="display:flex;padding-left:100px;">
<div style="text-align:center;">
[[File:Orange-pi-pc2-img7.png|200px200px|]]<br>
HDMI to HDMI cable
</div>
<div style="text-align:center;margin-left:100px;padding-top:3px;">
[[File:Orange-pi-pc2-img8.png|200px200px|]]<br>
HDMI to DVI cable
</div>
<div style="text-align:center;margin-left:100px;padding-top:1px;">
[[File:Orange-pi-pc2-img9.png|200px200px|]]<br>
AV video cable
</div>
</div>
<br>
<div style="display:flex;padding-left:200px;">
<div style="text-align:center;">
[[File:Orange-pi-pc2-img10.png|200px200px|]]<br>
TF card
</div>
<div style="text-align:center;margin-left:100px;padding-top:15px;">
[[File:Orange-pi-pc2-img11.png|200px200px|]]<br>
DC power adapter
</div>
</div>
<br>
== = '''Step 2: Prepare a TF Card for Booting''Introduction ' ===<br>In order to use Orange Pi normally, you must install the development boardoperating system into TF card first.<br><br>'''1)Write Linux into TF Card Based on Windows Platform''' <br><br>a.Inserting the TF card into the computer, the capacity of the card must be bigger than the operating system, usually requires 8GB or bigger.<br>b.Formatting the TF card.<br><div style="padding-left:20px;">i Download tools for formatting TF card, such as TF Formatter, it could be downloaded from:<br>https://www.sdcard.org/downloads/formatter_4/eula_windows/<br><br>ii Unzip the downloaded files, and run setup.exe<br><br>iii In the options settings select the "format" button for quick formatting. "Format size adjustment" select "(ON)"<br><br><div style="padding-left:180px;">[[File:Orange-pi-pc2-img12.png|400px|]]</div><br><div style="padding-left:180px;">[[File:Orange-pi-pc2-img13.png|400px|]]</div><br>iv Make sure the inserted TF card disk are in accordance with the chosen disk.<br><br>v Click the "Format" button.</div>c.Download the operating system image file from the download page, the page address is as following:<br>http://www.orangepi.org/downloadresources<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<div style="padding-left:20px;">i Download tools to write image,such as Win32 Diskimager, here is the download page: <br>http://sourceforge.net/projects/win32diskimager/files/Archive/<br><br>ii Select the image file path that has been unzipped.<br><br><div style="padding-left:180px;">[[File:Orange-pi-pc2-img14.png|400px|]]</div><br>iii Click "Write" button and wait for the image to write. <br><br>iv After the image is written, click "Exit" button.</div><br>'''2)Write Linux into TF card based on Linux platform?'''<br>a.Inserting the TF card into the computer, the capacity of the card must be larger than the operating system image, usually requires 4GB or greater capacity.<br><br>b.Formatting the TF card.<br><br>i Run fdisk –l order to make sure TF disk.<br>ii Run umount /dev/sdxx to uninstall all partitions of TF Card. <br>iii Run sudo fdisk /dev/sdx order. Use o command to delete allpartitions of TF Card, and then us n order to add a new partition, finally usew command to save and exit.<br>iv Run sudo mkfs.vfat /dev/sdx1 command to format the TF card partition set up last step to FAT32 form(according to your TF card disk to replacex). Or you could skip this step since command in Linux will format TF card automatic.<br><br>c.Download the OS image from download page <br>http://www.orangepi.org/`downloadresources<br><br>d.Unzip and right click the downloaded file, select " Unzip file"<br><br>e.Write image to TF card<br><br>i Run sudo fdisk –l order to make sure the TF card disk<br>ii make sure the image file hash key is the same as download page mention(optional). It will output sha1sum [path]/[imagename], which should be same as the image paye "SHA-1"<br>iii Run umount /dev/sdxx order to uninstall all partitions in TF Card<br>iv Run sudo dd bs=4M if=[path]/[imagename] of=/dev/sdx to write down image file. Wait for the image to write. If it cannot work at 4M, then replace a 1M which takes more time. You can run sudo pkill –USR1 –n –x dd order to monitoring procedure.<br><br>'''3)Use PhoenixCard tool to write Android image into TF card'''<br>It is impossible for Android image to be written into TF card by usingdd command under Linux or using Win32 Diskimager under Windows. HerePhoenixCard tool is applicable for Android image writing.<br><br>a.Download the Android OS image and PhoenixCard tool. Download PhoenixCard from here:<br>https://drive.google.com/file/d/0B_VynIqhAcB7NTg2UkRDdHRWX2s/edit?usp=sharing<br>Download Android OS image from here: <br>http://www.orangepi.org/downloadresources/<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 "restore" 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><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>
<br>
<br>
<br>
<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-i96pc2-img5img20.png|250px600px|]]</div><br>iii. Click "start" button and wait for the image to write.<br><br><div style="padding-left:200px;">[[File:Orange-pi-pc2-img21.png|600px|]]</div><br>iv. After the image is written, click "close" button<br><br> === '''Step 3: Boot your Orange Pi''' ===<br>'''1)Hardware Connection Sketch Map'''<br><br><div style="padding-left:200px;">[[File: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>
<br>
<br>
<div style="padding-left: 200px;">[[File:Orange-pi-pcpc2-plus-img4img25.png|250px400px|]]
</div>
<br>
<br>
<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:50px200px;">[[File:Orange-pi-onepc2-img6img26.png|250px]][[File:Orange-pi-one-img7.png600px|250px]]
</div>
<br>
<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;">[[File:Orange-pi-pc-pluspc2-img5img28.png|250px400px|]]
</div>
<br>
<br>
<div style="padding-left:200px;">
[[File: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 system for output on 3.5mm of/etc/asound.conf, modify card1 into card0, or use amixer to modify. The default oneis 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;">[[File:Orange-pi-img8pc2-img30.png|250px400px|]]</div>c.$ groupmod -n zhangsan orangepi Change group<brdiv style="padding-left:100px;">[[File:Orange-pi-pc2-img31.png|400px|]]</div>d.$ mv /home/ornagepi /home/zhangsan Change directory of original orangepi<div style="padding-left:80px;">[[File:Orange-pi-litepc2-img10img32.png|250px600px|]]
</div>
e.$ usermod -d /home/orangepi orangepi Set this directory to orangepi user's home directory
<div style="padding-left:80px;">
[[File:Orange-pi-pc2-img33.png|600px|]]
</div>
f.$ cat /etc/passwd It should be shown as below:
<div>
[[File: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-mount-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>
[[File: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>[[File: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>[[File: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;">[[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>
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>[[File:Orange-pi-pc2-img39.png|800px|]]</div>
<br>
iv You will get an activation code after booting like the following:
<div>[[File: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>[[File: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;">[[File: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;">[[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>
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-linux-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>
|-
| 1Configuration Item|| Ubuntu14.04 PC|| Optional, used to compile Android source codeConfiguration Meaning
|-
| 2ctp_used=xx|| Ubuntu18Whether turn on capacitance touch panel, if so set the value as 1, and vice verso 0.04 PC|| Optional, used to compile Linux source code
|-
| 3ctp_name =xx|| Windows PCIndicates the control scheme used in the specified scheme, for now there are: "ft5x_ts" or "Goodix-TS".|-| ctp_twi_id=xx|| Used for selecting i2c adapter, there are 0 and 2.|-| ctp_twi_addr =xx|| Indicates the device address of i2c, it is related to the specific hardware.|-| ctp_screen_max_x=xx|| Maximum coordinates of the X axis of the touch panel|-| ctp_screen_max_y=xx|| Maximum coordinates of the Y axis o the touch panel|-| ctp_revert_x_flag=xx|| Whether needed to flip the X coordinates, if so then set 1, and vice verso 0.|-| ctp_revert_y_flag=xx|| Whether needed to burn Android flip the Y coordinates, if so then set 1, and Linux imagesvice verso 0.|-| ctp_int_port=xx|| GPIO configuration of the interrupt signal of capacitive touch panel|-| ctp_wakeup=xx|| GPIO configuration of the wake-up signal of capacitive touch panel|-| ctp_io_port=xx|| Capacitive screen IO signal, currently share with interrupt signal common pin
|}
Configuration samples:<br>
<br>
ctp_used = 1<br>
ctp_name = "ft5x_ts"<br>
ctp_twi_id = 2<br>
ctp_twi_addr = 0x70 <br>
ctp_screen_max_x = 800<br>
ctp_screen_max_y = 480<br>
ctp_revert_x_flag = 0<br>
ctp_revert_y_flag = 0<br>
ctp_int_port = port:PH21<6><default><br>
ctp_wakeup = port:PB13<1><default><default><1><br>
ctp_io_port = port:PH21<0><default><br>
<br>
Note: If you want to support the new capacitive touch IC, you need to combine the configuration of the BSP A10 layer, which should be based on the original capacitive touch IC code, to make the appropriate changes. Specifically, 1) ctp_twi_id should be consistent with the hardware connection in sys_config; 2) In the drive part of the code: the use of twi from the device name + address should be consistent with the ctp_name and ctp_twi_addr in sys_config configuration. At the same time, the other sub configuration in sysconfig should also be properly configured, these configurations should be corresponding processing in the program.<br>
<br>
==='''Download the image Orange Pi Driver development''' ==<br> In order to help developers become more familiar with OrangePi, this manual describes how to use simple device driver modules and related information of applications on the development board. <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-pc2-img65.png|600px]]</div><br>=== '''Device driver and application programming'''===<br>'''1)Application Program (app.c)'''<br><br><div>[[File:Orange-pi-i96-img50.png|600px]]</div><br>'''2)Driver Program (OrangePi_misc.c)'''<br><br><div>[[File:Orange-pi-i96-img51.png|600px]]</div><br><div>[[File:Orange-pi-i96-img52.png|600px]]</div>
<br>
<br>
$ ll /etc/environment shows that the file can only read, need to modify permissions <br>$ chmod 755 /etc/environment<div>[[File:Orange-pi-pc-plusi96-img6img61.png|800px|]]</div>
<br>
<br>
<br>
<br>
<br>
<br>
=== '''Method of flashing Linux image to TF card based Using Debug tools on Ubuntu PCOrangePi ''' ===
<br>
Hardware: Orange Pi development board*1, Card reader*1)First, prepare a TF card with 8GB or larger capacity*1, power supply*1<div style="padding-left:200px;">[[File:Orange-pi-pc2-img65. The transmission speed of the TF card must be above class10. It is recommended to use a TF card of SanDisk and other brandspng|800px]]<br/div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
==== '''How to use the debugging serial port Operations on Ubuntu platformLinux''' ====1)If the USB to TTL module is connected normally, you can see the corresponding device node name under /dev of the Ubuntu PC, remember this node name, it will be used when setting the serial port software later<div style="background:#f1f1f1;border:1px solid #000">test@test:~$ '''ls /dev/ttyUSB*'''<br>/dev/ttyUSB0</div>
<br>
<br>
<br>
<br>
<br>
<div style="padding-left:20px;">
</div>
<div style="padding-left:200px;">[[File:Orange-pi-3ltsi96-putty2img83.png|600px]]</div>8<br>'''2)After setting Connect method for debug'''<br> Use the TTL to the serial port setting interfacecable, return one end connected to OrangePi, the other end connected to PC<br>'''3)Equipment information acquisition'''<br><br>$ ls /dev/ (Input command in the PC terminal to check the Session interfacedevice number of TTL to the serial cable)<div style="padding-left:20px100px;">[[File:Orange-pi-i96-img85.png|800px]]</div>a. First select the Connection type as Serial<br>b. Then click * It can be seen from the Open button to connect figure that TTL to the serial portcable is identified as ttyUSB0, configure the /ect/kermit/kermitc file, update the serial port information.<br> $ sudo vi /div>etc/kermit/kermitc* Set the value of setline into /dev/ttyUSB0<div style="padding-left:200px100px;">[[File:Orange-pi-3ltsi96-putty3img86.png|600px800px]]</div>
<br>
<br>
<br>
<br>