Changes

Jump to: navigation, search

Orange Pi 2G-IoT

4,866 bytes added, 12:00, 28 June 2022
Connect to Network via GSM
</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.

Navigation menu