Open main menu

Wiki-Orange Pi β

Changes

Orange Pi 2G-IoT

7,442 bytes removed, 17:30, 28 June 2022
Connect to Network via GSM
}<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.c
Refer 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 preparation
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>
* 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 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 online
OrangePi 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 wvdial
After 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 tool
After 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 access
After 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-IOT. This section will introduce how to utilize WiringPi on OrangePi 2G-IOT. The following is definition of 40pin.<br>
<div>[[File:Orange-pi-2g-iot-img56.png|500px|]]</div>
<br>
 
=== '''Use GSM to Connect Network''' ===
<br>