Index: scripts/run.sh =================================================================== diff -u -r9c7a790376d07de7ddaa67e39d47102d68693c87 -r0e122c98700951af539d9f47c5578e26d640fcc7 --- scripts/run.sh (.../run.sh) (revision 9c7a790376d07de7ddaa67e39d47102d68693c87) +++ scripts/run.sh (.../run.sh) (revision 0e122c98700951af539d9f47c5578e26d640fcc7) @@ -15,6 +15,15 @@ # ############################################################################ + +time_start=$(date +%s) + +echo nameserver 8.8.8.8 > /etc/resolv.conf +echo nameserver 192.168.10.20 >> /etc/resolv.conf +echo nameserver 192.168.10.21 > /etc/resolv.conf +systemctl start systemd-resolved.service + + echo "HOME : $HOME " > /home/root/post.debug HOME="$1" source ./globals.sh @@ -24,6 +33,7 @@ echo "COUT : $COUT " >> /home/root/post.debug echo "POSTLOG : $POSTLOG " >> /home/root/post.debug + # cleanup the POST log file post_log_clear post_err_clear @@ -43,9 +53,12 @@ #setting up ethernet----------------------- Ethernet post_log_dash " Ethernet " -udhcpc eth0 & +ieth=eth0 +udhcpc --timeout=5 --retries=1 -n -i $ieth +post_log "$(ip addr show $ieth)" # -details -statistics + #setting up can interface ----------------- CANBus post_log_dash " CANBus " #current settings can be retrieved by the command below @@ -93,6 +106,45 @@ fi +# ----------------------------------------- WiFi +post_log_dash " WiFi " + +# create the wpa supplicant folder for conf storing +iwlan=wlan0 +WPA_SUPPLICANT_DIR="/etc/wpa_supplicant/" +WPA_SUPPLICANT_CNF="wpa_supplicant-$iwlan.conf" +mkdir -p $WPA_SUPPLICANT_DIR + +# remove any software blocks +rfkill unblock wlan + +if [[ ! -z $(dmesg | grep "wlan: driver loaded") ]]; then + post_log_pass "$POSTMSG_WIFI$POSTMSG_POSTFIX_PASSED [driver]" + post_log "$(dmesg | grep -i wlan:)" + + # start the wpa_supplicant service + systemctl start wpa_supplicant@$iwlan.service + post_log "start wpa_supplicant service" + if [ $? -eq 0 ]; then + post_log_pass "$POSTMSG_WIFI$POSTMSG_POSTFIX_PASSED [service]" + # try to connect to WiFi + if [ -f $WPA_SUPPLICANT_DIR$WPA_SUPPLICANT_CNF ]; then + post_log_dash " WiFi Connection " + killall udhcpc + post_log "connecting to WiFi" + # run this manually in terminal if didn't work on bootup + udhcpc --timeout=5 --retries=2 -n -i $iwlan + fi + post_log "$(ip link show $iwlan)" # -details -statistics + else + post_log_fail "$POSTMSG_WIFI$POSTMSG_POSTFIX_FAILED" + post_log "$(systemctl --failed | grep wpa)" + fi +else + post_log_fail "$POSTMSG_WIFI$POSTMSG_POSTFIX_FAILED" +fi + + # ----------------------------------------- Bluetooth post_log_dash " Bluetooth " /usr/share/silex-uart/silex-uart.sh start 1>> $POSTOUT 2>> $POSTERR @@ -124,34 +176,6 @@ fi -# ----------------------------------------- WiFi -post_log_dash " WiFi " - -# create the wpa supplicant folder for conf storing -WPA_SUPPLICANT_DIR="/etc/wpa_supplicant/" -mkdir -p $WPA_SUPPLICANT_DIR - -# remove any software blocks -rfkill unblock wlan - -if [[ ! -z $(dmesg | grep "wlan: driver loaded") ]]; then - post_log_pass "$POSTMSG_WIFI$POSTMSG_POSTFIX_PASSED" - post_log "$(dmesg | grep -i wlan:)" - post_log "$(ip link show wlan0)" # -details -statistics -else - post_log_fail "$POSTMSG_WIFI$POSTMSG_POSTFIX_FAILED" -fi - -# start the wpa_supplicant service -systemctl start wpa_supplicant@wlan0.service -if [ $? -eq 0 ]; then -    post_log_pass "$POSTMSG_WIFI$POSTMSG_POSTFIX_PASSED" -else -    post_log_fail "$POSTMSG_WIFI$POSTMSG_POSTFIX_FAILED" -    post_log      "$(systemctl --failed | grep wpa)" -fi - - # ----------------------------------------- Sha256Sum post_log_dash " Sha256Sum " #check the denali applicatoin checksum @@ -164,7 +188,11 @@ fi -# ----------------------------------------- CloudSync +# ----------------------------------------- Cloud +post_log_dash " CloudSystem " +post_log "$(ip addr show $iwlan)" # -details -statistics +post_log "$(ping device-api.diality.qa.kebormed.com -I $iwlan -c 3 -4)" + post_log_dash " CloudSync " if [ -d $HOME/$CLOUDSYNC_FOLDER ]; then # moving/ backing up the previous treatment logs so the new buff starts with fresh sequence @@ -195,8 +223,14 @@ #launching denali application DENALI_VERSION="$($HOME/$DENALI_BIN -v)" if [ -n "$DENALI_VERSION" ]; then - post_log_pass "$DENALI_VERSION" # log UI Software version - $HOME/$DENALI_BIN -u -C & # -C to disable cloudsync for now sync it blocks the system and no cloudsync has been installed. + post_log_pass "$($HOME/$DENALI_BIN -v)" # log UI Software version + # Note: + # The denali application needs to run with -E for the first time during manufacturing. + # Ther need to be an indication in the application itself to go to the manufacturing mode (-E). + # otherwise on each update it want to set to -E mode + # a good indication would be the Service Password, and it will be implemented soon. + # The -E has been removed for now from run.sh to prevent the setuation mentioned above. + $HOME/$DENALI_BIN -Kauk & else post_log_fail "Unknown Applicaion Version" fi @@ -205,6 +239,8 @@ # ----------------------------------------- END # tag the end time in the POST log file post_log "End: $(timestamp)" +time_end=$(date +%s) +post_log "time spent: "$(( $time_end - $time_start ))" seconds" post_log_star " ***** " exit 0