Template: A7600X Cat-1/GSM/GPRS HAT User Manual

From Waveshare Wiki
Jump to: navigation, search

Features

  • Standard Raspberry Pi 40PIN GPIO extension header, supports Raspberry Pi series boards, Jetson Nano.
  • Supports protocols including TCP/IP, HTTP(s), MQTT(s), FTP(s), and SSL.
  • Supports dial-up, telephone calls, and SMS.
  • Supports LBS base station positioning, it can get the approximate position info via the mobile network.
  • TTS (Text To Speech) feature, texts in Chinese/English can be converted into spoken words.
  • Onboard USB interface, for testing AT Commands, network communication, and so on.
  • Onboard audio jack for sound recording, making telephone calls, listening to the TTS resulting speech, etc.
  • Onboard USB to UART converter, for serial debugging, or accessing the Raspberry Pi.
  • Breakout commonly used control pins of the A7600X module, make it easy to connect with hosts boards like Arduino/STM32
  • SIM card slot, supports 1.8V/3V SIM card.
  • TF card slot for storing data like files, audio data, etc.
  • 2x LED indicators, easy to monitor the operating status.
  • Onboard voltage translator, the operating voltage can be configured to 3.3V or 5V via 0Ω resistor jumper.
  • Baudrate: 300bps ~ 4Mbps (default: 115200bps).
  • Comes with online development resources and manual (examples for Raspberry Pi/Jetson Nano/Arduino/STM32).

Testing

Hardware connection

  • Prepare the following things before using the module:
4G SIM card (China Mobile, China Unicom, or Telecom card, without shutdown and GPRS enabled); 
Headset cable with microphone (optional); 
Micro SD card (optional);
micro USB cable
LTE antenna
  • When power is off, please insert the activated 4G SIM card, and TF card (optional), insert the headphone cable with microphone (optional), and then connect the USB cable to the computer.

A7600X-hardware-connect.jpg

  • Connect one end of the micro USB cable to the USB port of the PC, and the other end to the USB port of the A7600C1-Cat-1 GSM GPRS-HAT, you can see the PWR light is on, and the NET light is off.
  • Press the PWR button for about 1 second, wait for about ten seconds, and you can see that the NET light starts to flash once every second, and then the module starts to work.
  • Open the device manager and install the Windows driver file Windows Driver when using it for the first time. Please refer to the figure below:
  • Check the Device Manager of the PC, the several COM ports will be recognized::
    A7600X Cat-1 HAT CheckPort.png

PPPD dial-up Internet In Windows system

LTE Cat-1 dial-up Internet operation

  • In Windows 10, the operation is as follows:
  • Connected successfully, start speed test:www.speedtest.cn
    A7600X-Windows-Speedtest.jpg


Note:
The ideal uplink and downlink rates that Cat-1 and 2G can achieve are as follows. The actual test will be affected by network coverage and congestion:

Network Uplink Downlink
LTE Cat-1 5Mbps 10Mbps
EDGE 236.8Kbps 236.8Kbps
GPRS 85.6Kbps 85.6Kbps

Serial assistant debugging

For software settings, refer to the frame selection in the following figure:
SSCOM-TEST-Setttings.jpg

Common AT Commands

AT Command Description Return
AT AT test command OK
ATE ATE1 set echo
ATE0 close echo
OK
AT+SIMCOMATI Query module information OK
AT+IPREX Set the module hardware serial port baud rate +IPREX:
OK
AT+CRESET Reset module OK
AT+CSQ Network signal quality query, return signal value +CSQ: 25,99
OK
AT+CPIN? Query the status of the SIM card and return READY, indicating that the SIM card can be recognized normally +CPIN: READY
AT+COPS? Query the current operator, the operator information will be returned after the normal network +COPS:
OK
AT+CREG? Query network registration status +CREG:
OK
AT+CPSI? Query UE system information
AT+CNMP Network mode selection command:
2: Automatic
13: GSM only
14: WCDMA only
38: LTE only
OK


TCP/UDP data transparent transmission

AT Command Description Return
AT+NETOPEN Start Socket Service OK
+NETOPEN: 0
AT+CIPRXGET=1 Set the Mode to Retrieve Data OK
AT+CIPOPEN=0,"TCP","118.190.93.84",2317 Establish Connection in Multi-Socket Mode +CIPOPEN: 0,0
OK
AT+CIPSEND=0,9 Send data through TCP or UDP Connection >
wavehare data OK
+CIPSEND: 0,9,9
AT+CIPCLOSE=0 Close TCP or UDP Socket +CSQ: 25,99
OK
AT+NETCLOSE Stop Socket Service OK
+NETCLOSE: 0

A7600X Cat HAT TCP.jpg

TTS text-to-speech

AT commands for TTS text-to-speech are as follows:

AT+CTTSPARAM=? //TTS parameters setting help
AT+CTTSPARAM=1,3,0,1,1 //Set TTS parameters
AT+CTTSPARAM? //Read TTS parameters
AT+CTTS=1,"6B228FCE4F7F75288BED97F3540862107CFB7EDF" //synth and play UCS2 text
AT+CTTS=2,"1234567890" //synth and play ASCII text

A7600X-Cat-TTS.png

LBS (Location Based Services)

LBS Commands:

AT+CLBS=?  //Check base station location parameters
AT+SIMEI=xxxxx //set IMEI first if no IMEI, xxxxx must correspond to the IMEI code on the module label
AT+CLBS=2 //type = 2,get detail address
AT+CLBS=1 ///type = 1,get longitude and latitude

A7600X-Cat-Hat-LBS.png

Phone Call

ATD<phone_number>;  //For example, dial 10000: ATD10000;
AT+CHUP //Hang up the call

If you think the output volume is too low, you can use the following command to adjust::

AT+COUTGAIN=?  //Adjust the volume, (0-7)
AT+COUTGAIN=7   //Set the volume to 7, return OK

SMS

Send English SMS

AT+CMGF=1 //Set the SMS mode to TEXT
AT+CMGS="phone number" //Set the receiver's mobile phone number

A7600X-Message1.jpg
Receive English SMS

AT+CMGR=20 //read the 20th information (AT+CMGL="ALL" means to read all information)

A7600X-Message2.jpg A7600X-Message3.jpg

Raspberry Pi

Hardware connection

  • Onboard Raspberry Pi 40PIN GPIO extension header, can be directly connected to the Raspberry Pi.
  • Pinout Definition:

A7600E-Cat-1-GSM-GPRS-HAT-details-inter.jpg
Note: Set the PWR on/off selection jumper: 3V3-PWR

  • Raspberry Pi serial port configuration
sudo raspi-config

Select Interfacing Options -> Serial -> no -> yes,then restart raspberry pi.
A7600C1-Cat-Hat-OpenSerial.jpg

sudo reboot

edit /boot/config.txt, add the config below at the end of the file:

enable_uart=1

Restart to take effect.

Raspberry Pi minicom serial port debugging

1. Insert the A7600X into the Raspberry Pi.
2. Install minicom:

sudo apt-get install minicom

3. Execute the command: sudo minicom -D /dev/ttyS0(ttyS0 is the UART of Raspberry Pi 3B/3B+/4B,ttyAMA0 is the UART of Raspberry Pi 2B/zero).
The baud rate is 115200 by default. If you need to change the baud rate such as 9600, you can add the parameter -b 9600.
4. Send related AT commands, as shown in the figure below:
A7600C1-Cat-Hat-piSerial-test.jpg
Note: Minicom can enter the setting mode by pressing Ctrl+a, then pressing z, and selecting X to exit.

Raspberry Pi Dial-up Internet

  • Connect the A7600X USB to the Raspberry Pi.
  • Refer to the link below for detailed operation:
  • After dialing up the Internet, if the DNS cannot be resolved and the Internet cannot be accessed, you can enter the command in the terminal:
route add -net 0.0.0.0 ppp0

Demo Code

1. Insert the module into Raspberry Pi.
2. Download the Demo to the Raspberry pi /home/pi/

cd ~
wget https://files.waveshare.com/upload/f/f3/AT7600X_Cat_Hat_Demo.7z
sudo apt-get install p7zip-full
7z x A7600X_Cat_HAT_Demo.7z   -r -o/home/pi
sudo chmod 777 -R /home/pi/A7600X_Cat_HAT_Demo
  • TCP

A7600C1-Cat-Hat-TCP-Demo.png

  • LBS

A7600C1-Cat-Hat-LBS-Demo.png

  • HTTP

A7600C1-Cat-Hat-HTTP-Demo.png

  • MQTT

A7600C1-Cat-Hat-MQTT-Demo.png

  • SSL

A7600C1-Cat-Hat-SSL-Demo.png

  • FTP

The demo code needs to set the FTP server IP address and port, user name, and password.
A7600C1-Cat-Hat-FTP-Demo.png

  • TTS

A7600C1-Cat-Hat-TTS-Demo.png

Jetson Nano

Hardware connection

Set the jumper: 3V3-PWR
A7600C1-Cat-Hat-Jetson-connect001.png

Jetson nano serial port debugging

1. Insert the A7600X into the Jetson Nano.
2. Install minicom:

sudo apt-get install minicom 

3. Type in the terminal:

sudo minicom -D /dev/ttyTHS1 -b 115200

A7600C1-Cat-Hat-Jetson-Serial.png
Note: Minicom can enter the setting mode by pressing Ctrl+a, then press z, and select X to exit.

Jetson Nano PPPD Dial-up Internet

Set the jumper: 3V3-PWR
A7600C1-Cat-Hat-Jetson-ppp.jpg
PPPD Dial-up Internet

Internet test:

ping -I ppp0 www.baidu.com
route add -net 0.0.0.0 ppp0

Python Code

Install related Python library:

sudo apt-get python3-pip
sudo pip3 install pyserial
sudo apt-get install p7zip

Download the demo code into the Jetson Nano:

cd ~
wget https://files.waveshare.com/upload/f/f3/AT7600X_Cat_Hat_Demo.7z
sudo apt-get install p7zip-full
7z x A7600X_Cat_HAT_Demo.7z   -r -o./
sudo chmod 777 -R /home/pi/A7600X_Cat_HAT_Demo

Run the demo code:

sudo python TCP.py

A7600C1-Cat-Hat-Jetson-TCP-Demo.png

STM32

Hardware Connection

  • STM32 Board: STM32F103ZET6
  • STM32 UART2 is connected to A7600X UART.
    STM32 UART1 is connected to PC.

Demo Code

A7600C1-Cat-Hat-STM32-code.png
Download: STM32 demo code
A7600C1-Cat-Hat-STM32-backMessage.png