PE100A - ASUS-IPC/ASUS-IPC GitHub Wiki

1. PE100A - Yocto 2.5

1.1 Build image

1.1.1 Flash image

  • ASUS PE100A - Yocto 2.5 BSP flash image SOP
  1. Getting an image

    1. Get Yocto-2.5 pre-release image from ASUS contact window

    2. Build an image from source code:

      Please refer to "PE100A Yocto-2.5 BSP build SOP" for instructions

    • Note:

      • If you build from build.sh, then you can find bootloader, raw image, and flash boot in Image-imx8mq-pe100a_DEBUG folder.

      • If you build from manual command, you can find image and tool in below folder:

        1. Bootloader:

          build_imx8mq-pe100a/tmp/deploy/images/imx8mq-pe100a/imx-boot-imx8mq-pe100a-4G.bin-flash_evk
          
        2. Raw Image:

          build_imx8mq-pe100a/tmp/deploy/images/imx8mq-pe100a/ fsl-image-qt5-validation-imx-imx8mq-pe100a.sdcard.bz2
          
        3. flash tool:

          sources/meta-asus-local/tools/flash_tool/*
          

          Please copy all of them to another folder and rename
           

  2. Flash image to eMMC

  • Case 1. Device without an OS image (Open Box)

    Although PE100A is shipped without any OS by default, it enters into fastboot mode when it’s booted up.

    Flash image:

    1. Power the device with an adaptor.

    2. The device will stay in fastboot mode as shown below.

      image

    3. Connect the device and host computer (PC or NB) with USB Type-C® cable.

    4. Enter image folder and double click flashall.cmd (Windows) / flashall.sh (Linux) to start image flashing.

      image

      If you use Ubuntu and flashall.sh to download image, your Ubuntu server may encounter this problem:

      error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
      
    5. The device will reboot to Yocto OS automatically once the process is completed.

      image

 

  • Case 2. Flash an image in fastboot mode

    Use “reboot-bootloader” command to make device enter fastboot mode so then the OS image can be flashed directly.

    Flash image:

    1. Power the device with an adaptor, and wait for the device to boot into Debian OS.

    2. Open a terminal windows and enter reboot-bootloader command

      image

    3. The device will stay in fastboot mode

      image

    4. Connect the device and host computer (PC or NB) with USB Type-C® cable.

    5. Enter image folder and double click flashall.cmd (Windows) / flashall.sh (Linux) to start image flashing.

      image

      If you use Ubuntu and flashall.sh to download image, your Ubuntu server may encounter this problem:

      error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
      

 

  • Case 3. Flash an image in serial download mode (For unbricking)

    If device is in brick state or is with an empty eMMC, we can use “serial download mode” to flash an image.

    Flash image

    1. Toggle boot_mode switch to “Serial downloader” + “eMMC boot ”

      DIP 1 2 3 4
      ON/OFF OFF ON OFF ON

      image

      image

    2. Power the device with an adapter.

    3. Connect the device and host computer (PC or NB) with USB Type-C® cable

    4. Enter image folder and double click flashall.cmd (Windows) / flashall.sh (Linux) to start image flashing.

      image

      If you use Ubuntu and flashall.sh to download image, your Ubuntu server may encounter this problem:

      error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
      
    5. Remove the power adapter and toggle boot mode switch to “Internal boot” + “eMMC boot”

      DIP 1 2 3 4
      ON/OFF ON OFF OFF ON

      image

    6. The device will reboot to Debian OS automatically once the process is completed.

      image

 

1.1.2 Build image SOP

  • ASUS PE100A - Yocto 2.5 BSP build SOP
  1. Create an Ubuntu machine environment

    Using one of the following versions is recommended: 20.04

  2. Download Yocto source code from github (https://github.com/ASUS-IPC/manifest)

    $ git config --global user.name "Your Name"
    $ git config --global user.email "Your Email"
    
    $ mkdir ~/bin (this step may not be needed if the bin folder already exists)
    
    $ curl https://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    $ chmod a+x ~/bin/repo
    $ export PATH=~/bin:$PATH
    $ mkdir ~/asus-yocto-sumo
    $ cd ~/asus-yocto-sumo
    
    $ repo init -u https://github.com/ASUS-IPC/manifest.git -m $manifest_name
    

    ex. for asus-pe100a-4.14.98-1.0.15.xml

    $ repo init -u https://github.com/ASUS-IPC/manifest.git -m asus-pe100a-4.14.98-1.0.15.xml
    $ repo sync -j4
    
  3. Setup Docker

    • Uninstall old versions

      $ sudo apt-get remove docker docker-engine docker.io containerd runc
      
    • Install Docker Engine - Community

      $ sudo apt-get update
      $ sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
      $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
      $ sudo apt-key fingerprint 0EBFCD88
      $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
      $ sudo apt-get update
      $ sudo apt-get install docker-ce docker-ce-cli containerd.io
      $ sudo docker run hello-world
      

      https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/

    • Manage Docker as a non-root user

      If you don’t want to preface the docker command with sudo, create a Unix group called docker and add users to it.

      $ sudo groupadd docker
      $ sudo usermod -aG docker $USER
      $ sudo reboot
        
      $ docker run hello-world
      

      https://docs.docker.com/install/linux/linux-postinstall/

  4. Docker build:

    • Go to to the directory where the downloaded the code base is located in, and execute the script. This will take a while as it installs the necessary packages on the host and builds the Docker image.

      $ cd ~/asus-yocto-sumo
      $ ./docker_builder/docker-builder-run.sh
      
    • Once the step above is finished, you are in the shell of the newly started Docker container. You can issue the following command to build all the images for yocto. Below was sample command for ASUS PE100A, If you want to build image for other HW device, please change the MACHINE name (ex. imx8mq-pv100a for ASUS PV100A)

      $ DISTRO=fsl-imx-xwayland MACHINE=imx8mq-pe100a EULA=1 source fsl-setup-release.sh -b build_imx8mq-pe100a
      $ bitbake fsl-image-qt5-validation-imx
      
  5. After build successfully, you can find all image at below path

    Bootloader Image:

    $ build_imx8mq-pe100a/tmp/deploy/images/imx8mq-pe100a/imx-boot-imx8mq-pe100a-sd.bin
    

    Full Raw Image:

    $ build_imx8mq-pe100a/tmp/deploy/images/imx8mq-pe100a/fsl-image-qt5-validation-imx-imx8mq-pe00a.sdcard.bz2
    

 

2. PE100A - Yocto 3.2

2.1 Build image

2.1.1 Flash image

  • ASUS PE100A - Yocto 3.2 BSP flash image SOP
  1. Getting an image

    1. Get a published Yocto image from AIoT official webpage

    2. Build an image from source code:

      Please refer to "PE100A Yocto-3.2 BSP build SOP" for instructions

    • Note:

      • If you build from build.sh, then you can find bootloader, raw image, and flash boot in Image-imx8mq-pe100a_DEBUG folder.

      • If you build from manual command, you can find image and tool in below folder:

        1. Bootloader:

          build_imx8mq-pe100a/tmp/deploy/images/imx8mq-pe100a/imx-boot-imx8mq-pe100a-4G.bin-flash_evk
          
        2. Raw Image:

          build_imx8mq-pe100a/tmp/deploy/images/imx8mq-pe100a/imx-image-full-imx8mq-pe100a.wic.bz2
          
        3. flash tool:

          sources/meta-asus-local/tools/flash_tool/*
          

          Please copy all of them to another folder and rename

 

  1. Flash image to eMMC
  • Case 1. Device without an OS image (Open Box)

    Although PE100A is shipped without any OS by default, it enters into fastboot mode when it’s booted up.

    Flash image:

    1. Power the device with an adaptor.

    2. The device will stay in fastboot mode as shown below.

      image

    3. Connect the device and host computer (PC or NB) with USB Type-C® cable.

    4. Enter image folder and double click flashall.cmd (Windows) / flashall.sh (Linux) to start image flashing.

      image

      If you use Ubuntu and flashall.sh to download image, your Ubuntu server may encounter this problem:

      error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
      
    5. The device will reboot to Yocto OS automatically once the process is completed.

      image

 

  • Case 2. Flash an image in fastboot mode

    Use "reboot-bootloader" command to make device enter fastboot mode so then the OS image can be flashed directly.

    Flash image:

    1. Power the device with an adaptor, and wait for the device to boot into Debian OS.

    2. Open a terminal windows and enter reboot-bootloader command

      image

    3. The device will stay in fastboot mode

      image

    4. Connect the device and host computer (PC or NB) with USB Type-C® cable.

    5. Enter image folder and double click flashall.cmd (Windows) / flashall.sh (Linux) to start image flashing.

      If you use Ubuntu and flashall.sh to download image, your Ubuntu server may encounter this problem:

      error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
      

 

  • Case 3. Flash an image in serial download mode (For unbricking)

    If device is in brick state or is with an empty eMMC, we can use "serial download mode" to flash an image.

    Flash image

    1. Toggle boot_mode switch to “Serial downloader” + “eMMC boot ”

      DIP 1 2 3 4
      ON/OFF OFF ON OFF ON

      image

      image

    2. Power the device with an adapter.

    3. Connect the device and host computer (PC or NB) with USB Type-C® cable

    4. Enter image folder and double click flashall.cmd (Windows) / flashall.sh (Linux) to start image flashing.

      image

      If you use Ubuntu and flashall.sh to download image, your Ubuntu server may encounter this problem:

      error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
      
    5. Remove the power adapter and toggle boot mode switch to “Internal boot” + “eMMC boot”

      DIP 1 2 3 4
      ON/OFF ON OFF OFF ON

      image

    6. The device will reboot to Debian OS automatically once the process is completed.

      image

 

2.1.2 Build image SOP

  • ASUS PE100A - Yocto 3.2 BSP build SOP
  1. Create an Ubuntu machine environment

    Using one of the following versions is recommended: 20.04

  2. Download Yocto source code from github (https://github.com/ASUS-IPC/manifest)

    $ git config --global user.name "Your Name"
    $ git config --global user.email "Your Email"
    
    $ mkdir ~/bin (this step may not be needed if the bin folder already exists)
    
    $ curl https://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    $ chmod a+x ~/bin/repo
    $ export PATH=~/bin:$PATH
    $ mkdir ~/asus-yocto-3.2
    $ cd ~/asus-yocto-3.2
    
    $ repo init -u https://github.com/ASUS-IPC/manifest.git -m $manifest_name
    

    Ex. for asus-pe100a-5.10.9-1.0.5.xml

    $ repo init -u https://github.com/ASUS-IPC/manifest.git -m asus-pe100a-5.10.9-1.0.5.xml
    $ repo sync -j4
    
  3. Setup Docker

    • Uninstall old versions

      $ sudo apt-get remove docker docker-engine docker.io containerd runc
      
    • Install Docker Engine - Community

      $ sudo apt-get update
      $ sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
      $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
      $ sudo apt-key fingerprint 0EBFCD88
      $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
      $ sudo apt-get update
      $ sudo apt-get install docker-ce docker-ce-cli containerd.io
      $ sudo docker run hello-world
      

      https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/

    • Manage Docker as a non-root user

      If you don’t want to preface the docker command with sudo, create a Unix group called docker and add users to it.

      $ sudo groupadd docker
      $ sudo usermod -aG docker $USER
      $ sudo reboot
        
      $ docker run hello-world
      

      https://docs.docker.com/install/linux/linux-postinstall/

  4. Docker build:

    • Go to to the directory where the downloaded the code base is located in, and execute the script. This will take a while as it installs the necessary packages on the host and builds the Docker image.

      $ cd ~/asus-yocto-3.2
      $ ./docker_builder/docker-builder-run.sh
      
    • Once the step above is finished, you are in the shell of the newly started Docker container. You can issue the following command to build all the images for yocto. Below was sample command for ASUS PE100A.

      $ DISTRO=fsl-imx-xwayland MACHINE=imx8mq-pe100a EULA=1 source imx-setup-release.sh -b build_imx8mq-pe100a
      $ bitbake imx-image-full
      
  5. After build successfully, you can find all image at below path

    Bootloader Image:

    $ build_imx8mq-pe100a/tmp/deploy/images/imx8mq-pe100a/imx-boot-imx8mq-pe100a-4G.bin-flash_evk
    

    Full Raw Image:

    $ build_imx8mq-pe100a/tmp/deploy/images/imx8mq-pe100a/imx-image-full-imx8mq-pe100a.wic.bz2
    

 

3. PE100A - Debian 10

3.1 Flash image

  • Case 1. Flash an image in serial download mode (For unbricking)

    If device is in brick state or is with an empty eMMC, we can use “serial download mode” to flash an image.
    you can download Debian image from ASUS Website

    Flash image:

    1. Toggle boot_mode switch to “Serial downloader” + “eMMC boot ” (OFF : ON : OFF : ON) image

    2. Power the device with an adapter.

    3. Connect the device and host computer (PC or NB) with USB Type-C® cable

    4. Enter image folder and double click flashall.cmd (Windows) / flashall.sh (Linux) to start image flashing. image

      If you use Ubuntu and flashall.sh to download image, your Ubuntu server may encounter this problem:

      error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
      
    5. Remove the power adapter and toggle boot mode switch to “Internal boot” + “eMMC boot” (ON : OFF : OFF : ON)

 

  • Case 2. Flash an image in fastboot mode

    Use “reboot-bootloader” command to make device enter fastboot mode so then the OS image can be flashed directly.

    Flash image:

    1. Power the device with an adaptor, and wait for the device to boot into Debian OS.

    2. Open a terminal windows and enter “reboot-bootloader” command. image

    3. The device will stay in fastboot mode. image

    4. Connect the device and host computer (PC or NB) with USB Type-C® cable.

    5. Enter image folder and double click flashall.cmd (Windows) / flashall.sh (Linux) to start image flashing. image image

      If you use Ubuntu and flashall.sh to download image, your Ubuntu server may encounter this problem:

      error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
      
    6. The device will reboot to Debian OS automatically once the process is completed. image

 

3.2 Build image SOP

  • ASUS PE100A - Debian 10 BSP build SOP
  1. Create an Ubuntu machine environment (Using the following versions : Ubuntu 20.04.)

  2. Download Debian source code from github (https://github.com/ASUS-IPC/manifest)

     $ git config --global user.name "Your Name"
     $ git config --global user.email "Your Email"
    
    $ mkdir ~/bin (this step may not be needed if the bin folder already exists)
    
    $ curl https://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    $ chmod a+x ~/bin/repo
    $ export PATH=~/bin:$PATH
    $ mkdir ~/debian-imx_8m
    $ cd ~/ debian-imx_8m
    
    $ repo init -u https://github.com/ASUS-IPC/manifest.git -m $manifest_name
    

    Ex. for asus-debian-4.14.98.xml

    $ repo init -u https://github.com/ASUS-IPC/manifest.git -m asus-debian-4.14.98.xml
    $ repo sync -j4
    
  3. Setup Docker

    • Uninstall old versions

      $ sudo apt-get remove docker docker-engine docker.io containerd runc
      
    • Install Docker Engine – Community

      $ sudo apt-get update
      $ sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
      $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
      $ sudo apt-key fingerprint 0EBFCD88
      $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
      $ sudo apt-get update
      $ sudo apt-get install docker-ce docker-ce-cli containerd.io
      $ sudo docker run hello-world
      

      https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/

    • Manage Docker as a non-root user

      If you don’t want to preface the docker command with sudo, create a Unix group called docker and add users to it.

      $ sudo groupadd docker
      $ sudo usermod -aG docker $USER
      $ sudo reboot
      
      $ docker run hello-world
      

      https://docs.docker.com/install/linux/linux-postinstall/

  4. Docker build:

    • Go to the directory where the downloaded the code base is located in, and execute the script. This will take a while as it installs the necessary packages on the host and builds the Docker image.

      $ cd ~/debian-imx_8m
      $ ./docker_builder/docker-builder-run.sh
      
    • Once the step above is finished, you are in the shell of the newly started Docker container. You can issue the following command to build all the images for debian.

      Build from build.sh

      $VERSION=RELEASE ./build.sh
      Select “2” to build image for PE100A
      Then,
      Select “1” to build All image 
      
  5. After you build successfully, it will copy bootloader, raw image, flash tool to debian-imx_8m /Image-imx8mq-pe100a_debian folder, please reference PE100A Debian flash image SOP.pdf to flash image

 

3.3 Switching UART protocol

  • USB serial console cable, for reference

USB

  • On hardware

    image

    image

  • On Software

    1. Type “PE100A-config” in terminal to enter PE100A Software Configuration Tool.

    image

    1. Select UART option.

    image

    1. For RS232/RS422, select “1.RS232”. For RS485, select “2.RS485”.

    image

    1. Leave PE100A Software Configuration Tool than reboot device

    image

3.4 COM sample code

com_port_tool.zip

NOTE: The COM1 and COM2 nodes are /dev/ttymxc0 and /dev/ttymxc1.

 

3.5 CAN Bus sample code

Please refer to "README.pdf" first.

CAN_test_20220721.zip

 

3.6 Console debug

Please refer to the URL as below to set up PE100A

https://github.com/ASUS-IPC/ASUS-IPC/wiki/PE100A#33-switching-uart-protocol

  1. Connect PE100A to a PC with a USB serial cable

1 2 3

  1. On Software setting

    1. Type “PE100A-config” in terminal to enter PE100A Software Configuration Tool.

    image

    1. Select UART option.

    image

    1. For RS232/RS422, select “1.RS232”. For RS485, select “2.RS485”.

    image

    1. Select Serial option (item3) to enable serial kernel message.

    4

    1. Leave PE100A Software Configuration Tool than reboot device

    image

    1. Open Putty and select Serial on the PC, and the Serial line can be checked from Windows >Device Manager >Ports (COM & LPT). The speed is 115200 baud.

    5

    1. To set up the putty log file

    7

 

4. PE100A - Ubuntu Server 20.04

4.1 CAN Bus sample code

Please refer to "README.pdf" first.

CAN_test_20220721.zip

 

4.2 Modem connectivity SOP

Typing sudo apt-get update and sudo apt-get install modemmanager network-manage

Ref: https://ubuntu.com/core/docs/networkmanager/configure-cellular-connections

 

5. PE100A - Ubuntu Core 20

5.1 Modem connectivity SOP

Typing sudo snap install modem-manager network-manager

Ref: https://ubuntu.com/core/docs/networkmanager/configure-cellular-connections

 

6. LTE module function

6.1 SIM hot-plug function

  • For PE100A

  • To enable the hot-plug function of your LTE module, click the weston-terminal icon in the upper left corner of your screen, and type the first command below when prompted:

    • Enable hot-plug function
      mm_cli sim-detect 1
      
    • Disable hot-plug function
      mm_cli sim-detect 0
      
    • Display current setting
      mm_cli sim-detect 
      

 

7. ASUS IoT API for PE100A (DIO control)

 

8. PE100A - DIO SOP

8.1 Control from bash script

  • Get DI value
    Print all DI value to console. ex. Get (DI4:DI1:DI2:DI1) = (0:0:1:0)

    ./dio_test.sh in
    
  • Set DO value
    Print all DO value to console. ex Set (DO4:DO1:DO2:DO1) = (1:0:1:0)

    ./dio_test.sh out #do_val (binary format)
    ex. ./dio_test.sh out 1010
    

8.2 Control from binary tool

You can refer to the sample code to control DIO in binary tool. if you build the dio_test tool, you can use the command as below: Get DI / Set DO value
PE100A_GPIO_expander.zip

  • Get DI value
    Print all DI value to console. ex. Get (DI4:DI1:DI2:DI1) = (0:0:1:0)

    ./dio_test in
    
  • Set DO value
    Print all DO value to console. ex Set (DO4:DO1:DO2:DO1) = (1:0:1:0)

    ./dio_test.sh out #do_val (binary format)
    ex. ./dio_test out 1010
    

9. PE100A - Yocto FOTA command

  1. List the relevant commands for FOTA
/usr/bin/python3 /usr/share/AsusFota/FotaClient/ota_run.pyc -h
  1. Check for Updates
/usr/bin/python3 /usr/share/AsusFota/FotaClient/ota_run.pyc -q
  1. Download FOTA packages
/usr/bin/python3 /usr/share/AsusFota/FotaClient/ota_run.pyc -d
  1. Performing update. The system will restart after the update is complete
/usr/bin/python3 /usr/share/AsusFota/FotaClient/ota_run.pyc -u
  1. Print FOTA log
/usr/bin/python3 /usr/share/AsusFota/FotaClient/ota_run.pyc -l
  1. Set query interval days. The current options are D (Day), W (Week), or M (Month). A restart is required for the new settings to take effect.
/usr/bin/python3 /usr/share/AsusFota/FotaClient/ota_run.pyc -i [D/W/M]
  1. Set query time. The format for TIME is HH:mm. The default is empty. The automated process will only execute after this setting is configured. A restart is required for the new settings to take effect. (If TIME is set to 'print', it will display the configured time.)
/usr/bin/python3 /usr/share/AsusFota/FotaClient/ota_run.pyc -t TIME
  1. Disable FOTA functionality. Query functionality will still be available
/usr/bin/python3 /usr/share/AsusFota/FotaClient/ota_run.pyc -c
  1. Enable FOTA functionality. A restart is required to activate the client's automated process
/usr/bin/python3 /usr/share/AsusFota/FotaClient/ota_run.pyc -o
  1. Check the image version
cat /etc/devinfo/dev.conf

10. PE100A - Debian PPA update(Kernel & u-boot) command

1.On the PE100A Debian system, edit the source.list file to add the PPA URL for PE100A as the following

sudo vim /etc/apt/sources.list
deb [trusted=yes] http://ppa.launchpad.net/asus-iot/pe100a/ubuntu focal main

2.Then use the following commands to update and install the packages.

sudo apt-get update
sudo apt-get install linux-headers-4.14.98-pe100a
sudo apt-get install linux-image-4.14.98-pe100a
sudo apt-get install bootloader-pe100a