aboutsummaryrefslogtreecommitdiff
path: root/ROMFS/px4fmu_common/init.d
diff options
context:
space:
mode:
authorJulian Oes <julian@oes.ch>2013-11-04 14:05:52 +0100
committerJulian Oes <julian@oes.ch>2013-12-26 23:46:33 +0100
commit05ec96b0f74b5d6011b683e747aae3bc37cbfbb9 (patch)
tree3974b1b3c9faf5f18c608c8710f0097907cd57c3 /ROMFS/px4fmu_common/init.d
parent8d2950561d1889ab1d4c2fc5d832a2984048487d (diff)
downloadpx4-firmware-05ec96b0f74b5d6011b683e747aae3bc37cbfbb9.tar.gz
px4-firmware-05ec96b0f74b5d6011b683e747aae3bc37cbfbb9.tar.bz2
px4-firmware-05ec96b0f74b5d6011b683e747aae3bc37cbfbb9.zip
Startup script for simple logging
Diffstat (limited to 'ROMFS/px4fmu_common/init.d')
-rw-r--r--ROMFS/px4fmu_common/init.d/800_sdlogger60
-rw-r--r--ROMFS/px4fmu_common/init.d/rcS6
2 files changed, 66 insertions, 0 deletions
diff --git a/ROMFS/px4fmu_common/init.d/800_sdlogger b/ROMFS/px4fmu_common/init.d/800_sdlogger
new file mode 100644
index 000000000..955fe0e2a
--- /dev/null
+++ b/ROMFS/px4fmu_common/init.d/800_sdlogger
@@ -0,0 +1,60 @@
+#!nsh
+
+echo "[init] PX4FMU v1, v2 init to log only
+
+#
+# Load default params for this platform
+#
+if param compare SYS_AUTOCONFIG 1
+then
+ # Set all params here, then disable autoconfig
+ param set SYS_AUTOCONFIG 0
+
+ param save
+fi
+
+set EXIT_ON_END no
+
+#
+# Start and configure PX4IO or FMU interface
+#
+if px4io detect
+then
+ # Start MAVLink (depends on orb)
+ mavlink start
+ usleep 5000
+
+ commander start
+
+ sh /etc/init.d/rc.io
+ # Set PWM values for DJI ESCs
+else
+ # Start MAVLink (on UART1 / ttyS0)
+ mavlink start -d /dev/ttyS0
+ usleep 5000
+ param set BAT_V_SCALING 0.004593
+ set EXIT_ON_END yes
+fi
+
+sh /etc/init.d/rc.sensors
+
+gps start
+
+attitude_estimator_ekf start
+
+position_estimator_inav start
+
+if [ -d /fs/microsd ]
+then
+ if [ $BOARD == fmuv1 ]
+ then
+ sdlog2 start -r 50 -e -b 16
+ else
+ sdlog2 start -r 200 -e -b 16
+ fi
+fi
+
+if [ $EXIT_ON_END == yes ]
+then
+ exit
+fi
diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS
index f551c1aa8..06102b707 100644
--- a/ROMFS/px4fmu_common/init.d/rcS
+++ b/ROMFS/px4fmu_common/init.d/rcS
@@ -345,6 +345,12 @@ then
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 ]
then