aboutsummaryrefslogtreecommitdiff
path: root/ROMFS/px4fmu_common/init.d/rcS
diff options
context:
space:
mode:
Diffstat (limited to 'ROMFS/px4fmu_common/init.d/rcS')
-rw-r--r--[-rwxr-xr-x]ROMFS/px4fmu_common/init.d/rcS81
1 files changed, 70 insertions, 11 deletions
diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS
index d8b5cb608..6eac00d0c 100755..100644
--- a/ROMFS/px4fmu_common/init.d/rcS
+++ b/ROMFS/px4fmu_common/init.d/rcS
@@ -8,6 +8,8 @@
#
set MODE autostart
+set logfile /fs/microsd/bootlog.txt
+
#
# Try to mount the microSD card.
#
@@ -111,6 +113,16 @@ then
#
commander start
+ #
+ # Start the datamanager
+ #
+ dataman start
+
+ #
+ # Start the Navigator
+ #
+ navigator start
+
if param compare SYS_AUTOSTART 1000
then
sh /etc/init.d/1000_rc_fw_easystar.hil
@@ -147,26 +159,49 @@ then
nshterm /dev/ttyACM0 &
fi
-
#
# Upgrade PX4IO firmware
#
- if px4io detect
+
+ if [ -f /etc/extras/px4io-v2_default.bin ]
then
- echo "PX4IO running, not upgrading"
+ set io_file /etc/extras/px4io-v2_default.bin
else
- echo "Attempting to upgrade PX4IO"
- if px4io update
+ set io_file /etc/extras/px4io-v1_default.bin
+ fi
+
+ if px4io start
+ then
+ echo "PX4IO OK"
+ echo "PX4IO OK" >> $logfile
+ fi
+
+ if px4io checkcrc $io_file
+ then
+ echo "PX4IO CRC OK"
+ echo "PX4IO CRC OK" >> $logfile
+ else
+ echo "PX4IO CRC failure"
+ echo "PX4IO CRC failure" >> $logfile
+ tone_alarm MBABGP
+ if px4io forceupdate 14662 $io_file
then
- if [ -d /fs/microsd ]
+ usleep 200000
+ if px4io start
then
- echo "Flashed PX4IO Firmware OK" > /fs/microsd/px4io.log
+ echo "PX4IO restart OK"
+ echo "PX4IO restart OK" >> $logfile
+ tone_alarm MSPAA
+ else
+ echo "PX4IO restart failed"
+ echo "PX4IO restart failed" >> $logfile
+ tone_alarm MNGGG
+ sh /etc/init.d/rc.error
fi
-
- # Allow IO to safely kick back to app
- usleep 200000
else
- echo "No PX4IO to upgrade here"
+ echo "PX4IO update failed"
+ echo "PX4IO update failed" >> $logfile
+ tone_alarm MNGGG
fi
fi
@@ -296,6 +331,18 @@ then
set MODE custom
fi
+ if param compare SYS_AUTOSTART 33
+ then
+ sh /etc/init.d/33_io_wingwing
+ set MODE custom
+ fi
+
+ if param compare SYS_AUTOSTART 34
+ then
+ sh /etc/init.d/34_io_fx79
+ set MODE custom
+ fi
+
if param compare SYS_AUTOSTART 40
then
sh /etc/init.d/40_io_segway
@@ -313,6 +360,18 @@ then
sh /etc/init.d/101_hk_bixler
set MODE custom
fi
+
+ if param compare SYS_AUTOSTART 102
+ then
+ sh /etc/init.d/102_3dr_skywalker
+ set MODE custom
+ fi
+
+ if param compare SYS_AUTOSTART 800
+ then
+ sh /etc/init.d/800_sdlogger
+ set MODE custom
+ fi
# Start any custom extensions that might be missing
if [ -f /fs/microsd/etc/rc.local ]