Open main menu

Wiki-Orange Pi β

Changes

Orange Pi 2G-IoT

7,554 bytes removed, 10:38, 1 July 2022
no edit summary
{| class="wikitable" style="width:800px;background:#ffffff;"
|-
| colspan=2|| <span style="font-weight:700;">Hardware specification</span>
|-
| CPU || ARM Cortex-A5 32bit
| Supported OS|| Android, Ubuntu, Debian, Rasbian
|-
| cospan=2|| <span style="font-weight:700;">Interface definition</span>
|-
| Product size|| 67mm × 42mm
| Weight|| 35g
|-
| colspan=2|| Orange Pi™ is a trademark of the Shenzhen Xunlong Software CO., Limited
|}
<br>
<div>[[File:Orange-pi-2g-iot-img4.png|500px|]]</div>
<br>
 
=== '''GPIO Specifications''' ===
<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 2G-IOT IoT is camera connector.<br>
<br>
<div>[[File:Orange-pi-i96-img3.png|500px800px|]]</div>
<br>
'''OrangePi 2G-IOTIoT-CSI'''
<br>
<table style="min-width: 800px;text-align: center;" border="1" bordercolor="#d8d8d8" cellspacing="0"
</table>
<br>
 
== '''Using Method''' ==
<br>
|}
<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]]
v.Click the "Format"button.
</div>
<br>c.Download the operating system image file from the download page, the page address is as follows:<br> http://www.orangepi.cnorg/html/hardWare/computerAndMicrocontrollers/downloadresourcescnservice-and-support/Orange-Pi-2G-IoT.html<br>
d.Unzip the downloaded file (in addition to the Android system, this method can be used to burn to write, the Android system need another burn, the following will introduce).<br>
e.Right click the downloaded file, select "Unzip file" to write image to TF card.
</div>
c.Download the image OS from download page: <br>
http://www.orangepi.cnorg/`downloadresourcescnhtml/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-2G-IoT.html<br>
d.Unzip the downloaded file and right click it, select " Unzip file"<br>
e.Write image into TF card
<br>
* Insert the TF card with written image into the TF card slot
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img5.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-2g-iot-img6.png|400px]]</div>
<br>
* Insert the keyboard or mouse into the USB port.
* Connect wifi antenna and base-band antenna
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img7.png|400px]]</div>
<br>
* Connect LCD and Camera
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img8.png|400px]]</div>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img9.png|400px]]</div>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img10.png|400px]]</div>
<br>
* Connect TTL cable, you could refer to the Debug method in this instruction.
Serial port uses TTL to USB cable to connect.<br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img11.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-2g-iot-img12.png|400px]]</div>
<br>
 If the above steps are successful, the OrangePi 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>
=== '''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 2G-IOTIoT, like wifi setting, audio setting, user setting. <br>
<br>
'''1)Wifi setting on serial port'''<br>
<br>
 You need to use two cellphones if you want to use this function. Please refer to this: <br>
 Orange Pi 2G-IOT IoT 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 2G-IOTIoT.<br> After getting the IP of Orange Pi 2G-IOTIoT, you could use SSH remote login in Linux PC or Windows PC. Command as following: <br>
 ssh orangepi@192.168.xxx.xxx<br>
 Password: orangepi<br>
=== '''Write Android into Nand''' ===
<br>
 Orange Pi 2G-IOT IoT 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-2g-iot-img13.png|400px]]</div>
<br>
 Power it on, Orange Pi 2G-IOT IoT will boot from NAND.<br>
<br>
'''2)Update Android in NAND'''<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-2g-iot-img14.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: <br>http://www.orangepi.org/downloadresourceshtml/hardWare/computerAndMicrocontrollers/service-and-support/ Orange-Pi-2G-IoT.html <div>[[File:Orange-pi-i962g-iot-img18img66.png|800px]]</div>
<br>
'''4)Install USB driver on Windows'''
<br>
 Unzip the tool file, install the USB driver, here is the path: <br>*http:/OrangePi_2G/www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-IOT_Toolschainand-support/USB_Driver/USBOrange-Pi-2G-IoT.html<br><div>[[File:Orange-pi-2g-iot-driverimg67.png|800px]]</div><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'''<br> Here is the ink for Orange Pi 2G-IOT IoT Nand version image:<br> httphttp://www.orangepi.org/downloadresourceshtml/hardWare/computerAndMicrocontrollers/ service-and-support/Orange-Pi-2G-IoT.html<br> <div>[[File:Orange-pi-i962g-iot-img19img66.png|800px]]</div>
<br>
'''6)Use writing tool'''<br>
<br>
Use writing tool to write NAND:<br>*http://www.orangepi.org/html/OrangePi_2GhardWare/computerAndMicrocontrollers/service-and-IOT_Toolschainsupport/OrangePi_2GOrange-Pi-IOT_NandUpdate_Tools/OrangePi_2G2G-IOT_Update.exeIoT.html<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 2G-IOTIoT.<br>
<br>
'''7)Download Image'''<br>
<br>
 Prepare an Android USB to DC cable, first connect to the OTG port of Orange Pi 2G-IOTIoT, 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>
<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-2g-iot-img16.png|600px]]</div>
<br>
* Connect to the OTG port of Oragne Pi 2G-IOT IoT 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 2G-IOT IoT via adb, you could refer to the adb debug method from the internet to enter into Orange Pi 2G-IOTIoT
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>
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>   
=== '''Usage of GPIO and WiringPi''' ===
<br>
'''1)Use WiringPi on OrangePi 2G-IOT IoT to connect network'''<br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img17.png|600px]]</div>
<br>
OrangePi 2G-IOT IoT could support WiringPi, you could have a try according to the introduction on this section. The following is 40 Pin of OrangePi. <br>
<br>
a.Download the latest WiringPi source code of Orange Pi 2G-IOTIoT<br>Please confirm that the Orange Pi 2G-IOT IoT has connect to wifi or network successfully, if no, then you need to first make it connect to wifi or network. If you connect to network, then you also need to install some essential tools:<br>
<div style="padding-left:40px;"><span style="background:#fffaa5;">sudo apt-get install git gcc make</span></div>
b.Download the latest source code <br>
You could download the latest WiringPi source code from official website: <br>http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-2G-IoT.html<br><br>You could also download files from github: <br>https://github.com/OrangePiLibra/WiringPi.git with the following command:<br>
<span style="background:#fffaa5;">env GIT_SSL_NO_VERIFY=true git clone</span><br>
c.Compile and install WiringPi<br>
Use the following command to compile and install the WiringPi after get the latest source code. <br>
cd WiringOP/<br>
./build OrangePi_2G-IOT IoT <br>./build OrangePi_2G-IOT IoT install<br>
d.Test WiringPi with gpio command<br>
You could use gpio command to test GPIO on 40pin on Orange Pi 2G-IOT IoT with WiringPi installed.<br>
i Use "gpio readall" command to print out all WiringPi pin mapping as following.BCM line represents the actual hardware GPIO, there are 4 Groups GPIO and each Group have 32pins, and the serial number start from Group PA. PA0 corresponds to BCM colum number 0.<br>
wPi line represents pins of wiringPi, you could use this group of data when use C library and gpio command on wiringPi. For example, number 37 pin is corresponding to number 25 pin of wiringPi, you could operate the 37 via operating 25pin.<br>
Physical line represents the actual hardware number.<br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-i96-img32.png|600px]]</div>
<br>
ii Use "gpio export pin mode" to explore wiringPi GPIO to the directory of /sys/class/gpio and set the GPIO mode into mode.<br>
According to the above WiringPi pin mapping, hardware pin number 37 is corresponding to WiringPi pin number GPIO 25, explore the number 25 and set it into output mode.<br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img18.png|600px]]</div>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img19.png|600px]]</div>
<br>
iii Use "gpio unexport pin" to cancel explore pin to /sys/class/gpio. For example:
orangepi# gpio unexport 25<br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img20.png|600px]]</div>
<br>
iv Use "gpio exports" to check the current explored gpio. For expample:
orangepi# gpio exports<br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img21.png|600px]]</div>
<br>
v Use "gpio mode pin mode" command to configure wiringPi pin mode. For example:<br>
orangepi# gpio read 25<br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-i96-img33.png|600px]]</div>
<br>
viii.If you want to learn more "gpio" command, you could refer to "gpio -h" obtain.<br>
Complie GPIO LED<br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-i96-img34.png|600px]]</div>
<br>
Usage of C library on wiringPi:<br>
In order to use wiringPi C library, first you need to import file of "wiringPi.h". You need to initialize wiringPi before using GPIO with function wiringPiSetup(). And then you could configure pin mode into INPUT or OUTPUT. And please note that the pin number should corresponding to wiringPi. Finally you could use function digitalWrite() and digitalRead() to read and write.<br>
<br>  
=== '''Connect to Network via GSM''' ===
<br>
1)Use 2G-IOT IoT to send message<br>
<br>
For now the version of Ubuntu,Debian and Raspbian could support SMS sending message. Before using the SMS function, please make sure the SIM card you use is active.<br>
i.Prepare <br>
<br>
First you need to prepare an activated Micro SIM card and insert into Orange Pi 2G-IOTIoT, the Orange PI 2G-IOT IoT could support the following frequency:<br>
Frequency Range: 850,900,1800,1900 <br>
Standard: GSM800<br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img23.png|600px]]</div>
<br>
ii.Install SIM card<br>
Please note the direction of when inserting SIM card. <br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img25.png|600px]]</div>
<br>
iii.Login Linux system<br>
After inserting SIM card, power on and enter into Linux system. You could login the system via serial port or SSH. If you are going to use serial port to login, please be remember to set the baud rate into 921600.<br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img26.png|600px]]</div>
<br>
iv.SMS Usage<br>
a.With Serial Port<br>
<br>
You need to install the tool of minicom on Orange Pi 2G-IOT IoT before using SMS. Please make sure the board has already connect to wifi.<br>
You could install minicom with the following command:<br>
<div style="padding-left:40px;"><span style="background:#fffaa5;">sudo apt-get install minico</span></div>
After input the command, you will enter the configure interface, select "'''Serial port setup'''"<br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img27.png|600px]]</div>
<br>
Push A to modify Serial Device into /'''dev/modem0'''<br>
<br>
<div style="padding-left:100px; ">[[File:Orange-pi-2g-iot-img28.png|600px]]</div>
<br>
'''Use AT command to send message'''<br>
<div>[[File:Orange-pi-2g-iot-img36.png|600px]]</div>
<br>
Detail steps you could refer to the following: “'''OrangePi_2G_IOT_GSM_DemoOrangePi_2G_IoT_GSM_Demo.c'''”<br>
Here is the reflect of running C:<br>
<br>
<div>[[File:Orange-pi-2g-iot-img39.png|600px]]</div>
<br>
Finally you will receive the message from OrangePi 2G-IOTIoT<br>
<br>
<div>[[File:Orange-pi-2g-iot-img40.png|300px]]</div>
<br>
* OrangePi_2G_IOT_GSM_DemoOrangePi_2G_IoT_GSM_Demo.c
<br>
<div style="background:#fbfaf8;padding:20px;">
<nowiki>/*</nowiki><br>
<nowiki>* OrangePi 2G-IOT IoT GSM Demo</nowiki><br>
<nowiki>*  (C) Copyright 2017 OrangePi</nowiki><br>
<nowiki>*/</nowiki><br>
    serial_init(fd);<br>
<br>
    printf("************************************************\n");<br>    printf("\tWelcome to OrangePi 2G-IOTIoT\n");<br>
    printf("\tModem version %s\n", VERSION);<br>
    printf("************************************************\n");<br>
    printf("Entry your select:\n");<br>
    printf("1. Send Message\n");<br>
</div>
<br>
* '''OrangePi 2G-IOT Linux distribution Call'''<br>Currently, the official OrangePi 2G-IOT Linux distribution version supports Ubuntu, Debian and Raspbian, these new versions already support the phone call function, developers please go to the official website (http://www.orangepi.cn/downloadresourcescn/) to download the latest Linux distribution version mirror.Before using the call feature, prepare a Mobile or Unicom SIM card and make sure the activation is available.<br><br>* SMS previous preparation<br>Prepare a China Unicom or mobile SIM card, and foreign developers can choose the corresponding user SIM card according to the frequency band. The frequency band supported by OrangePi 2G-IOT is as follows:<br><br> After the SIM card is ready, install it in the OrangePi 2G-IOT card slot, noting that the OrangePi 2G-IOT SIM card slot supports the Nano-type card.<br><br><div>[[File:Orange-pi-2g-iot-img23.png|500px|]]</div><br>Install the SIM card, note the direction of insertion, the SIM card missing angle direction on the outside<br><br><div>[[File:Orange-pi-2g-iot-img25.png|500px|]]</div><br>insert earphones <br><br><div>[[File:Orange-pi-2g-iot-img43.png|500px|]]</div><br>* '''Login Linux'''After the card is inserted, the Linux system is activated. Users can connect to the system in a variety of ways, including serial port mode connection, ssh mode connection, etc.Refer to the official OrangePi 2G-IOT user manual for specific connection methods.If you connect with a serial port mode, please set the port rate to 921600.<br><br><div>[[File:Orange-pi-2g-iot-img26.png|400px|]]</div><br>* '''Multiple ways to call calls'''The Linux distribution of OrangePi 2G-IOT has many ways to use phone calls, and this article focuses on serial ports and C programs.<br><br>'''1. Serial port mode'''<br>This method requires installing the serial port tool minicom on OrangePi 2G-IOT. Developers can install it on OrangePi 2G-IOT. Make sure that OrangePi 2G-IOT is already connected to the wifi.The developer installed the minicom using the following command:<br><div style="padding-left:40px;"><span style="background:#fffaa5;">sudo apt-get install minicom</span></div>In the OrangePi, the AP core and the Modem communicate through the serial port, and after the Linux system is started, the modem0 node is generated in the / dev / directory.<br>Developers can use the serial port tools to connect to the / dev / modem0 node.Using minicom is recommended for connection, and developers can also refer to using other serial port tools.<br>When connecting using minicom or other serial tools, refer to the steps:<br>1) Use the minicom connection / dev / modem0 on the OrangePi 2G-IOT Linux system, which users can configure using the following commands<br>sudo minicmo -s<br>After entering the command, enter the configuration interface, as shown in the figure below, and select "Serial port setup"<br><br><div>[[File:Orange-pi-2g-iot-img27.png|400px|]]</div><br>Press "A" to modify the Serial Device to / dev / modem0<br><br><div>[[File:Orange-pi-2g-iot-img28.png|500px|]]</div><br>2) Use the AT instruction set to send text messages<br>First enter the AT command to check the Modem status. If the Modem replies to OK, the Modem connection is normal.<div>[[File:Orange-pi-2g-iot-img29.png|500px|]]</div><br>Then use the "AT DT" command to call, and then closely follow the called phone number, and add the country number to the phone number, China is + 86.<br>After entering the phone number, end with ";", such as AT DT "+ 86135xxxxxxx;"<div>[[File:Orange-pi-2g-iot-img45.png|500px|]]</div><br>This is a complete call process.<br><br>2.C language way<br>The call process in the C code is just like the process of the AT terminals, using serial ports and Modem for communication, and then exchanging the AT commands.The specific process is as follows:<br>First, initialize the serial port:<br><br><div>[[File:Orange-pi-2g-iot-img34.png|500px|]]</div><br>Send an AT command function<br><br><div>[[File:Orange-pi-2g-iot-img35.png|500px|]]</div><br>See appendix "OrangePi_2G_IOT_GSM_Demo.c" for the complete procedure<br>C The code running effect is shown as follows:<br><br><div>[[File:Orange-pi-2g-iot-img38.png|500px|]]</div><br>* OrangePi_2G_IOT_GSM_Demo.cRefer to the previous section for the Demo procedures.<br><br>* '''OrangePi 2G-IOT Linux distribution of GSM online'''Currently, the official OrangePi 2G-IOT Linux distribution supports Ubuntu, Debian and Raspbian, these new versions already support GSM Internet function, developers please go to the official website:(http://www.orangepi.cn/downloadresourcescn/)<br>Download the latest, Linux, Release Mirror.Before using the GSM Internet function, prepare a mobile or Unicom SIM card and make sure the activation is available.<br>* SMS previous preparationPrepare a China Unicom or mobile SIM card, and foreign developers can choose the corresponding user SIM card according to the frequency band. The frequency band supported by OrangePi 2G-IOT is as follows:<br><br>After the SIM card is ready, install it in the OrangePi 2G-IOT card slot, noting that the OrangePi 2G-IOT SIM card slot supports the Nano-type card.<br><br><div>[[File:Orange-pi-2g-iot-img23.png|500px|]]</div><br>Install the SIM card, note the direction of insertion, the SIM card missing angle direction on the outside<br><br><div>[[File:Orange-pi-2g-iot-img25.png|500px|]]</div><br>* Login LinuxAfter the card is inserted, the Linux system is activated. Users can connect to the system in a variety of ways, including serial port mode connection, ssh mode connection, etc.Refer to the official OrangePi 2G-IOT user manual for specific connection methods.If you connect by serial port, set the port rate to 921600.<br><br><div>[[File:Orange-pi-2g-iot-img26.png|500px|]]</div><br>* Use open-source tools to dial up onlineOrangePi 2G-IOT currently supports ppp Internet access, which is based on two open source tools, ppp and wvdial.Developers can first install these two open-source tools on OrangePi 2G-IOT, using the following command:<br>sudo apt-get install ppp wvdial* Configure the wvdialAfter installation, configure the wvdial tool and modify the / etc/wvdial.conf file as follows<div style="background:#fbfaf8;padding:20px;">[Dialer defaults]<br>ISDN = 0<br>Modem Type = Analog Modem<br><nowiki>Phone = *99***1#</nowiki><br>Stupid Mode = 1<br>Dial Command = ATDT<br>Modem = /dev/modem0<br>Baud = 460800<br>Init1 = AT+COPS=0<br>Init2 = AT+CFUN=1<br>Init3 = AT+CGATT=1<br>Init4 = AT+CGDCONT=1,"IP","OrangePi_2G-IOT","",0,0<br>Init5 = AT+CGACT=1,1<br>Username = " "<br>Password = " "<br></div>* Configure the ppp toolAfter installing the ppp, configure the ppp and modify the / etc / ppp / peers / wvdial file as follows:<div style="background:#fbfaf8;padding:20px;">noauth<br>name wvdial<br>defaultroute<br>replacedefaultroute</div>* Dial up internet accessAfter configured ppp and wvdial, use the command to dial up online, developers can use the following command:<br>wvdial Tom &<div>[[File:Orange-pi-2g-iot-img49.png|500px|]]</div><br>Use the ifconfig to view the network information<br><br><div>[[File:Orange-pi-2g-iot-img50.png|500px|]]</div><br>Test the connectivity states using the ping command<br><br><div>[[File:Orange-pi-2g-iot-img51.png|500px|]]</div><br>The open source project WiringPi is working on OrangePi 2G-IOTIoT. This section will introduce how to utilize WiringPi on OrangePi 2G-IOTIoT. The following is definition of 40pin.<br>
<br>
<div>[[File:Orange-pi-2g-iot-img17.png|500px|]]</div>
Usage:<br>
<br>
1)Download WiringPi image of OrangePi 2G-IOTIoT<br>
<br>
env GIT_SSL_NO_VERIFY=true git clone https://github.com/OrangePiLibra/WiringPi.git<br>
<br>
cd WiringPi<br>
sudo ./build OrangePi_2G-IOTIoT<br>
sudo ./build install<br>
<br>
<br>
Reality Test<br>
OrangePi 2G-IOT IoT contains GPIOA, GPIOB, GPIOC and GPIOD. Each of group has 32 gpio. The type of GPIO is "Input", "Output" and "specify function" such as "I2C", "I2S" and so on. On board, OrangePi 2G-IOT IoT exports 40 pins as different function. User can utilize these, GPIO on different application scenarios. For example, User can configure the type of GPIO as "Input", and get current voltage from program. Another hand, User can configure GPIO as specify function, such as "Uart", "I2C" and "SPI".<br>
<br>
<div>[[File:Orange-pi-2g-iot-img54.png|500px|]]</div>
<br>
Please note that: On OrangePi 2G-IOTIoT, GPIOA, GPIOB and GPIOD tract as general GPIO, but GPIOC as non-general GPIO. Because of some hardware design. The host of GPIOC is modem not CPU. So, If CPU wanna control GPIOC, it must send message to Modem, and Moden get message and control GPIOC, it's not good news. In other words. on version 0.1, GPIOC only support "OUTPUT" mode. <br>
The size of GPIOx group is 32, so we can get gpio map:<br>
GPIOA: 0   -  31<br>
<div>[[File:Orange-pi-2g-iot-img56.png|500px|]]</div>
<br>
 
=== '''Use GSM to Connect Network''' ===
<br>
Orange Pi 2G-IOT IoT Linux Dist has debugged to connect network via GSM. You could first download Linux Dist from official website, Debian, Ubuntu and Raspbian could support GSM function.<br>First you need to prepare an activated Micro SIM card, the Orange PI 2G-IOT IoT could support the following frequency:<br>
Frequency Range: 850,900,1800,1900 <br>
Standard: GSM800<br>
<div>[[File:Orange-pi-2g-iot-img57.png|500px|]]</div>
<br>
Download Linux Dist from official website: <br>http://www.orangepi.org/downloadresourceshtml/hardWare/computerAndMicrocontrollers/service-and-support/<div>[[File:Orange-piPi-2g2G-iot-img58IoT.png|600px|]]html</divbr>
<br>
Download and write image into SD card, then insert SD card and SIM card into the board.
<div>[[File:Orange-pi-2g-iot-img61.png|600px|]]</div>
<br>
 
== '''Source Code Compilation of Android and Linux ''' ==
<br>
Hardware: Orange Pi development board*1, Card reader*1, TF card*1, power supply*1
<div style="padding-left:200px;">[[File:Orange-pi-2g-iot-img5.png|500px]]</div>
<br>
 Software: Linux host computer, which hard disk space at least 50G (to meet a fully compiled need)<br>
* After confirmed it is version 1.6, you could use the following command:
java -version
<div style="padding-left:200px;">[[File:Orange-pi-i96-img36.png|800px]]</div>
<br>
=== '''Install Platform Supported Software''' ===
=== '''Download the Source Package and Unzip it''' ===
<br>
Download website: <br>http://www.orangepi.org/downloadresourceshtml/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-2G-IoT.html<br>
Downloaded source package and use the following command:<br>
 $cat OrangePi_2G-IOTIoT* > tar.tar.gz<br>
 $ tar –xvzf tar.tar.gz<br>
<br>
Unzip the file you will get the trunk directory, enter it via the terminal.<br>
<br>
 
=== '''Android source code compiler''' ===
<br>
=== '''Compile Linux source Code''' ===
<br>
 Linux source code of Orange Pi 2G-IOT IoT has been updated to github, you could download from github. Compile Linux would require you work under Linux environment. We would recommend you use Ubuntu 16.04 of Linux PC.<br>
* Download Linux source code
 You could download Linux source code from github:<br>
  ./Build_OrangePi.sh<br>
Input root password:
<div style="padding-left:200px;">[[File:Orange-pi-i96-img37.png|600px]]</div>
<br>
After root password recognize successful, enter inter main interface and use Enter key.
<div style="padding-left:200px;">[[File:Orange-pi-i96-img38.png|600px]]</div>
<br>
Select “Build system with kernel/uboot/rootfs” on main functional interface and use Enter key.
<div style="padding-left:200px;">[[File:Orange-pi-i96-img39.png|600px]]</div>
<br>
And then select “OrangePi 2G-IOT” IoT” with Enter key to update source code.<div style="padding-left:200px;">[[File:Orange-pi-i96-img40.png|600px]]</div>
<br>
 It would take around 40minutes to update source code and corresponding scripts. After updated the source code, there will be generated a directory of OrangePi_i96. This directory contains both Linux source code and scripts:
<div style="padding-left:200px;">[[File:Orange-pi-i96-img41.png|600px]]</div>
<br>
* Compile Linux
<br>
Execute the following command after enter into directory of OrangePiRDA: ./build.sh<br>
 The script is is an automatic script, you could select a corresponding board which you want to compile, here is “OrangePi 2G-IOT”IoT”.<div style="padding-left:200px;">[[File:Orange-pi-i96-img42.png|600px]]</div>
<br>
 If it is the first time you run the script, the system would install development tool automatic to make sure the network is connecting.
<div style="padding-left:200px;">[[File:Orange-pi-i96-img43.png|600px]]</div>
<br>
After installed tool, enter root password and use Enter key.
<div style="padding-left:200px;">[[File:Orange-pi-i96-img44.png|600px]]</div>
<br>
You will enter into the main interface after entering password, select what you are going to do:
<div style="padding-left:200px;">[[File:Orange-pi-i96-img45.png|600px]]</div>
<br>
This version is only support the above three options. After selecting the corresponding option, the system would compile automatically.
<div style="padding-left:200px;">[[File:Orange-pi-i96-img46.png|600px]]</div>
<br>
There will be prompt the location of kernel image and module after compilation.
<div style="padding-left:200px;">[[File:Orange-pi-i96-img47.png|600px]]</div>
<br>
* Update Linux Kernel and module
After all above steps, kernel and module update have been finished.<br>
You could insert SD card into Orange pi, and make the jumper like the following, after booting, it would enter into Linux.
<div style="padding-left:200px;">[[File:Orange-pi-2g-iot-img62.png|200px]]</div>
<br>
 
== '''Orange Pi Driver development''' ==
<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-2g-iot-img5.png|600px]]</div>
<br>
=== '''Device driver and application programming''' ===
Update the new generated module file into Linux system.<br>
It will show on *cd<br>
/trunk/out/target/product/slt-NollecA9V2VV8810P_ext4/obj/KERNEL/out<br>/target/product/slt-NollecA9V2VV8810P_ext4/obj<br>/KERNEL/modules/lib/modules/<br>3.10.62-rel5.0.2/ generated corresponding .ko file, <br>it is the module <br> that generated after OrangePi_misc.c compilation.<br>
<br>
Insert U disk (please note the SD card should have written image) if the SD card is mounted to the directory system of /dev/sdc, then SD card will mount to rootfs, which is /dev/sdc7, and mounted to rootfs partition automatic.
<br>
Copy the directory file:<br>
/trunk/out/target/product/slt-NollecA9V2VV8810P_ext4<br>/obj/KERNEL/out/target/product/slt-NollecA9V2VV8810P_ext4/<br>obj/KERNEL/modules/lib/modules/3.10.62-rel5.0.2/
into:<br>
/media/*/lib/modules/
<br>
Hardware: Orange Pi development board*1, Card reader*1, TF card*1, power supply*1, TTL to USB cable*1
<div style="padding-left:200px;">[[File:Orange-pi-2g-iot-img5.png|500px]]</div>
<br>
'''TTL to USB cable'''
<div style="padding-left:200px;">[[File:Orange-pi-i96-img67.png|500px]]</div>
<br>
=== '''Operations on Windows''' ===
* Open it after installed, shown as below:
<br>
<div style="padding-left:200px;">[[File:Orange-pi-i96-img73.png|600px]]</div>
<br>
'''3)Connect method'''<br>
Use the TTL to the serial port cable, one end connected to OrangePi, the other end connected to PC
<br>
<div style="padding-left:200px;">[[File:Orange-pi-2g-iot-img63.png|500px]]</div>
<br>
'''4)Equipment information acquisition'''
<br>
* Select control panel on Start menu
<div style="padding-left:200px;">[[File:Orange-pi-i96-img75.png|400px]]</div>
<br>
<div style="padding-left:200px;">[[File:Orange-pi-i96-img76.png|600px]]</div>
<br>
* Click on the device manager to check the port number
<div style="padding-left:200px;">[[File:Orange-pi-i96-img77.png|400px]]</div><div style="padding-left:200px;">[[File:Orange-pi-i96-img78.png|400px]]</div>
<br>
'''5)Putty configuration'''
<div style="padding-left:200px;">[[File:Orange-pi-i96-img79.png|400px]]</div>
<br>
Serial port should set to the corresponding port number (COM5), the speed should set to 115200<br>
'''6)Start debug'''<br>
Power Orange Pi on and boot it, the serial port will automatic print out debug log.
<div style="padding-left:100px; ">[[File:Orange-pi-i96-img80.png|600px]]</div>
<br>
set window 5
</div>
<div style="padding-left:200px;">[[File:Orange-pi-i96-img83.png|600px]]</div>
<br>
'''2)Connect method for debug'''
<br>
 Use the TTL to the serial port cable, one end connected to OrangePi, the other end connected to PC
<br>
<div>[[File:Orange-pi-2g-iot-img64.png|300px]]</div>
<br>
'''3)Equipment information acquisition'''<br>
<br>
$ ls /dev/ (Input command in the PC terminal to check the device number of TTL to the serial cable)
<div style="padding-left:100px;">[[File:Orange-pi-i96-img85.png|800px]]</div>
<br>
* It can be seen from the figure that TTL to the serial port cable is identified as ttyUSB0, configure the /ect/kermit/kermitc file, update the serial port information.<br>
 $ sudo vi /etc/kermit/kermitc
* Set the value of setline into /dev/ttyUSB0
<div style="padding-left:100px;">[[File:Orange-pi-i96-img86.png|800px]]</div>
<br>
'''4)Start debug'''
* Input command in the host computer terminal, enter the Kermit mode:
 $ sudo kermit –c
<div style="padding-left:100px;">[[File:Orange-pi-i96-img87img86.png|800px]]</div>
<br>
* Power it on and boot Orange Pi, the serial port will automatic print debug log, the account and password ard root/orangepi and orangepi/orangepi
<br>
<div>[[File:Orange-pi-i96-img88.png|800px]]</div>
<br>
 
== '''Download the Orange Pi 2G-IoT User Manual''' ==
<br>
For more information on using the Orange Pi 2G-IoT, please see the [https://drive.google.com/open?id=1v_ecsBnlQtxE4BNQ4v1eBa_YE0fhiUkK <span style="color:red;">Orange Pi 2G-IoT User Manual</span>]. (Click to download)