You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

55 lines
2.0 KiB

#!/bin/bash
SFE_DIR=/emmc/plugin/Aida_data/sfe #/root/sfe
SFE_LOG_DIR=${SFE_DIR}/log
case ${1} in
start)
# kill all running processes
killall -15 sfe_stream_processor;
killall -15 sfe_settings_server;
killall -15 sfe_client_rest;
killall -15 mqtt-v5-broker;
export LD_LIBRARY_PATH=${SFE_DIR}/dep;
mkdir -p ${SFE_LOG_DIR}/log;
# load Amba driver
modprobe cavalry 2>&1 | tee ${SFE_LOG_DIR}/modprobe_out.txt;
/usr/local/bin/cavalry_load -f /lib/firmware/cavalry.bin -r 2>&1 | tee ${SFE_LOG_DIR}/cavalry_load_out.txt;
# install Inno license
mkdir -p /etc/innovatrics;
cp ${SFE_DIR}/iengine.lic /etc/innovatrics/iengine.lic;
# create storage directory
mkdir -p ${SFE_DIR}/storage;
# run SFE Settings server if you want to be able to configurate SFE Stream Processor via web interface
#${SFE_DIR}/sfe_settings_server --address 0.0.0.0 --port 8592 --settings-file ${SFE_DIR}/settings.yaml 2>&1 | tee ${SFE_LOG_DIR}/sfe_settings_server_out.txt &
# run SFE Stream processor
${SFE_DIR}/sfe_stream_processor ${SFE_DIR}/settings.yaml 2>&1 | tee ${SFE_LOG_DIR}/sfe_stream_processor_out.txt &
# run MQTT broker locally
${SFE_DIR}/mqtt-v5-broker | tee ${SFE_LOG_DIR}/mqtt_broker_out.txt &
# run SFE REST Client
${SFE_DIR}/sfe_client_rest ${SFE_DIR}/settings.yaml 127.0.0.1 2>&1 | tee ${SFE_LOG_DIR}/sfe_client_rest_out.txt &
now=$(date);
echo "shell script(aiengine) Start : $now" > ${SFE_LOG_DIR}/start_console_log.txt;
sleep 1;
echo "faceengine Start End";
;;
stop)
killall -15 sfe_stream_processor;
killall -15 sfe_settings_server;
killall -15 sfe_client_rest;
killall -15 mqtt-v5-broker;
rm -r /etc/innovatrics;
now=$(date);
echo "shell script(aiengine) Stop : $now" > ${SFE_LOG_DIR}/stop_console_log.txt;
;;
*)
echo "Usage: ${0} {start|stop}";
exit 1;
;;
esac
exit 0;