Changes

Jump to: navigation, search

Orange Pi 4G- IoT

46,352 bytes added, 19:30, 30 June 2022
no edit summary
* Scratch
<br>
Pretty much anything else, because Orange Pi 4G-IOT IoT is open source.<br><br> === '''Who is it for?''' ===<br>Orange Pi 4G-IoT is for anyone who wants to start creating with technology– not just consuming it. It's a simple, fun, useful tool that you can use to start taking control of the world around you.<br><br> === '''Orange Pi 4G-IoT Hardware Specification''' ===<br><table border="1" bordercolor="#d8d8d8" cellspacing="0" cellpadding="0" style="width:800px;"> <tr> <td colspan="2" style="padding:10px 0;text-align:center;">Orange Pi 4G-IoT Specification</td> </tr> <tr> <td style="padding:10px 0">Processor</td> <td style="padding:10px 0">MT6737</td> </tr> <tr> <td style="padding:10px 0">CPU</td> <td style="padding:10px 0">Quad core ARM® Cortex-A53, Main frequency up to 1.25GHz</td> </tr> <tr> <td style="padding:10px 0">GPU</td> <td style="padding:10px 0">ARM Mali-T720 MP1</td> </tr> <tr> <td style="padding:10px 0">Memory</td> <td style="padding:10px 0">1GB DDR3</td> </tr> <tr> <td style="padding:10px 0">Emmc</td> <td style="padding:10px 0">8GB EMMC Flash</td> </tr> <tr> <td style="padding:10px 0">Wireless</td> <td style="padding:10px 0">WIFI / BT / FM / GPS Four in one</td> </tr> <tr> <td rowspan="6"> <div style="display: flex;align-items: center;"> <div class="td-left" style="flex: 1;">Radio frequency</div> <div class="td-right" style="flex: 1; border-left: 1px solid #000;"> <p style="border-bottom: 1px solid #000;padding:10px 0">GSM</p> <p style="border-bottom: 1px solid #000;padding:10px 0">WCDMA</p> <p style="border-bottom: 1px solid #000;padding:10px 0">TD-CDMA</p> <p style="border-bottom: 1px solid #000;padding:10px 0">CDMA2000</p> <p style="border-bottom: 1px solid #000;padding:10px 0">FDD-LTE</p> <p>TDD-LTE</p> </div> </div> </td> <td style="padding:10px 0">900/1800 (850/1900 optional)</td> </tr> <tr> <td style="padding:10px 0">B1/B8 (B2/B4/B5 optional)</td> </tr> <tr> <td style="padding:10px 0">/</td> </tr> <tr> <td style="padding:10px 0">/</td> </tr> <tr> <td style="padding:10px 0">B1/B3/B7/B20 (B2/B4/B17optional)</td> </tr> <tr> <td style="padding:10px 0">B38/40/41B</td> </tr> <tr> <td style="padding:10px 0">Display</td> <td style="padding:10px 0">HD</td> </tr> <tr> <td style="padding:10px 0">Capacitance touch</td> <td style="padding:10px 0">Support</td> </tr> <tr> <td style="padding:10px 0">Camera</td> <td style="padding:10px 0">13M (25pin ZIF Connector)</td> </tr> <tr> <td style="padding:10px 0">Accelerometer Sensor</td> <td style="padding:10px 0">Support</td> </tr> <tr> <td style="padding:10px 0">IR Control</td> <td style="padding:10px 0">Support (Adapted iDroid remote controller)</td> </tr> <tr> <td style="padding:10px 0">Fingerprint Identification</td> <td style="padding:10px 0">Support</td> </tr> <tr> <td style="padding:10px 0">SIM Card</td> <td style="padding:10px 0">mini Single SIM Card</td> </tr> <tr> <td style="padding:10px 0">TF Card</td> <td style="padding:10px 0">Support hot-plugging</td> </tr> <tr> <td rowspan="2"> <div style="display: flex;align-items: center;"> <div class="td-left" style="flex: 1;">Audio</div> <div class="td-right" style="flex: 1; border-left: 1px solid #000;"> <p style="border-bottom: 1px solid #000;padding:10px 0;">Earphone</p> <p style="padding:10px 0">Mic</p> </div> </div> </td> <td style="padding:10px 0">For audio input / output</td> </tr> <tr> <td style="padding:10px 0">For audio input</td> </tr> <tr> <td rowspan="2"> <div style="display: flex;align-items: center;"> <div class="td-left" style="flex: 1;">USB</div> <div class="td-right" style="flex: 1; border-left: 1px solid #000;"> <p style="border-bottom: 1px solid #000;padding:10px 0;">USB Host × 3</p> <p style="padding:10px 0">Micro USB × 1</p> </div> </div> </td> <td style="padding:10px 0">Support OTG</td> </tr> <tr> <td style="padding:10px 0">Only for writing image</td> </tr> <tr> <td rowspan="2"> <div style="display: flex;align-items: center;"> <div class="td-left" style="flex: 1;">LED</div> <div class="td-right" style="flex: 1; border-left: 1px solid #000;"> <p style="border-bottom: 1px solid #000;padding:10px 0;">Power Indicator LED</p> <p style="padding:10px 0">Status Indicator LED</p> </div> </div> </td> <td style="padding:10px 0">Red</td> </tr> <tr> <td style="padding:10px 0">Green</td> </tr> <tr> <td style="padding:10px 0">Key</td> <td style="padding:10px 0">Power</td> </tr> <tr> <td style="padding:10px 0">HDMI</td> <td style="padding:10px 0">Support</td> </tr> <tr> <td> <div style="display: flex;align-items: center;"> <div class="td-left" style="flex: 1;">Low-level peripherals</div> <div class="td-right" style="flex: 1; border-left: 1px solid #000;"> <p style="padding:10px 0">40pin Headers</p> </div> </div> </td> <td style="padding:10px 0">1.8V, SPI × 2 , I2C × 3, UART × 2</td> </tr> <tr> <td rowspan="2"> <div style="display: flex;align-items: center;"> <div class="td-left" style="flex: 1;">Power</div> <div class="td-right" style="flex: 1; border-left: 1px solid #000;"> <p style="border-bottom: 1px solid #000;padding:10px 0;">DC</p> <p style="padding:10px 0">Battery</p> </div> </div> </td> <td style="padding:10px 0">5V 2A</td> </tr> <tr> <td style="padding:10px 0">Connection through a weld plate</td> </tr> <tr> <td colspan="2" style="padding:10px 0;">OS/Software</td> </tr> <tr> <td>OS</td> <td>Android 6.0</td> </tr><tr> <td>Programming support</td> <td>C、C++、Kotlin、Java、Shell、Python</td> </tr><tr> <td colspan="2" style="padding:10px 0;">Interface definition</td> </tr> <tr> <td>Size</td> <td>55mm*85mm</td> </tr><tr> <td>Weight</td> <td>43g</td> </tr><tr> <td colspan="2" style="padding:10px 0;">Orange Pi™ is trademark of Shenzhen Xunlong Software CO., Limited</td> </tr> </table><br>=== '''Orange Pi 4G-IoT 40pins GPIO Specification''' ===<br><table style="min-width: 800px;text-align: center;" border="1" bordercolor="#d8d8d8" cellspacing="0" cellpadding="0"> <tr> <td>OrangePi(4G-IoT)</td> <td></td> <td></td> </tr> <tr> <td style="background-color: #5a5a5a;">P01</td> <td style="background-color: #5a5a5a;">VIO28_PMU</td> <td></td> </tr> <tr> <td style="background-color: #5a5a5a;">P02</td> <td style="background-color: #5a5a5a;">DC5V</td> <td></td> </tr> <tr> <td style="background-color: #b1a0c6;">P03</td> <td style="background-color: #b1a0c6;">SDA1</td> <td style="background-color: #b1a0c6;">GPIO49</td> </tr> <tr> <td style="background-color: #5a5a5a;">P04</td> <td style="background-color: #5a5a5a;">DC5V</td> <td></td> </tr> <tr> <td style="background-color: #b1a0c6;">P05</td> <td style="background-color: #b1a0c6;">SCL1</td> <td style="background-color: #b1a0c6;">GPIO50</td> </tr> <tr> <td style="background-color: #5a5a5a;">P06</td> <td style="background-color: #5a5a5a;">GND</td> <td></td> </tr> <tr> <td style="background-color: #938a53;">P07</td> <td style="background-color: #938a53;">EINT87</td> <td style="background-color: #938a53;">GPIO87</td> </tr> <tr> <td style="background-color: #d99694;">P08</td> <td style="background-color: #d99694;">UTXD2</td> <td></td> </tr> <tr> <td style="background-color: #5a5a5a;">P09</td> <td style="background-color: #5a5a5a;">GND</td> <td></td> </tr> <tr> <td style="background-color: #d99694;">P10</td> <td style="background-color: #d99694;">URXD2</td> <td style="background-color: #d99694;">GPIO57</td> </tr> <tr> <td style="background-color: #c2d59a;">P11</td> <td style="background-color: #c2d59a;">URXD1</td> <td></td> </tr> <tr> <td style="background-color: #938a53;">P12</td> <td style="background-color: #938a53;">EINT8</td> <td style="background-color: #938a53;">EINT8</td> </tr> <tr> <td style="background-color: #c2d59a;">P13</td> <td style="background-color: #c2d59a;">UTXD1</td> <td></td> </tr> <tr> <td style="background-color: #5a5a5a;">P14</td> <td style="background-color: #5a5a5a;">GND</td> <td></td> </tr> <tr> <td style="background-color: #c2d59a;">P15</td> <td style="background-color: #c2d59a;">UCTS1</td> <td></td> </tr> <tr> <td style="background-color: #f9c090;">P16</td> <td style="background-color: #f9c090;">EINT9</td> <td style="background-color: #f9c090;">EINT9</td> </tr> <tr> <td style="background-color: #5a5a5a;">P17</td> <td style="background-color: #5a5a5a;">VIO28_PMU</td> <td></td> </tr> <tr> <td style="background-color: #f9c090;">P18</td> <td style="background-color: #f9c090;">EINT11</td> <td style="background-color: #f9c090;">EINT11</td> </tr> <tr> <td style="background-color: #92cddd;">P19</td> <td style="background-color: #92cddd;">SPI2_MI</td> <td style="background-color: #92cddd;">EINT3</td> </tr> <tr> <td style="background-color: #5a5a5a;">P20</td> <td style="background-color: #5a5a5a;">GND</td> <td></td> </tr> <tr> <td style="background-color: #92cddd;">P21</td> <td style="background-color: #92cddd;">SPI2_MO</td> <td style="background-color: #92cddd;">EINT4</td> </tr> <tr> <td style="background-color: #c2d59a;">P22</td> <td style="background-color: #c2d59a;">URTS1</td> <td></td> </tr> <tr> <td style="background-color: #92cddd;">P23</td> <td style="background-color: #92cddd;">SPI2_CK</td> <td style="background-color: #92cddd;">EINT6</td> </tr> <tr> <td style="background-color: #92cddd;">P24</td> <td style="background-color: #92cddd;">SPI2_CS</td> <td style="background-color: #92cddd;">EINT5</td> </tr> <tr> <td style="background-color: #5a5a5a;">P25</td> <td style="background-color: #5a5a5a;">GND</td> <td></td> </tr> <tr> <td style="background-color: #92cddd;">P26</td> <td style="background-color: #92cddd;">EINT12</td> <td></td> </tr> <tr> <td style="background-color: #528ed4;">P27</td> <td style="background-color: #528ed4;">SDA2</td> <td style="background-color: #528ed4;">GPIO51</td> </tr> <tr> <td style="background-color: #938a53;">P28</td> <td style="background-color: #938a53;">SCL2</td> <td style="background-color: #938a53;">GPIO52</td> </tr> <tr> <td style="background-color: #528ed4;">P29</td> <td style="background-color: #528ed4;">SPI_CS</td> <td style="background-color: #528ed4;">GPIO65</td> </tr> <tr> <td style="background-color: #5a5a5a;">P30</td> <td style="background-color: #5a5a5a;">GND</td> <td></td> </tr> <tr> <td style="background-color: #528ed4;">P31</td> <td style="background-color: #528ed4;">SPI_CK</td> <td style="background-color: #528ed4;">GPIO66</td> </tr> <tr> <td style="background-color: #d99694;">P32</td> <td style="background-color: #d99694;">URTS2</td> <td style="background-color: #d99694;">GPIO60</td> </tr> <tr> <td style="background-color: #528ed4;">P33</td> <td style="background-color: #528ed4;">SPI_MO</td> <td style="background-color: #528ed4;">PA9</td> </tr> <tr> <td style="background-color: #5a5a5a;">P34</td> <td style="background-color: #5a5a5a;">GND</td> <td></td> </tr> <tr> <td style="background-color: #528ed4;">P35</td> <td style="background-color: #528ed4;">SPI_MI</td> <td style="background-color: #528ed4;">GPIO67</td> </tr> <tr> <td style="background-color: #d99694;">P36</td> <td style="background-color: #d99694;">UCTS2</td> <td style="background-color: #d99694;">GPIO59</td> </tr> <tr> <td style="background-color: #938a53;">P37</td> <td style="background-color: #938a53;">EINT_123</td> <td style="background-color: #938a53;">GPIO123</td> </tr> <tr> <td style="background-color: #938a53;">P38</td> <td style="background-color: #938a53;">SCL3</td> <td style="background-color: #938a53;">GPIO54</td> </tr> <tr> <td style="background-color: #5a5a5a;">P39</td> <td style="background-color: #5a5a5a;">GND</td> <td></td> </tr> <tr> <td style="background-color: #938a53;">P40</td> <td style="background-color: #938a53;">SDA3</td> <td style="background-color: #938a53;">GPIO53</td> </tr> </table><br>'''Interface instructions:'''<br><div>[[File:Orange-pi-4g-iot-img1.png|800px|]]</div><br><div>[[File:Orange-pi-4g-iot-img2.png|800px|]]</div><br> == '''Using Method''' ==<br>=== '''Prepare the Hardware and Software''' ===<br>Hardware Requirement:<br>* Orange Pi 4G-IoT Development Board* A PC for compilation with following specs: <div style="padding-left:20px;">64bit CPU<br>Up to 16GB RAM<br>UP to 40GB spare disk space<br>Operation system should up to Ubuntu12.04, it would be better if it is Ubuntu16.04<br>You could refer to Google file for more details: https://source.android.com/source/building</div><br>Software Requirement:<br>* Orange Pi 4G-IoT SDK* Orange Pi 4G-IoT Firmware* Android-image-flash-tool<br>=== '''Power Methods''' ===<br>There are two methods for power supply:<br>* DC (5V 2A)in for power:* Battery in for power:Usually use 3.7V battery to solder on the back side of the development board.<br><br>=== '''Before Usage''' ===<br>After receiving the product, please put the antennas of the product from the position of Pic 1 to the position of Pic 2 (or to the outside of the board), which can not be attached to the board so as not to affect the signal.<div>[[File:Orange-pi-4g-iot-img3.png|800px|]]</div><div style="display:flex;width:800px;"><div style="flex:1;text-align:center;">Pic 1</div><div style="flex:1;text-align:center;">Pic 2</div></div><br>== '''Android Compilation Environment Construction''' ==<br>=== '''Download SDK compression package''' ===<br>* '''Android 6.0'''Download the compression packages, corresponding to OrangePi_4G-IoT_Android 6.0_V1.0.tar.gz.00, OrangePi_4G-IoT_Android 6.0_V1.0.tar.gz.01, OrangePi_4G-IoT_Android 6.0_V1.0.tar.gz.14, a total of 15 volume compression packages. After obtaining the volume compressed packages, place all the compressed packages in the same directory, such as<br><br><div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">'''Create directory:'''<br>mkdir OrangePi_4G-IoT_Android6.0 <br>'''Copy Volume Compression Packet:'''<br>cp -rf OrangePi_4G-IoT_Android6.0_V1.0.tar.gz.* <br>OrangePi_4G-IoT_Android6.0/<br>'''Merge Compression Packet:'''<br>cat OrangePi_4G-IoT_Android6.0_V1.0.tar.gz.* > <br>OrangePi_4G-IoT_Android6.0.tar.gz<br>'''Unzip:'''<br>tar xzvf OrangePi_4G-IoT_Android6.0.tar.gz</div>* '''Android 8.1'''After downloaded compression package, you will have 11packages named x00, x01, x02, x03 ...x10.Put packages on the same directory like the following:<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">Create directory<br>mkdir OrangePi_4G-IoT_Android8.1 <br>Copy compress package<br>cp -rf x00 x01 x02 ... x10 <br>Merge compression package<br>cat x*>OrangePi_4G-IoT_Android8.1.tar.gz <br>Decompression<br>tar xzvf OrangePi_4G-IoT_Android8.tar.gz</div><br> === '''Construct Compilation Environment''' ===<br>It could also refer to Google file: [http://source.android.com/source/initializing.html <span style="color:#6600ff;">http://source.android.com/source/initializing.html</span>]<br><br>* '''Install JDK'''Compilation of Android6.0 is based on JAVA7, it needs to first install OpenJDK before compilation.<br><br>Command for installing:<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">sudo apt-get install openjdk-7-jdk</div><br>Configure environment variable of JAVA, here is the path for installation:<br><br>/usr/lib/jvm/java-7-openjdk-amd64<br><br>It could configure on the terminal with the following command:<br><br><div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 <br>export PATH=$JAVA_HOME/bin:$PATH<br>export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar</div>* '''Install Software Package'''For Ubuntu12.04:<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">sudo apt-get update<br>sudo apt-get install git-core gnupg flex bison ccache gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libc6-dev lib32ncurses5-dev x11proto-core-devlibx11-dev lib32readline-gplv2-dev lib32z1-dev libgl1-mesa-dev gcc-4.4 g++-4.4 g++-4.4-multilib g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc wine</div><br>For Ubuntu14.04:<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">sudo apt-get update<br>sudo apt-get install git-core gnupg flex bison ccache gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libc6-dev lib32ncurses5-dev x11proto-core-devlibx11-dev lib32readline-gplv2-dev lib32z1-dev libgl1-mesa-dev g++-multilib g++-4.8-multilib mingw32 tofrodos python-markdownlibxml2-utils xsltproc libc6-dev-i386 lib32z1 lib32ncurses5 lib32bz2-1.0 lib32readline-gplv2-dev wine</div><br>We could process to SDK compilation after finished the above.<br><br>=== '''Compilation of SDK Source Code''' ===<br>There are many compilation shell scripts for development.<br><br>* '''Android 6.0'''<br>The directory would be: SDK/code/orangepi/scripts<br><br><div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ cd code/orangepi/scripts<br>$ ls<br>anr_LM.sh auto.sh clean.sh codegen.sh init_project.sh tar_img.sh</div>auto.sh is automatically compilation script<br>clean.sh automatically scavenging the compiled result script<br><br>On the directory of code/orangepi/scripts, execute the automatically compilation script:<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ ./auto.sh IoT_bd6737m_35g_b_m0_op_smt_hd720_pcb_v2 v00 eng</div>The meaning of the parameter is:<br>#$1 project_info [eg: IoT_bd6737m_35g_b_m0_op_smt_hd720_pcb_v2] <br>#$2 version_info [eg: v00 v01 ...]<br>#$3 compile_mode [eng:user userdebug eng]* '''Android 8.1'''<br>The directory would be: SDK/code/orangepi/scripts<br><br><div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ cd code/orangepi/scripts<br>$ ls<br>anr_LM.sh auto.sh clean.sh codegen.sh init_project.sh tar_img.sh</div>auto.sh--scripts for automatic compilation<br>clean.sh--scripts for automatically cleaning the compiled result<br><br>On the directory of code/orangepi/scripts, execute automatic compilation scripts:<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ ./auto.sh IoT_k37mv1_bsp_ry_smt_hd720_pcb_v2 v00 eng</div>Definition of the three parameters:<br>#$1 project_info [eg: IoT_k37mv1_bsp_ry_smt_hd720_pcb_v2] <br>#$2 version_info [eg: v00 v01 ...]<br>#$3 compile_mode [eng:user userdebug eng]<br><br>Execute command to compile:<br>source build/envsetup.sh<br>luncher >full_k37mv1_bsp-eng<br>make -j4<br><br>'''Module compilation'''<br>Here would take an example of only compilation launcer:<br>mm packages/apps/Launcher3/ or enter into directory of packages/apps/Launcher3/, execute mm<br> Please note that some modules depend on the relationship of package, you need to run mma.<br><br>=== '''Generated Firmware''' ===<br>* '''Android6.0'''After compiled, the firmware will gather in the directory of: code/IoT_op_smt_hd720_pcb_v2, pack it and name it like the following: IoT_op_smt_hd720_pcb_v2_v00_eng_20180126140300.tar.gz<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ tree IoT_op_smt_hd720_pcb_v2 IoT_op_smt_hd720_pcb_v2<br>├── images<br>│ ├── boot.img<br>│ ├── cache.img<br>│ ├── lk.bin<br>│ ├── logo.bin<br>│ ├── MT6737M_Android_scatter.txt<br>│ ├── preloader_bd6737m_35g_b_m0.bin<br>│ ├── recovery.img<br>│ ├── secro.img<br>│ ├── system.img<br>│ ├── trustzone.bin<br>│ └── userdata.img<br>└── modem<br>├── APDB_MT6735_S01_alps-mp-m0.mp1_W17.21<br>├── _APDB_MT6735_S01_alps-mp-m0.mp1_W17.21.check<br>└── APDB_MT6735_S01_alps-mp-m0.mp1_W17.21_ENUM</div>Except the above method, it could also be generated into update.image via Linux_Pack_Firmware.* '''Android8.1'''After compiled, the firmware will gather in the directory of: code/IoT_ry_smt_hd720_pcb_v2, pack it and name it like the following: IoT_ry_smt_hd720_pcb_v2_v09_eng_20180504163653.tar.gz<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ tree IoT_op_smt_hd720_pcb_v2 IoT_op_smt_hd720_pcb_v2<br>├── images<br>│ ├── boot.img<br>│ ├── cache.img<br>│ ├── lk.bin<br>│ ├── logo.bin<br>│ ├── MT6737M_Android_scatter.txt<br>│ ├── preloader_k37mv1_bsp.bin<br>│ ├── recovery.img<br>│ ├── secro.img<br>│ ├── system.img<br>│ ├── trustzone.bin<br>│ └── userdata.img<br>└── modem<br>├── APDB_MT6735_S01_alps-mp-m0.mp1_W18.04<br>├── _APDB_MT6735_S01_alps-mp-m0.mp1_W18.04.check<br>└── APDB_MT6735_S01_alps-mp-m0.mp1_W18.04_ENUM</div><br>== '''Android Firmware Flashing''' ==<br>Relevant keys and connectors for firmware flashing of '''Orange Pi 4G-IoT:'''<br><div>[[File:Orange-pi-4g-iot-img4.png|800px|]]</div><br>'''List of generated firmwares:'''<br>IoT_op_smt_hd720_pcb_v2<br>├── images<br>│ ├── boot.img<br>│ ├── cache.img<br>│ ├── lk.bin<br>│ ├── logo.bin<br>│ ├── MT6737M_Android_scatter.txt<br>│ ├── preloader_bd6737m_35g_b_m0.bin<br>│ ├── recovery.img<br>│ ├── secro.img<br>│ ├── system.img<br>│ ├── trustzone.bin<br>│ └── userdata.img<br>└── modem<br>├── APDB_MT6735_S01_alps-mp-m0.mp1_W17.21<br>├── _APDB_MT6735_S01_alps-mp-m0.mp1_W17.21.check<br>└── APDB_MT6735_S01_alps-mp-m0.mp1_W17.21_ENUM<br>You could download the packed image partition files from the official website: <br>http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-4G-IoT.html<br>Unzip the file with the following command:<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ tar zxvf IoT_op_smt_hd720_pcb_v2_v00_eng_20180126140300.tar.gz</div>You could get the file which mentioned on the list of generated files, or you could also compile it by yourself with reference of to the part of Android Compilation Environment Construction.<br><br>'''Supporting OS of PC:'''* Windows 10* Windows 7 (32/64 bit)* Windows 8 (32/64 bit)* Ubuntu10.04 / 12.04 / 14.04 (32/64bit)<br>=== '''Flash Tool Introduction''' ===<br>You could download the '''Smart Phone Flash''' Tool on the download page of Orange Pi 4G-IoT part. There are tools for Windows and Linux version, you could select a suitable version according to your PC environment.<br>Interface like the following:<div>[[File:Orange-pi-4g-iot-img5.png|800px|]]</div><br>Using method for both Windows and Linux versions are same, here will illustrate with Linux version.<br><br>=== '''Method for Image Flashing''' ===<br><div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">If you cannot connect the Orange Pi 4G-IoT to the computer, pls try:<br>$sudo apt-get remove modemmanager<br>$sudo /etc/init.d/udev retstart<br>And then reboot the computer<br><br>Download MTK driver according to the corresponding system under Windows<br>Unzip Driver_Auto_Installer_EXE_v5.1453.03.rar<br>And then install it。</div><br>* '''Unzip and open flash tool'''<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ unzip SP_Flash_Tool_v5.1644_Linux.zip<br>$ cd SP_Flash_Tool_v5.1644_Linux<br>$ sudo ./flash_tool.sh</div><br>If it is the first time you use this software, you might receive the warn like the following. It is normal to receive this, you could click OK enter into the software. In the future you could manually specified the path of Scatter File.<div>[[File:Orange-pi-4g-iot-img6.png|800px|]]</div><br>* '''Enter into flash mode'''a.Switch into Download page like the following:<div>[[File:Orange-pi-4g-iot-img7.png|800px|]]</div><br>b.Click choose on the right side of Scatter-loading File and select the path of Scatter File like the following:<div>[[File:Orange-pi-4g-iot-img8.png|800px|]]</div><br>c.After double click the selection, the '''partition information display section''' will automatically fill the path of each partition file and the absolute starting address to which they are to be flashed.<div>[[File:Orange-pi-4g-iot-img9.png|800px|]]</div><br>d.In the top left corner of '''partition information display section''', there would be a drop-down menu. <br>Three of this options:<br>Format All + Download // Format all information on the partitions and re-download the selected partition<br>Firmware Upgrade // Update the difference on the selected partition <br>Download Only // Re-download no matter there is difference or not<br>Please note it: Usually update firmware you only need to select '''Firmware Upgrade''', please <span style="color:red;">do not</span>select '''Format All + Download'''<br>It you select Format All, you will lose the calibration information which we worked before sending out products. If this situation is inadvertent, please contact the Orange Pi service and obtain the calibration parameters through the machine code, and re-flash the calibration parameters.<br><br>e.Use USB data cable to connect PC and Orange Pi, the right side of Orange Pi will be in red LED. <br><span style="color:red;">In this case do not need to connect DC power supply.</span><br>f.Click Download button[[File:Orange-pi-4g-iot-img10.png|50px|]]<br><br>g.The interface would show like the following after downloaded:<div>[[File:Orange-pi-4g-iot-img11.png|800px|]]</div><br>h.Take of the USB cable and insert DC power supply<br>Wait around 5 seconds, it will display the charging interface of shutdown<br>When the Power button is loosened after 5 seconds, the system will start to enter the systemWhen the updated partition is more, the first boot will take a long time (the full partition update needs 8min), please be patient.<br><br> === '''FAQ''' ===<br>Android8.1 compilation tool chain uses the new Jack server to replace the old compilation tool chain.<br><br>* '''Configure Jack server before compilation'''<br>①Modify .jack file on the path of $HOME:<div>[[File:Orange-pi-4g-iot-img12.png|800px|]]</div><br>②Modify .jack-settings file on the path of $HOME:<div>[[File:Orange-pi-4g-iot-img13.png|800px|]]</div>(These two files TCP port should not be used before, and these two files and ports should be with same configure.)<br><br>③code/prebuilts/sdk/tools/ directory, execute /jack-admin kill-server and./jack-admin restart-server<br><br>* '''Failed to contact Jack server'''<br>If you meet the following error when compilation:<br>FAILED: /bin/bash -c "(prebuilts/sdk/tools/jack-admin install-server prebuilts/sdk/tools/jack-launcher.jar prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar 2>&1 || (exit 0) ) && (JACK_SERVER_VM_ARGUMENTS=\"-Dfile.encoding=UTF-8 -XX:+TieredCompilation\" prebuilts/sdk/tools/jack-admin start-server 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update server prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar 4.8.ALPHA 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-2.28.RELEASE.jar 2.28.RELEASE || exit 47; prebuilts/sdk/tools/jack-admin update jackprebuilts/sdk/tools/jacks/jack-3.36.CANDIDATE.jar 3.36.CANDIDATE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-4.7.BETA.jar 4.7.BETA || exit 47 )"<br>Writing client settings in /home/user3/.jack-settings <br>Installing jack server in "/home/user3/.jack-server"<br><br>Modify: On directory of code/prebuilts/sdk/tools/, execute ./jack-admin kill-server and ./jack-admin restart-server, then re-compilation<br><br>* '''Out of memory error'''First stop running jack server,Then execute jack-admin on the directory of kill-server prebuilts/sdk/tools to kill Jack serverThen open jack-admin file, search JACK_SERVER_COMMAND on the file, then change JACK_SERVER_COMMAND="java -XX:MaxJavaStackTraceDepth=-1-Djava.io.tmpdir=$TMPDIR $JACK_SERVER_VM_ARGUMENTS -cp $LAUNCHER_JAR$LAUNCHER_NAME" into JACK_SERVER_COMMAND="java -Xmx3g-XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=$TMPDIR$JACK_SERVER_VM_ARGUMENTS -cp $LAUNCHER_JAR $LAUNCHER_NAME". Which isadd option of -Xmx3g.<br><br>* '''FAILED: setup-jack-server'''FAILED: setup-jack-server<br>Jack server installation not found<br><br>Solution: Execute the following command on the directory of prebuilts/sdk/tools: ./jack-admin install-server jack-launcher.jar jack-server-4.11.ALPHA.jar<br>jack-launcher.jar, jack-server-4.11.ALPHA.jar is up to the file name on the directory of prebuilts/sdk/tools.<br><br>* '''Test Issue'''<br>When the sim card cannot be recognized, you need to format SD card when it could not recognize it, and need to formatting flash.<br><br> == '''Linux Compilation Environment Construction''' ==<br>=== '''Get Linux Source Code''' ===<br>* '''Orange Pi Source Code Downloader'''<br><br><div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ sudo apt-get install git<br>$ git clone https://github.com/orangepi-xunlong/OrangePi_Build.git<br>$ cd OrangePi_Build<br>$ ls<br>Build_OrangePi.sh lib README.md</div><br>* '''Run the Downloader'''<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ ./Build_OrangePi.sh</div><br>Enter the root password and press Enter<br><br><div>[[File:Orange-pi-4g-iot-img14.png|800px|]]</div><br>Choose 0 Build system with kernel/uboot/rootfs, enter the development board model selection interface.<br><br><div>[[File:Orange-pi-4g-iot-img15.png|800px|]]</div><br>Choose 23 orangepi 4G-IoT,Press Enter and start download Orange Pi 4G-IoT Linux Source Code.<br><br><div>[[File:Orange-pi-4g-iot-img16.png|800px|]]</div><br>The downloaded source code will be stored in the same directory as OrangePi_Build. Orange Pi 4G-IoT Linux source code directory structure is as follows<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">├── bootloader<br>├─ build.sh -> scripts/build.sh Compile the startup script<br>├── external Store additional configuration files and partial code<br>├── kernel<br>├── output Store the output file, generate it after compiling the source code<br>├── scripts<br>└── toolchain<br><br>6 directories, 1 file</div><br> === '''Compilation of Linux Source Code''' ===<br>* '''Execute the compilation start up script'''<br><div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ cd Orange Pi 4G-IoT<br>$ ./build.sh</div><br>According to the board model to choose and press Enter.<br><br>Enter the root password and press Enter, then select the function needed to execute.<div>[[File:Orange-pi-4g-iot-img17.png|800px|]]</div><br>The functions of each option are as follows:<br>* '''0 Build Release Image''' '''Compile full image'''* '''1 Build Rootfs''' '''Compile Rootfs'''* '''2 Build Uboot''' '''Compile preloader and lk'''* '''2 Build Linux''' '''Compile kernel source code'''<br><br>Choose 0 Build Release Image, generate the following complete firmware package<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">output/images/<br>├── OrangePi_4g-IoT_ubuntu_xenial_server_linux3.18.19_v1.1<br>│ ├── boot.img<br>│ ├── lk.bin<br>│ ├── lk_emmc.bin<br>│ ├── lk_sd.bin<br>│ ├── logo.bin<br>│ ├── MT6737M_Android_scatter.txt<br>│ ├── preloader_bd6737m_35g_b_m0.bin<br>│ ├── rootfs.img<br>│ └── trustzone.bin<br>└── OrangePi_4g-IoT_ubuntu_xenial_server_linux3.18.19_v1.1.tar.gz<br><br>1 directory, 10 files</div><br>Android burning tool can be used to burn the above image file into flash, please refer to Android firmware burning chapter.<br><br>Also can execute 3 Install Image into EMMC option to open the burning tool for burning<br><br><span style="font-size:30px;font-weight:bold;">Linux Firmware Flashing</span><br><br>Currently, Linux systems do not support modems and LCD screens.<br>You can only log in to the system through the serial port. After connecting to wifi, you can log in through ssh.<br><br>The previous "Android Firmware Burning" has introduced how to use the burning tool, so I won't go into details here, just open the burning tool directly.<br><br>We click on the far right of the Scatter-loading File column And select the path of Scatter File, as shown below<br><br><div>[[File:Orange-pi-4g-iot-img18.png|800px|]]</div><br>First disconnect the board from the PC and click the Download button<div>[[File:Orange-pi-4g-iot-img19.png|800px|]]</div><br>Next, use a USB download cable to connect the host's USB to the machine's MircoUSB interface. Burning completed<div>[[File:Orange-pi-4g-iot-img20.png|800px|]]</div><br>Start the system.<br>Connect the board to a 5V 3A power adapter. Connect the serial port to see the system startup.<div>[[File:Orange-pi-4g-iot-img21.png|800px|]]</div><br>If the onboard space is not enough, you can burn the rootfs to the TF card. Proceed as follows.烧录支<br>Hold the lk of the mounted TF card rootfs<br>Click on the content in the box below<div>[[File:Orange-pi-4g-iot-img22.png|800px|]]</div><br>Select lk_sd.bin in the popup window.<div>[[File:Orange-pi-4g-iot-img23.png|800px|]]</div><br>Click download, download is complete<div>[[File:Orange-pi-4g-iot-img24.png|800px|]]</div><br>Burn rootfs to TF card<br><br>Prepare a TF card above 8G and class10. After formatting. Burn roofs.img as follows<br><br><div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">pv rootfs.img | sudo dd of=/dev/sdb bs=1M</div>sdb is the device file corresponding to the TF card<br>If it is a windows system, you can also use Win32DiskImager software to burn.<br>Start the system<br>Insert the tf card into the board and start it after power on.<br><br> == '''Serial Debugging Tool''' ==<br>First need to prepare a USB to TTL serial cable, need to support 921600 baud rateThe debugging serial port of 4G-iot is not brought out, so users need to fly their own wires. The solder joints of the following figure boxes are TXD and RXD of the serial port. GND, RXD and TXD need to be brought out.<div>[[File:Orange-pi-4g-iot-img25.png|800px|]]</div><br>Connection mode:<br>Board TXD Connects USB to TTL RXD <br>Board RXD Connecting USB to TTL TXD <br>Board GND Connecting USB to TTL GND<br><br>=== '''Usage based on Windows platform''' ===<br>In the process of using Orange Pi for project development, in order to get more debugging information, Orange Pi defaults support serial port information debugging. For developers, just prepare the materials mentioned above and can easily get serial debugging information. The serial port debugging tools used by different upper computers are similar, basically refer to the following ways to deploy. There are many tools for serial port debugging using the Windows platform. The commonly used tools are Putty. This section uses putty as an example for deployment.<br><br>* '''Install USB driver'''Download the latest version of the driver PL2303_Prolific_DriverInstaller_v130.zip, download and extract.<div>[[File:Orange-pi-4g-iot-img26.png|800px|]]</div><br>Select application installation as an administrator<div>[[File:Orange-pi-4g-iot-img27.png|800px|]]</div><br>Waiting for installation and click.<div>[[File:Orange-pi-4g-iot-img28.png|800px|]]</div><br>* '''Download and install Putty'''Putty can be downloaded from the address below, please choose the version that suits your development environment.<br> https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.htmlDouble-click the downloaded putty.exe to open putty. The software interface is shown below.<div>[[File:Orange-pi-4g-iot-img29.png|800px|]]</div><br>* '''Acquisition of device information'''In Windows 7, we can check whether the serial port connection is normal and the serial port device No. through Device Manager. If the device is not recognized properly, please check if the driver is installed successfully. If there is a problem with the driver installation, try using the 360 Driver Master to scan the installation driver.<div>[[File:Orange-pi-4g-iot-img30.png|800px|]]</div><br>* '''Putty configuration'''Set the serial port to the corresponding port number (COM4), turn off the flow control, and set the speed to 921600.<div>[[File:Orange-pi-4g-iot-img31.png|800px|]]</div><br>* '''Start debugging serial output'''When the Orange Pi is powered on, putty will automatically print the serial port log information.<br><br>=== '''Usage based on Linux platform''' ===<br>There is a little difference using putty between Windows platform and Linux platform. The following mainly explains the differences. All operations are based on the Ubuntu 14.04 system.<br><br>* '''Install and start Putty'''<br><div style="border:1px solid #ddd;background:#f1f1f1;padding:5px;">$ sudo apt-get install putty<br>$ sudo putty</div><br>* '''Configuration Putty'''The serial port number can be viewed via ls /dev/ttyUSB* <br>The baud rate needs to be set to 921600<br>And turn off flow control<div>[[File:Orange-pi-4g-iot-img32.png|800px|]]</div><br> == '''Usage of GPIO''' ==<br>There are two methods for using GPIO:<br><br>==='''There is a general GPIO Operation Interface under Linux, “/sys/class/gpio” 。'''===<br>You could find the configuration file under the directory of “/sys/class/gpio”, the control program can be divided into four steps:<br>1、Configuring GPIO:<br><br>There is a file ‘export’ under the directory of “/sys/class/gpio”, , you could invoke it to achieve configuration. This file have numbered the GPIO, or you could also download the schematic or get form this manual.<br><br>For example, the 37th pin on 40pins is GPIO123,you could enter:# echo 123 > /sys/class/gpio/export, and come back to the directory “/sys/class/gpio”,there will have a new directory “./gpio123”,which include the configuration files of in and out of the IO port.<br><br>Note : export file have the permission of root write only. You have to execute as root the above command or executable file written in C.<br><br>2、Configuring the direction of GPIO (input and output):<br><br>Enter the command on the terminal:# echo "out" > /sys/class/gpio/gpio38/direction,which is set this GPIO as output.<br><br>3、Configuring the output level of GPIO:<br><br>Enter the command on the terminal:#echo 1 > /sys/class/gpio/gpio123/value,which is set this GPIO output high level, enter: echo "0" > /sys/class/gpio/gpio123/value for setting this GPIO output low level。<br><br>4、Shutting Down GPIO:<br><br>Enter the command on the terminal:#echo "38" > /sys/class/gpio/unexport,which could delete the GPIO configuration file,the directory ‘gpio38’ have been deleted.<br><br>=== '''Modify and Display the GPIO Status under ADB Mode''' ===<br>'''Get the Open/Close Status of GPIO : cat /sys/devices/virtual/misc/mtgpio/pin'''<br><br>Enter the command under ADB mode: cat /sys/devices/virtual/misc/mtgpio/pin , then it will show: pin: [mode] [pull_sel] [din] [dout] [pull en] [dir] [ies] [smt]<br><br>0:11101010<br><br>1:01101010<br><br>、、、、、、<br><br>22:1-100-10-1-1<br><br>、、、、、、、<br><br>42:00000110<br><br>'''Corresponding meaning per row:'''<br><br>IO Number:mode,pull select,input value,output value,pull enable,direction,ies '''Modify the Status of GPIO:'''<br><br> You could get the 40pin GPIO specifications from this manual or from schematic which have been uploaded to our official website: <br>http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-4G-IoT.html<br>For example the 37th pin on 40pins is GPIO123,<br>echo -wdout123 1 > pin -This is Set the GPIO to output high <br><br>level echo -wdout123 0> pin -This is Set the GPIO to output <br><br>high level<br><br> == '''History''' ==<br> <table style="min-width: 800px;text-align: center;" border="1" bordercolor="#d8d8d8" cellspacing="0" cellpadding="0"> <tr style="background-color: #b7b7b7;"> <td>Ver</td> <td>Data</td> <td style="font-weight: normal;">Author</td> <td>Brief</td> <td>Publish</td> <td>Me</td> </tr> <tr> <td>1.1</td> <td>2018-01-26</td> <td style="font-weight: normal;">Younix</td> <td>Create File</td> <td>2018-3-27</td> <td></td> </tr> <tr> <td>1.2</td> <td>2018-05-10</td> <td style="font-weight: normal;">Engineer Pan</td> <td>Add Android8.1</td> <td>2018-5-15</td> <td></td> </tr> <tr> <td>1.3</td> <td>2018-10-18 </td> <td style="font-weight: normal;">Engineer Pan</td> <td>Add Usage of GPIO</td> <td>2018-10-19</td> <td></td> </tr> <tr> <td>1.4</td> <td>2019-06-24</td> <td style="font-weight: normal;">Csy</td> <td>Linux source code compilation and serial port debugging </td> <td>2019-06-25</td> <td></td> </tr> <tr> <td>1.5</td> <td>2020-03-18 </td> <td style="font-weight: normal;">csy</td> <td>Linux Firmware Flashing</td> <td></td> <td></td> </tr> </table><br><br>== '''Download the Orange Pi 4G-IoT User Manual''' ==<br>For more information on using the Orange Pi 4G-IoT, please see the [https://drive.google.com/open?id=1nHRikLzsu0B85_ESL2Hcu5ns8kEBGkTd <span style="color:red;">Orange Pi 4G-IoT User Manual</span>]. (Click to download)

Navigation menu