Personal tools

Difference between revisions of "PCI7600G LTE module setting"

From ICOP tech wiki

Jump to: navigation, search
(Created page with "=Recipe for building Yocto Linux for EBOX-IMX8MM= __FORCETOC__ <br /> '''Recipe for building Yocto Linux for EBOX-IMX8MM:''' https://ftp.icop.com.tw/share/q9dqbQS0 '''Che...")
 
Line 1: Line 1:
=Recipe for building Yocto Linux for EBOX-IMX8MM=
+
=PCI7600G SIM Driver setting=
__FORCETOC__  
+
__FORCETOC__
 
 
<br />
 
'''Recipe for building Yocto Linux for EBOX-IMX8MM:'''
 
 
 
https://ftp.icop.com.tw/share/q9dqbQS0
 
 
 
 
 
'''Check the compiling method on the open document form NXP:'''
 
 
 
https://www.nxp.com/docs/en/user-guide/IMXLXYOCTOUG.pdf
 
<br />
 
<br />
 
 
 
<big>'''Suggest O/S''':Ubuntu 18.04 or later.</big>
 
 
 
Please comment out content to the local.conf to avoid the error during building the SDL.
 
<pre>
 
#PACKAGECONFIG_append_pn-qemu-native = " sdl"
 
#PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
 
</pre><big>'''Storage:''' Please make sure the capacity of your storage has 120GB or bigger space</big>
 
<big>'''RAM:''' Please make sure the physical memory + swap has 16GB or bigger capacity.</big><br />
 
 
==<big>Procedure</big>==
 
==<big>Procedure</big>==
'''Step 1.''' Install Host packages:
+
'''Step 1.''' Installing USB serial driver
  
 
Essential Yocto Project host packages:
 
Essential Yocto Project host packages:
 
<pre>
 
<pre>
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
+
    -   < > USB Serial Converter Support --- >
build-essential chrpath socat libsdl1.2-dev
+
    -   [ ] USB Generic Serial Driver
</pre>
+
    -   < > USB driver for GSM and CDMA modems
 
i.MX layers host packages for a Ubuntu 12.04 or 14.04 host setup are:<pre>
 
$ sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html \
 
docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils \
 
libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
 
</pre>
 
  
 +
    +    <*> USB Serial Converter Support --- >
 +
    +    [*] USB Generic Serial Driver
 +
    +    <*> USB driver for GSM and CDMA modems
  
'''Step 2.''' Insalling the repo utility:
 
 
Create the bin folder in the home directory:
 
<pre>
 
$ mkdir ~/bin (this step may not be needed if the bin folder already exists)
 
$ curl <nowiki>https://storage.googleapis.com/git-repo-downloads/repo</nowiki> > ~/bin/repo
 
$ chmod a+x ~/bin/repo
 
 
</pre>
 
</pre>
 
+
 
+
Revise the content in kernel/drivers/usb/serial/option.c<pre>
'''Step 3.''' Add the following line to the .bashrc file to make sure the ~/bin folder is in the PATH.
+
    /* SIM7600 */
<pre>
+
    #define SIMCOM_SIM7600_VID 0x1E0E
export PATH=~/bin:$PATH
+
    #define SIMCOM_SIM7600_PID 0x9001
 
</pre>
 
</pre>
  
 
+
Add the content below to option-ids list<pre>
'''Step 4.''' Ensure the git is properly set up by commands below:
+
{ USB_DEVICE(SIMCOM_SIM7600_VID, SIMCOM_SIM7600_PID)}, /*SIM7600 */
<pre>
 
$ git config --global user.name "Your Name"
 
$ git config --global user.email "Your Email"
 
$ git config --list
 
 
</pre>
 
</pre>
  
 
+
 Add the content below to option_probe<pre>
'''Step 5.''' Download the i.MX Yocto Project Community BSP recipe layers:
+
    /* sim7600 */
<pre>
+
    if (serial->dev->descriptor.idVendor == SIMCOM_SIM7600_VID &&
$ mkdir imx-yocto-bsp
+
    serial->dev->descriptor.idProduct == SIMCOM_SIM7600_PID &&
$ cd imx-yocto-bsp
+
    serial->interface->cur_altsetting->desc.bInterfaceNumber == 5 )
$ repo init -u <nowiki>https://source.codeaurora.org/external/imx/imx-manifest</nowiki> -b \
+
    return -ENODEV;
imx-linux-sumo -m imx-4.14.98-2.0.0_ga.xml
 
$ repo sync
 
 
</pre>
 
</pre>
  
 +
Execute the command below and there will have 5 different devices:
  
'''Step 6.''' Unzip the Recipe for building Yocto Linux for EBOX-IMX8MM to the file ‘imx-yocto-bsp”
+
'''ttyUSB0 ttyUSB1 ttyUSB2 ttyUSB3 ttyUSB4'''<pre>
 
+
-C compile linux-imx && bitbake fsl-image-qt5-validation-imx  
 
 
'''Step 7.''' Create the setup environment by command below (You could change the file name as you want)
 
<pre>
 
$ DISTRO=fsl-imx-xwayland MACHINE=dm395b source fsl-setup-release.sh -b \
 
build-dmp
 
</pre>
 
 
 
Please input “y” when the EULA confirmation pop out.
 
 
 
 
 
'''Step 8.''' Edit conf/local.conf file and add the content below at the bottom:
 
<pre>
 
CORE_IMAGE_EXTRA_INSTALL += "chromium-ozone-wayland"
 
IMAGE_INSTALL_append += " \
 
    openssh-sftp-server \
 
    ppp \
 
    rng-tools \
 
    glibc-gconv-utf-16 \
 
    expand-rootfs \
 
"
 
</pre>
 
 
 
 
 
'''Step 9.''' Edit conf/bblayers.conf file and add the content below at the bottom:
 
<pre>
 
BBLAYERS += " ${BSPDIR}/sources/meta-custom-dmp "
 
</pre>
 
 
 
 
 
'''Step 10.''' Run the command below.
 
<pre>
 
$ bitbake fsl-image-qt5-validation-imx
 
 
</pre>
 
</pre>
  
  
The system will start to download and install source code, patch file, and compilation.
+
'''Step 2.''' Mounting the simcom.ko driver
  
=How to install the image file by UUU.=
+
# Unzip the driver zip file to /BSP/source/poke/recipe-core/
After implemented bitbake fsl-image-qt5-validation-imx, it will generate an image file and be stored in the file under build-dmp/tmp/deploy/images/dm395b.
+
# Edit BSP/source/poky/meta-poky/conf/layer.conf
 +
# Add MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += “simcom”
 +
# Execute bitbake -C compile linux-imx && bitbake fsl-image-qt5-validation-imx
 +
# After the command execute, you will see wwan0 from command ifconfig -a
  
<br />In the build-dmp/tmp/deploy/images/dm395b file, we’ll need the file below for the image restoration.
 
<pre>
 
1. fsl-mage-qt5-validation-imx-dm395b.sdcard.bz2
 
2. imx-boot-dm395b-sd.bin-flash_evk
 
</pre>
 
  
 +
'''Step 3.''' Testing PCI7600G-SIM (Will return an ok if succeed.
  
Input command to get the image file - fsl-mage-qt5-validation-imx-dm395b.sdcard
+
# Plugin PCI7600G-SIM before booting up the board.
 
+
# Open the terminal and enter minicom -d /dev/ttyUSB2.
(In this file, there are packaged kernel and rootfs):<pre>
+
# Enter at (Ensuring the AT testing command); it will return an ok if it’s working.
$ bzip2 -d fsl-mage-qt5-validation-imx-dm395b.sdcard.bz2
+
# Enter at+cpin? (Checking the status of the SIM card); it will return a “READY” if it’s working, and if return +CME ERROR: SIM not inserted means the SIM card is not plugged in.
</pre>Download the UUU.auto sample:https://ftp.icop.com.tw/share/MT0Eqdo6
+
# Enter at+csq (Checking the strength of the signal, and the antenna should be installed on the MAN of PCI_SIM); If it returns +CSQ: 0~31.99 means it’s normal, and 99.99 means it’s an error.
 
+
# Enter at+cops? (Checking the telecom)
 
+
# Enter at+cpsi? ( Checking UE system data )
 
+
# Enter at+cmgs=“+8869xxxxxxxx”(Phone number), and it will return >; enter some content like “testing” and press ctrl+z to send it out. You will receive the message on your phone.
If you have requirement to change the file name, please follow the steps below to change your file name (You could choose not changing the file name.)<pre>
+
# Using a phone and dial the number the sim card you used in PCI7600G-SIM, and if the minicom shows RING means the testing passed.
SDP: boot -f XXX.bin-flash_evk
+
# Open another terminal and enter echo “at\$qcrmcall=1,1” > /dev/ttyUSB3, and the minicom will return $QCRMCALL:1,V4
SDPU: write -f XXX.bin-flash_evk -offset 0x57c00
+
# Enter ifconfig wwan0 up
SDPS: boot -f XXX.bin-flash_evk
+
# Enter udhcpc -i wwan0
SDPV write -f XXX.bin-flash_evk -skipspl
+
# Enter ping 8.8.8.8 -c 5 to test 4G internet.
FB: flash bootloader XXX.bin-flash_evk
 
XXX.bin-flash_evk = imx-boot-dm395b-sd.bin-flash_evk 
 
 
 
FB: flash -raw2sparse all XXX.image 
 
XXX.image = fsl-mage-qt5-validation-imx-dm395b.sdcard
 
</pre>After you have set your own file name, you could input the command below to install the Yocto Linux<pre>
 
uuu uuu.auto
 
</pre>
 

Revision as of 17:26, 23 September 2021

PCI7600G SIM Driver setting

Procedure

Step 1. Installing USB serial driver

Essential Yocto Project host packages:

    -    < > USB Serial Converter Support --- >
    -    [ ] USB Generic Serial Driver
    -    < > USB driver for GSM and CDMA modems

    +    <*> USB Serial Converter Support --- >
    +    [*] USB Generic Serial Driver
    +    <*> USB driver for GSM and CDMA modems

Revise the content in kernel/drivers/usb/serial/option.c

    /* SIM7600 */
    #define SIMCOM_SIM7600_VID 0x1E0E
    #define SIMCOM_SIM7600_PID 0x9001

Add the content below to option-ids list

{ USB_DEVICE(SIMCOM_SIM7600_VID, SIMCOM_SIM7600_PID)}, /*SIM7600 */ 

 Add the content below to option_probe

    /* sim7600 */
    if (serial->dev->descriptor.idVendor == SIMCOM_SIM7600_VID && 
    serial->dev->descriptor.idProduct == SIMCOM_SIM7600_PID &&
    serial->interface->cur_altsetting->desc.bInterfaceNumber == 5 )
    return -ENODEV; 

Execute the command below and there will have 5 different devices:

ttyUSB0 ttyUSB1 ttyUSB2 ttyUSB3 ttyUSB4

-C compile linux-imx && bitbake fsl-image-qt5-validation-imx 


Step 2. Mounting the simcom.ko driver

  1. Unzip the driver zip file to /BSP/source/poke/recipe-core/
  2. Edit BSP/source/poky/meta-poky/conf/layer.conf
  3. Add MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += “simcom”
  4. Execute bitbake -C compile linux-imx && bitbake fsl-image-qt5-validation-imx
  5. After the command execute, you will see wwan0 from command ifconfig -a


Step 3. Testing PCI7600G-SIM (Will return an ok if succeed.

  1. Plugin PCI7600G-SIM before booting up the board.
  2. Open the terminal and enter minicom -d /dev/ttyUSB2.
  3. Enter at (Ensuring the AT testing command); it will return an ok if it’s working.
  4. Enter at+cpin? (Checking the status of the SIM card); it will return a “READY” if it’s working, and if return +CME ERROR: SIM not inserted means the SIM card is not plugged in.
  5. Enter at+csq (Checking the strength of the signal, and the antenna should be installed on the MAN of PCI_SIM); If it returns +CSQ: 0~31.99 means it’s normal, and 99.99 means it’s an error.
  6. Enter at+cops? (Checking the telecom)
  7. Enter at+cpsi? ( Checking UE system data )
  8. Enter at+cmgs=“+8869xxxxxxxx”(Phone number), and it will return >; enter some content like “testing” and press ctrl+z to send it out. You will receive the message on your phone.
  9. Using a phone and dial the number the sim card you used in PCI7600G-SIM, and if the minicom shows RING means the testing passed.
  10. Open another terminal and enter echo “at\$qcrmcall=1,1” > /dev/ttyUSB3, and the minicom will return $QCRMCALL:1,V4
  11. Enter ifconfig wwan0 up
  12. Enter udhcpc -i wwan0
  13. Enter ping 8.8.8.8 -c 5 to test 4G internet.