====== 5G Module Usage====== ===== Introduction ===== This page will introduce the usage of [[https://www.khadas.com/product-page/5g-nr-module | RM500Q 5G NR module]].You will learn how to use the 5G module on Khadas SBC. AT command node is ''/dev/ttyUSB2''. ===== Preparation ===== * Disconnect the Khadas SBC power port cable. * Insert the 5G module board into the M.2 slot on [[https://www.khadas.com/product-page/m2x-wwan-extension | M2X WWAN Extension]] board. * Insert the M2X WWAN Extension board into the SBC. * Insert a valid ''Nano SIM'' card on the 5G module. === Setup 5G Module === Setting to ''pcie'' mode. ```shell echo -e "AT+qcfg=\"data_interface\",1,0\r\n" > /dev/ttyUSB2 ``` 5G module needs power down and restart to switch mode. Unplug your SBC and plug again. 5G module now works in ''pcie'' mode. How to restore your 5G module to usb mode? ``` echo -e "AT+qcfg=\"data_interface\",0,0\r\n" > /dev/ttyUSB2 ``` Unplug your SBC and plug again to switch back to usb mode. ===== Linux ===== ==== Upgrade System ==== You need to [[products:sbc:common:configurations:upgrade-system|]] to latest version. === Enable PCIe Port (VIM3 Only) === If you use the VIM3 board, you need to enable the PCIe function. Khadas VIM3 PCIe/USB3.0 share one data port,and the default mode is USB 3.0.So when we need to use 5G module, we need to switch it to PCIe port. ```shell $ echo 1 > /sys/class/mcu/usb_pcie_switch_mode $ sudo reboot ``` ''Reboot'' the system to bring changes into effect. ==== Disable ModemManager ==== As the ModemManager doesn't support this 5G modem, so you have to disable it and use Quectel QConnectManager to connect to the internet. ```shell $ sudo systemctl stop ModemManager.service $ sudo systemctl disable ModemManager.service ``` ==== Setup Quectel QConnectManager ==== You need to use ''Quectel QConnectManager'' to connect to the internet. === Get Source Code === ```shell $ git clone https://github.com/numbqq/quectel-CM.git ``` === Compile the Source Code === ```shell $ cd quectel-CM $ make ``` ==== Configure the Network ==== === Connect to Internet === Execute the command below to connect to internet. ```shell $ sudo ./quectel-CM & ``` === Check the Network Node === ```shell $ ifconfig rmnet_mhi0.1 rmnet_mhi0.1 Link encap:UNSPEC  HWaddr 02-50-F4-00-00-00-00-00-00-00-00-00-00-00-00-00             inet addr:10.129.59.93  Mask:255.255.255.252           inet6 addr: fe80::50:f4ff:fe00:0/64 Scope:Link           UP RUNNING NOARP  MTU:1500  Metric:1           RX packets:1089360 errors:0 dropped:0 overruns:0 frame:0           TX packets:176581 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:1521449058 (1.4 GiB)  TX bytes:57525792 (54.8 MiB) ``` If you can see the IP address ''inet addr'' mean the network is fine. === Setup DNS === You also need to setup the DNS. ```shell $ echo "nameserver 1.0.0.1" | sudo tee /etc/resolv.conf ``` ==== Check Network ==== ```shell $ ping -I rmnet_mhi0.1 khadas.com ``` ==== Check Whether use 5G Network ==== ===== Andoid ===== It will support automaticly.