forked from shaozm/Weight
parent
9b01a320d5
commit
4fa1dcb481
@ -0,0 +1,81 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Load default env variables from profiles(e.g. /etc/profile.d/*.sh)
|
||||
. /etc/profile
|
||||
|
||||
start_app()
|
||||
{
|
||||
# Wait for weston ready, 5 seconds timeout
|
||||
counter=0
|
||||
while [ ! -e "${XDG_RUNTIME_DIR}/wayland-0" ] && [ $counter -lt 50 ]; do
|
||||
sleep 0.1
|
||||
counter=$((counter + 1))
|
||||
done
|
||||
|
||||
if wait_for_network; then
|
||||
|
||||
killall weston 2>/dev/null || true
|
||||
sleep 0.5
|
||||
|
||||
/userdata/auseft/WeighUI --domain 11 > /dev/null 2>&1 &
|
||||
sleep 0.5
|
||||
/userdata/auseft/device-daemon > /dev/null 2>&1 &
|
||||
sleep 0.5
|
||||
/userdata/auseft/Core --domain 11 > /dev/null 2>&1 &
|
||||
sleep 0.5
|
||||
/userdata/auseft/GateCtrl --domain 11 > /dev/null 2>&1 &
|
||||
sleep 0.5
|
||||
/userdata/auseft/HttpServer --domain 11 --port 8081 > /dev/null 2>&1 &
|
||||
sleep 0.5
|
||||
PW_TCDRAIN=1 /userdata/auseft/Print --domain 11 --baudrate 57600 --port ttyS2 > /dev/null 2>&1 &
|
||||
sleep 0.5
|
||||
/userdata/auseft/Weigh --domain 11 --port ttyS3 --baudrate 9600 --device Toledo --empty 1 > /dev/null 2>&1 &
|
||||
sleep 0.5
|
||||
/userdata/auseft/MqttDds --domain 11 --addr ws://10.180.4.1:8083 --user auseft --password 1q2w3E** > /dev/null 2>&1 &
|
||||
sleep 0.5
|
||||
/userdata/auseft/Led --domain 11 --type 1 --addr 10.2.50.213 > /dev/null 2>&1 &
|
||||
sleep 0.5
|
||||
/userdata/auseft/ReadCard --domain 11 > /dev/null 2>&1 &
|
||||
else
|
||||
echo "network failed."
|
||||
fi
|
||||
}
|
||||
|
||||
wait_for_network()
|
||||
{
|
||||
local interface="eth0"
|
||||
local retries=50
|
||||
local count=0
|
||||
|
||||
echo "wait network $interface start..."
|
||||
|
||||
while [ $count -lt $retries ]; do
|
||||
if ip link show $interface | grep -q "state UP"; then
|
||||
echo "$interface started."
|
||||
return 0
|
||||
fi
|
||||
sleep 1
|
||||
count=$((count + 1))
|
||||
done
|
||||
|
||||
echo "network $interface start failed, retry $retries times."
|
||||
return 1
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
#sh /oem/RkLunch.sh
|
||||
ip link set can0 type can bitrate 500000 dbitrate 1000000 fd on
|
||||
ip link set up can0
|
||||
echo 34 > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio34/direction
|
||||
echo 1 > /sys/class/gpio/gpio34/value
|
||||
start_app
|
||||
;;
|
||||
stop)
|
||||
#sh /oem/RkLunch-stop.sh
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
;;
|
||||
esac
|
||||
Loading…
Reference in New Issue