Changes

Jump to: navigation, search

Orange Pi 2G-IoT

18,971 bytes added, 10:12, 28 June 2022
no edit summary
</tr>
</table>
<br>
== '''Using Method''' ==
<br>
 You can configure your Orange Pi in a very short period of time and use it according to the following steps. You need to fulfill the several steps before booting your Orange Pi.<br>
<br>
=== '''Step 1: Prepare Accessories Needed''' ===
<br>
The first time you use the Orange Pi, you need at least some parts for the following: <br>
<br>
{| class="wikitable"
|-
! No. !! Items !! Requirements and Instructions
|-
| 1|| TF card|| 8GB or bigger ; class 10. Branded TF cards which are much more reliable are the good choice
|-
| 2|| Power adapter || At lease 5V/2A high quality power adapter, OTG could use as power supply.
|-
| 3|| Keyboard and mouse|| Any keyboard and mouse with USB port is applicable; Keyboard and mouse are high-power, so a USB concentrator is required.
|-
| 4|| TTL to USB cable|| Support debug log in.
|-
| 5|| Audio cable (Optional)|| You can select an audio cable with 3.5mm jack to feel stereo audio.
|}
<br>
<div style="width:800px;display:flex;padding-left:200px;align-items:center;">
<div style="text-align:center;">
[[File:Orange-pi-i96-img4.png|200px]]
<p style="text-align:center;">TF card</p>
</div>
<div style="text-align:center;">
[[File:Orange-pi-i96-img5.png|200px]]
<p style="text-align:center;margin-top:25px;margin-bottom:-8px;">OTG power adapter</p>
</div>
</div>
<br>
=== '''Step 2: Prepare a TF Card''' ===
<br>
 In order to be able to us Orange Pi normally, you must first install the operating system into the TF card or Nand. The following instructions will teach you how to write the operating system image file to the Windows and Linux Platform. For now this board could support boot from TF card with Android and Linux distro, and could support boot from Nand with Android. It will illustrate about how to write image into Nand.<br>
<br>
'''1)Writing image into a SD card on Windows:'''
<br>
a.Inserting the TF card into the computer, the capacity of the card must be larger than the operating system image, usually requires 8GB or bigger capacity.<br>
b.Formatting the TF card.
<div style="padding-left:60px;">
i.Download tools for formatting TF card, such as TF Formatter, could be download from <br>
<span style="color:#42a0e5">https://www.sdcard.org/downloads/formatter_4/eula_windows/</span> <br>
ii.Unzip the downloaded files, and run setup.exe<br>
iii.In the options settings option set the format type option to quick formatting. Logical size adjustment option to open "(ON)”
<div>[[File:Orange-pi-i96-img6.png|600px]]</div>
<br>
<div>[[File:Orange-pi-i96-img7.png|600px]]</div>
<br>
iv.Make sure the inserted TF card codes are in accordance with the chosen codes.<br>
v.Click the "Format"button.
</div>
Download the operating system image file from the download page, the page address is as follows: http://www.orangepi.cn/downloadresourcescn/ <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 the downloaded file, select "Unzip file" to write image to TF card.
<div style="padding-left:60px;">
i Download tools to write image, such as Win32 Diskimager, <br>
<span style="color:#42a0e5">http://sourceforge.net/projects/win32diskimager/files/Archive/.</span> <br>
ii Select the path of image file that has been unzipped.
<div>[[File:Orange-pi-i96-img8.png|600px]]</div>
<br>
iii Click the "Write" button and wait for the image writing.<br>
iv After the image is written, click the "Exit" button.
</div>
<br>
'''2)Writing image into a SD card on Linux:'''<br>
<br>
a.Inserting the TF card into the computer, the capacity of the card must be larger than the operating system image, usually requires 8GB or bigger capacity.<br>
b.Formatting the TF card.
<div style="padding-left:60px;">
i Run fdisk –l command 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 command. Use director to delete all partitions of TF Card, and then us n command to add a new partition, finally use w 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.
</div>
c.Download the image OS from download page: <br>
http://www.orangepi.cn/`downloadresourcescn/
d.Unzip the downloaded file and right click it, select " Unzip file"<br>
e.Write image into TF card
<div style="padding-left:60px;">
i Run sudo fdisk –l command to make sure the TF card disk<br>
ii Make sure the image file hash key is the same as download page offered(optional) : <br>
sha1sum [path]/[imagename] <br>
Here will be output some number which should be same as the image page line of "SHA-1"<br>
iii Run umount /dev/sdxx command to uninstall all partitions in TF Card <br>
iv Run the command of sudo dd bs=4M if=[path]/[imagename] of=/dev/sdx to write image file and wait for it finished. You can run sudo pkill –USR1 –n –x dd command to check the procedure.
</div>
<br>
=== '''Step 3: Start your Orange Pi''' ===
<br>
* Insert the TF card with written image into the TF card slot
<div style="padding-left:100px;">[[File:Orange-pi-i96-img9.png|400px]]</div>
<br>
* Make sure the toggle switch is showing like the following, booting from SD card.
<div style="padding-left:100px;">[[File:Orange-pi-i96-img10.png|400px]]</div>
<br>
* Insert the keyboard or mouse into the USB port.
<div style="padding-left:100px;">[[File:Orange-pi-i96-img11.png|400px]]</div>
<br>
* Connect wifi antenna
* Connect to Camera(optional)
<div style="padding-left:100px;">[[File:Orange-pi-i96-img12.png|400px]]</div>
<div style="padding-left:100px;">[[File:Orange-pi-i96-img13.png|400px]]</div>
<br>
* Connect TTL cable, you could refer to the Debug method in this instruction.
Android and Linux use different Baud rate, please note the Baud rate setting. Android Baud rate is 921600, Linux Baud rate is 921600
Serial port uses TTL to USB cable to connect.
<div style="padding-left:100px;">[[File:Orange-pi-i96-img14.png|400px]]</div>
<br>
* It is the power input interface on the right side for connecting a 5V and at least 2A or bigger than 2A power adapter. Avoid using smaller power GSM mobile phone charger, it is not able to output 2A even if it marked "5V/2A".
<div style="padding-left:100px;">[[File:Orange-pi-i96-img15.png|400px]]</div>
<br>
 If the above steps are successful, the Orange Pi will start in a few minutes. The monitor Graphical interface of display system. 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 command in the shell:<br>
sudo halt<br>
or<br>
sudo shutdown –h<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. If all the above steps run, then your Orange Pi could shut down.<br>
<br>
=== '''Initialize settings for your Linux system''' ===
<br>
 You need to make some basic settings when it is you first time to use Linux on Orange Pi i96, like wifi setting, audio setting, user setting. <br>
<br>
'''1)Wifi setting on serial port'''<br>
<br>
 After used serial to login system, entered the password the system will prompt you to use the orangepi_config tool to make some basic setting, including wifi setting. You could use the following command in the order line:<br>
sudo orangepi_config<br>
> wifi settings<br>
<br>
 This setting include the functions of WIFI statue setting, wifi searching and connect to AP. You could use this method to set wifi.<br>
<br>
'''2)Use ssh to connect wifi'''<br>
<br>
 You need to use two cellphones if you want to use this function. Please refer to this: <br>
 Orange Pi i96 is defaulted to connect the hotspot of orangepi, the password is orangepi. Use another cellphone’s hotspot function, setting the hot spot name as orangepi, password as orangepi. It will connect to orangepi hotspot default after booting the system. After that, use another cellphone to connect the hotspot, and use “wifi assistant” to check the IP of Orange Pi i96.<br>
 After getting the IP of Orange Pi i96, you could use SSH remote login in Linux PC or Windows PC. Command as following: <br>
 ssh <span style="color:#42b3ee;">orangepi@192.168.xxx.xxx</span><br>
 Password: orangepi<br>
 After enter the system via ssh, run the following command to connect to router: sudo orangepi_config<br>
<br>
=== '''Write Android into Nand''' ===
<br>
 Orange Pi i96 is supported boot from Nand, and also supported update Android in Nand.<br>
<br>
'''1)Boot Android from NAND'''<br>
<br>
 Switching the boot mode into NAND via short jumper cap.
<div style="padding-left:200px;">[[File:Orange-pi-i96-img16.png|400px]]</div>
<br>
 Power it on, Orange Pi i96 will boot from NAND.<br>
<br>
'''2)Update Android in NAND'''<br>
<br>
* Short jumper cap to switch the system to boot from NAND, set toggle switch into 1234 UP, 5678 Down like the following:<br>
<br>
<div style="padding-left:200px;">[[File:Orange-pi-i96-img17.png|400px]]</div>
<br>
'''3)Install writing tool on Windows '''<br>
<br>
 For now Nand writing tool could only support working on Windows, you could download the tool from official website: http://www.orangepi.org/downloadresources/
<div>[[File:Orange-pi-i96-img18.png|800px]]</div>
<br>
'''4)Install USB driver on Windows'''
<br>
 Unzip the tool file, install the USB driver, here is the path: <br>
*/OrangePi_I96_Toolschain/USB_Driver/USB-driver/<br>
 You should install it according to your PC, if your PC is 32bit, then install x86 USB driver, if it is 64bit, then is x64 USB driver.<br>
<br>
'''5)Download Android Nand image'''
 Here is the ink for Orange Pi i96 Nand version image:<br>
 http://www.orangepi.org/downloadresources/
<div>[[File:Orange-pi-i96-img19.png|800px]]</div>
<br>
'''6)Use writing tool'''<br>
<br>
Use writing tool to write NAND:
*/OrangePi_2G-IOT_Toolschain/OrangePi_2G-IOT_NandUpdate_Tools/OrangePi_2G-IOT_Update.e
<div style="padding-left:200px;">[[File:Orange-pi-i96-img20.png|600px]]</div>
<br>
 Click “load BIN” to import the image of NAND version into writing tool. After that, click Download button to download the image. Meanwhile, the tool is waiting for the download link of Orange Pi i96.<br>
<br>
'''7)Download Image'''<br>
<br>
 Prepare an Android USB to DC cable, first connect to the OTG port of Orange Pi i96, then push on the power button for 5s, and connect the cable to the Windows PC. Meanwhile, the screen will indicate that connect successful and downloading. It will take around 3min to finished downloaded, after that, reboot the system and then the system will run on the update Android.<br>
 Note: If it could not download, please check the the shorting cap and switch.
<div style="padding-left:200px;">[[File:Orange-pi-i96-img21.png|600px]]</div>
<br>
=== '''Android in no screen ADB mode ''' ===
<br>
* ADB setting: Set the toggle switch into 1234 “UP”, 5678 “Down”, the system will switch into adb model, in this model, the USB is unable.
<div style="padding-left:200px;">[[File:Orange-pi-i96-img22.png|600px]]</div>
<br>
* Connect to the OTG port of Oragne Pi I96 with the USB to DC cable, the other side connect to PC, push the power button and then the system will be Android.
* If the PC haven’t set on adb, then please refer to the teaching method of Ubuntu and Windows adb in internet. Use adb command in the PC terminal to connect the adb:
adb shell
* After connect to OrangePi I96 via adb, you could refer to the adb debug method from the internet to enter into Orange Pi i96
We would recommend you use Plug-in Vysor in Chrome browser, this tool could enter Android via adb:
<div style="padding-left:200px;">[[File:Orange-pi-i96-img23.png|600px]]</div>
<br>
<div style="padding-left:200px;">[[File:Orange-pi-i96-img24.png|400px]]</div>
<br>
 
=== '''Universal software configuration ''' ===
<br>
'''1)Change default account'''<br>
<br>
 The default log-in account and password is orangepi/orangepi or root/orangepi. It is recommended to modify the default orangepi account to your own account for secure sake. Take changing into Zhangsan as a sample. Steps are as follows:<br>
a.Use root account to login Orange Pi<br>
b.$ usermod -l zhangsan orangepi <br>
Change account of orangepi into Zhangsan
<div style="padding-left:100px;">[[File:Orange-pi-i96-img25.png|600px]]</div>
<br>
c.$ groupmod -n zhangsan orangepi <br>   
Change group
<div style="padding-left:80px;">[[File:Orange-pi-i96-img26.png|600px]]</div>
<br>
d.$ mv /home/ornagepi  /home/zhangsan<br> 
Change directory of original orangepi
<div style="padding-left:60px;">[[File:Orange-pi-i96-img27.png|600px]]</div>
<br>
e.$ usermod -d /home/orangepi  orangepi <br>
Set this directory into orangepi user's home directory
<div style="padding-left:40px;">[[File:Orange-pi-i96-img28.png|600px]]</div>
<br>
f.$ cat /etc/passwd <br>
It should be shown as following:
<div>[[File:Orange-pi-i96-img29.png|800px]]</div>
<br>
 After the modification of the above steps, you could use the new account Zhangsan to log in.<br>
<br>
'''2)System source configuration '''<br>
<br>
 This instruction will take Ubuntu as an example:<br>
a.Open the source file<br>
$ sudo vi /etc/apt/sources.list
<div>[[File:Orange-pi-i96-img30.png|800px]]</div>
<br>
b.Edit source file<br>
 Replace the source file with your favourite 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>
'''3)Enter the system via SSH'''<br>
<br>
 You could refer to the previous charter 5. 2)Use SSH to connect Wifi. <br>
<br>
'''4)Modify the size of ext4 file system'''<br>
<br>
 It could promote system performance via expanding the rootfs partitions of file system after writing image, which could avoid the problems caused by insufficient space.<br>
 Expanding rootfs partitions on TF card of PC:<br>
 Using GParted to adjust the size:<br>
 Select the specified letter, right-click the corresponding letter, select "change the size" to adjust into the desired size, click "adjust the size", close the dialog box and click "apply to all operations", select the "apply" to complete the expansion operation.<br>
<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).<br>
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 boot-able partition you want to change, note that need to keep the boot-able 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 official Lubuntu and Raspbian could not use it.<br>
<br>

Navigation menu