Index: scripts/run.sh =================================================================== diff -u -r768259b3c00ee3fbc5ba04475763b43cfac76bfe -r86e9dfbff50cb7e16fd94c16c1c818cef3b47eac --- scripts/run.sh (.../run.sh) (revision 768259b3c00ee3fbc5ba04475763b43cfac76bfe) +++ scripts/run.sh (.../run.sh) (revision 86e9dfbff50cb7e16fd94c16c1c818cef3b47eac) @@ -24,10 +24,13 @@ #DO NOT MODIFY VARIABLES #unless the denali applicaiton is updated as well to match. HOME=/home/root + SDCARD_DEV=/dev/mmcblk1p1 SDCARD_MNT=/media/sd-card USB_DEV=/dev/sda1 USB_MNT=/media/usb +CLOUDSYNC_FOLDER=cloudsync # both for log and application + POSTLOG=$HOME/post.log POSTERR=$HOME/post.err POSTOUT=$HOME/post.out @@ -44,12 +47,10 @@ echo "" > $POSTERR echo "" > $POSTOUT - #create folders for sd-card and usb if not exist mkdir -p $SDCARD_MNT mkdir -p $USB_MNT - # ---------------------------------------- UPDATE #mounting usb mount $USB_DEV $USB_MNT @@ -73,6 +74,7 @@ # ---------------------------------------- SETUP & POST #Here only passed is logged and if nothing added to the post.log means it failed. + #setting up can interface ----------------- CANBus #current settings can be retrieved by the command below #$ ip -details -statistics link show can0 @@ -122,11 +124,12 @@ fi +# ---------------------------------------- Connections # stop the connection manager daemon killall connmand -# setup bluetooth +# ---------------------------------------- Bluetooth /usr/share/silex-uart/silex-uart.sh start 1>> $POSTOUT 2>> $POSTERR sleep 5 hciconfig hci0 up @@ -135,13 +138,14 @@ fi -# setup wifi +# ---------------------------------------- WiFi killall wpa_supplicant 1>> $POSTOUT 2>> $POSTERR if [[ ! -z $(dmesg | grep "wlan: driver loaded") ]]; then echo $POSTMSG_WIFI >> $POSTLOG fi +# ---------------------------------------- Sha256Sum #check the denali applicatoin checksum SHA_ACT=$(tail -c 83 $HOME/denali | cut -c19-82) SHA_EXP=$(head -c -83 $HOME/denali | sha256sum -b --tag | cut -c14-77) @@ -150,15 +154,34 @@ fi +# ---------------------------------------- CloudSync +# moving/ backing up the previous treatment logs so the new buff starts with fresh sequence +echo "Backing up CloudSync I/O buff" +CLOUDSYNC_PATH="$SDCARD_MNT"/"$CLOUDSYNC_FOLDER" +CLOUDSYNC_BACKUP="$CLOUDSYNC_PATH"_backup/$(currDate)/ +mkdir -p $CLOUDSYNC_BACKUP +mv $CLOUDSYNC_PATH/* $CLOUDSYNC_BACKUP +rm $HOME/$CLOUDSYNC_FOLDER/data/* +echo "Starting CloudSync" >> $POSTLOG +cd $HOME/$CLOUDSYNC_FOLDER/ +python3 ./cs.py start & +sleep 2 +echo "$(python3 ./cs.py status)" >> $POSTLOG +cd + + +# ---------------------------------------- Denali #launching denali application #TODO: -d(--enable-dialin-unhandled) added for the development phase and has to be removed later -$HOME/denali -u -d & +$HOME/denali -u -d & # -a has to be removed and is only for debugging to bypass the nonminimizable alarms. +# ---------------------------------------- END # tag the end time in the POST log file echo "End: $(date +"%d%m%Y%H%M%S")" >> $POSTLOG +# ---------------------------------------- Ethernet # setup ethernet # note: At this time the application is running and also the ehternet connection is not necessary # so the sleep here is not hurtung any part of the applicaion progress.