Help Center/ Atlas 300 Application (Model 3000)/ IDE-daemon-client Command Reference/ Sending a Command to the Device by Using IDE Daemon
Updated on 2022-03-13 GMT+08:00

Sending a Command to the Device by Using IDE Daemon

Function

Sends a command to the host by using IDE Daemon, such as a command for querying the date information on the host.

Syntax

IDE-daemon-client --host <host_ip>:<port> --hostcmd <command>

Parameter

Table 1 Parameter description

Parameter

Description

Mandatory or Not

Default Value

--host

  • host_ip: specifies the IP address of the host.
  • port: specifies the port number.

Yes

The default value of port is 22118.

--hostcmd

Specifies the command to be executed on the host. For details about the command list, see Command List.

Except the date command, other commands must be placed in single quotation marks or double quotation marks. If a command contains double quotation marks, put the command in single quotation marks. If the command contains single quotation marks, place the command in double quotation marks.

Yes

-

Example

  1. Log in to the server on the host as the HwHiAiUser user.
  2. Run the following command to view the date information on the host:
    IDE-daemon-client --host xx.xx.xx.xx:22118 --hostcmd date

    Replace xx.xx.xx.xx with the actual IP address of the host.

Command List

If a command has variables, replace the variables such as xxxx or yy with the actual directory name or file name.

In the commands, ~ indicates the home directory of the user who starts the IDE-daemon-host or IDE-daemon-device process.

Category

Command

Remarks

Command without variables

pkill cce-gdbserver

-

ide_cmd.sh --reboot

The sudo command is used to escalate the user's operation permission.

The actually executed command is reboot mini.

Used to restart the developer board.

date

-

mkdir -p /tmp/profiler-tools/

-

rm /opt/mini/mini_developerKit*.rar

-

chmod +x /opt/mini/minirc_install_phase1.sh

-

chmod +w ~/ide_daemon/rollback_idedaemon_crt.sh

-

chmod +w ~/ide_daemon/backup_idedaemon_crt.sh

-

/opt/mini/minirc_install_phase1.sh

-

tar -xvf ~/host/EVB.tar -C ~/host/

-

rm -rf /var/dlog/*

-

rm -rf ~/host

-

mkdir -p ~/host

-

rm -rf ~/HIAI_PROJECTS/dlog.tar

-

tar -cPf ~/HIAI_PROJECTS/dlog.tar /var/dlog/

-

grep -rn "firmware upgrade finish, start to reboot" /var/davinci/log

-

grep -rn "fail" /var/davinci/log/firmware_upgrade_progress.log

-

python -c \"import future;import sys;sys.exit(future.__version__ < 0.15)\"

Checks the version number of the future library on the host.

The actually executed command is as follows:

python -c "import future;import sys;sys.exit(future.__version__ < 0.15)"

python -c \"import numpy;import sys;sys.exit(numpy.__version__ < 1.14)\"

Checks the version number of the numpy library on the host.

The actually executed command is as follows:

python -c "import numpy;import sys;sys.exit(numpy.__version__ < 1.14)"

"python -c \"\n"\"import enum\n"\"import sys\n"\"try:\n"\" if enum.__version__ >= 0.4:\n"\" sys.exit(0)\n"\"except AttributeError:\n"\" if enum.version >= 1.0:\n"\" sys.exit(0)\n"\"\""

Checks the version number of the enum library or enum34 library on the host.

The actually executed command is as follows:

python -c \"

import enum

import sys

try:

if enum.__version__ >= 0.4:

sys.exit(0)

except AttributeError:

if enum.version >= 1.0:

sys.exit(0)

\"

cat /etc/sys_version.conf

Obtains the Ascend 310 software version of the developer board.

Command with variables

rm -rf ~/hdcd; rm -rf ~/HIAI_PROJECTS/xxxx; rm -rf ~/HIAI_DATANDMODELSET/xxxx; rm -rf ~/profiler-app/xxxx; rm -rf ~/ide_daemon/xxxx

-

rm ~/HIAI_PROJECTS/xxxx; rm ~/HIAI_DATANDMODELSET/xxxx; rm ~/profiler-app/xxxx; rm ~/ide_daemon/xxxx

-

wc -l ~/hdcd/xxxx; wc -l ~/HIAI_PROJECTS/xxxx; wc -l ~/HIAI_DATANDMODELSET/xxxx; wc -l ~/profiler-app/xxxx

-

mkdir -p ~/hdcd/xxxx; mkdir -p ~/HIAI_PROJECTS/xxxx; mkdir -p ~/HIAI_DATANDMODELSET/xxxx; mkdir -p ~/profiler-app/xxxx; mkdir -p ~/ide_daemon/xxxx

Runs an executable file.

mkdir ~/HIAI_PROJECTS/xxxx; mkdir ~/HIAI_DATANDMODELSET/xxxx; mkdir ~/profiler-app/xxxx; mkdir ~/ide_daemon/xxxx

-

tar -cf ~/hdcd/xxxx/yy.tar -C ~/HIAI_PROJECTS/xxxx xxxx; tar -cf ~/HIAI_PROJECTS/xxxx/yy.tar -C ~/HIAI_PROJECTS/xxxx xxxx; tar -cf ~/HIAI_DATANDMODELSET/xxxx/yy.tar -C ~/HIAI_DATANDMODELSET/xxxx xxxx; tar -cf ~/profiler-app/xxxx/yy.tar -C ~/profiler-app/xxxx xxxx

Compress the directories and files specified by -C into packages specified by -cf.

Change xxxx to the actual directory name and yy to the actual .tar package name.

tar -xvf ~/hdcd/xxxx/yy.tar -C ~/HIAI_PROJECTS/xxxx; tar -xvf ~/HIAI_PROJECTS/xxxx/yy.tar -C ~/HIAI_PROJECTS/xxxx; tar -xvf ~/HIAI_DATANDMODELSET/xxxx/yy.tar -C ~/HIAI_DATANDMODELSET/xxxx;

tar -xvf ~/profiler-app/xxxx/yy.tar -C ~/profiler-app/xxxx

-

mv ~/hdcd/xxxx ~/HIAI_PROJECTS/xxxx; mv ~/HIAI_PROJECTS/xxxx ~/HIAI_PROJECTS/xxxx; mv ~/profiler-app/xxxx ~/profiler-app/xxxx

-

chmod +x ~/hdcd/xxxx; chmod +x ~/HIAI_PROJECTS/xxxx; chmod +x ~/profiler-app/xxxx; chmod +x ~/ide_daemon/xxxx

-

chmod -w ~/hdcd/xxxx; chmod -w ~/ide_daemon/xxxx

-

cp ~/HIAI_PROJECTS/xxxx ~/HIAI_PROJECTS/xxxx; cp -af ~/HIAI_PROJECTS/xxxx ~/HIAI_PROJECTS/xxxx

-

sha512sum ~/hdcd/xxxx; sha512sum ~/HIAI_DATANDMODELSET/xxxx

-

find ~/HIAI_DATANDMODELSET/xxxx -type f|xargs sha512sum|sort

-

~/HIAI_PROJECTS/xxxx; ~/ide_daemon/xxxx

Runs an executable file.

~/HIAI_PROJECTS/xxxx ~/HIAI_DATANDMODELSET/xxxx yyy ddd zzz

Runs a binary file with fixed parameters. Replace ~/HIAI_DATANDMODELSET/xxxx, yyy, ddd, and zzz with the actual values.

cce-gdbserver ip_address:port --attach xxx 2>&1; cce-gdbserver ip_address:port ~/ide_daemon/debug/xxxx

Replace ip_address and port with the actual values.

Replace xxx with the actual process ID.

pgrep -x -f "cce-gdbserver ip_address:port --attach xxx"; pgrep -x -f "cce-gdbserver ip _ddress:port ~/ide_daemon/debug/xxxx"

Replace ip_address and port with the actual values.

Replace xxx with the actual process ID.

pidof xxxx

Replace xxxx with the actual process name.

ps ux | awk '{print}'| sed 1d; ps ux | awk '{print $x\t$y}'| sed 1d

-

ps -ef | awk '{print}'| sed 1d; ps -ef | awk '{print $x\t$y}'| sed 1d

-

ide_cmd.sh --eth0_up ip _address

The sudo command is used to escalate the user's operation permission.

The actually executed command is ifconfig eth0 ip_address.

This command applies only to developer boards.

Replace ip_address with the actual value.

ide_cmd.sh --setup_eth0 ip_address netmask_address gw_address

The sudo command is used to escalate the user's operation permission.

The actually executed command is ifconfig eth0 ip_address netmask netmask_address && route add default gw gw_address.

This command applies only to developer boards.

Replace ip_address/netmask_address/gw_address with the actual value.

sed -i '/iface.eth0/{n;s/address.*/address ip_address/;}' /etc/network/interfaces

The sudo command is used to escalate the user's operation permission.

sudo command

This command applies only to developer boards.

Replace ip_address with the actual value.

sed -i '/iface.eth0/{n;n;s/netmask.*/netmask ip_address/;}' /etc/network/interfaces

The sudo command is used to escalate the user's operation permission.

sudo command

This command applies only to developer boards.

Replace ip_address with the actual value.

sed -i '/iface.eth0/{n;n;n;s/gateway.*/gateway ip_address/;}' /etc/network/interfaces

The sudo command is used to escalate the user's operation permission.

sudo command

This command applies only to developer boards.

Replace ip_address with the actual value.

del /f/s/q D:\profiler-app; del /f/s/q D:\profiler-app\xxx

Deletes a file on the Windows OS.

Replace D in the command with the actual drive letter on the Windows PC.

dir D:\profiler-app; dir D:\profiler-app\xxx

Lists all files in a directory on the Windows OS.

Replace D in the command with the actual drive letter on the Windows PC.

md D:\profiler-app; md D:\profiler-app\xxx

Creates a folder on the Windows OS.

Replace D in the command with the actual drive letter on the Windows PC.

rd /s/q D:\profiler-app; rd /s/q D:\profiler-app\xxx

Deletes a folder on the Windows OS.

Replace D in the command with the actual drive letter on the Windows PC.

tar -xvf D:\profiler-app\xxx.tar -C D:\profiler-app\yyy

Creates a compressed package on the Windows OS.

Replace D in the command with the actual drive letter on the Windows PC.

kill $(pidof ~/HIAI_PROJECTS/xxxx/out/yyy)

-

kill $(pidof -x ~/HIAI_PROJECTS/xxxx/out/yyy)

-

kill -9 $(pidof ~/HIAI_PROJECTS/xxxx/out/yyy)

-

kill -9 $(pidof -x ~/HIAI_PROJECTS/xxxx/out/yyy)

-

kill `pgrep -x -f "cce-gdbserver ip_address:port --attach xxx"`

Replace ip_address and port with the actual values.

Replace xxx with the actual process number.

kill -9 `pgrep -x -f "cce-gdbserver ip_address:port --attach xxx"`

Replace ip_address and port with the actual values.

Replace xxx with the actual process number.

kill `pgrep -x -f "cce-gdbserver ip_address:port ~/ide_daemon/debug/xxxx"`

Replace ip_address and port with the actual values.

kill -9 `pgrep -x -f "cce-gdbserver ip_address:port ~/ide_daemon/debug/xxxx"`

Replace ip_address and port with the actual values.

cd ~/HIAI_PROJECTS/xxxx/out;./yy

Runs an executable file in the directory. This command has no parameter.

cd ~/HIAI_PROJECTS/xxxx/out;./yy ~/HIAI_DATANDMODELSET/xxxx yyy ddd zzz

Runs a binary file in the directory. The parameters are fixed. Replace ~/HIAI_DATANDMODELSET/xxxx, yyy, ddd, and zzz with the actual values.

cd ~/HIAI_PROJECTS/xxxx/out;~/HIAI_PROJECTS/xxxx/out/yyy ~/HIAI_DATANDMODELSET/xxxx yyy ddd zzz

Runs a binary file in the directory. The parameters are fixed. Replace ~/HIAI_DATANDMODELSET/xxxx, yyy, ddd, and zzz with the actual values.