#!/bin/sh export P_CANBUS="can0" export SSID_NAME="DilaityIoT" export SSID_PASS="E6ACB9855B948EC3" export TEMP=/tmp export WORKSPACE=/opt/leahi export LOGFILE=$TEMP/leahi.manufacturing.log export DATE="date +%Y%m%d%H%M%S" # the application needs this variable to be correctly set to susccessfully launch. # the egls.json file shall also correctly set and put in the pointing location. export QT_QPA_EGLFS_KMS_CONFIG=$WORKSPACE/eglfs.json # TODO: # 1 - separate the run.sh and the application service ( and even the cloudsync too ) # 2 - mv LOGNAME post.log # echo "" > $LOGFILE 2>&1 timedatectl set-timezone America/Los_Angeles >> $LOGFILE 2>&1 timedatectl set-ntp 1 >> $LOGFILE 2>&1 echo "[$($DATE)] Starting" >> $LOGFILE 2>&1 echo "[$($DATE)] Configuring the canbus '$P_CANBUS'" >> $LOGFILE 2>&1 ip link set $P_CANBUS up type can bitrate 250000 >> $LOGFILE 2>&1 ifconfig $P_CANBUS txqueuelen 4000 >> $LOGFILE 2>&1 ifconfig $P_CANBUS up >> $LOGFILE 2>&1 echo "[$($DATE)] Configuring wifi '$SSID_NAME' connection" >> $LOGFILE 2>&1 nmcli dev wifi connect "$SSID_NAME" password "$SSID_PASS" >> $LOGFILE 2>&1 cd $WORKSPACE echo "[$($DATE)] Application starting in '$(pwd)'" >> $LOGFILE 2>&1 $WORKSPACE/leahi -qL --platform eglfs >> $LOGFILE 2>&1 & # -E removed for using -L for testing Leahi FW communication echo "[$($DATE)] Application launched" >> $LOGFILE 2>&1