@Eric-Katzfey
this is file open when i use vi program ( no command qshell gps start -d 7 -b 115200 in script file )
this is all file command :
#!/bin/sh
PX4 commands need the 'px4-' prefix in bash.
(px4-alias.sh is expected to be in the PATH)
. px4-alias.sh
Figure out what platform we are running on.
Eventually there will be a utility called voxl-platform that will
return the platform tag or an error code. This utility is not yet
ubiquitous so it may be that it isn't available. Trying to call a
non existent program will generate an error code by the OS. If the
program exists and doesn't return an error code then use the results.
PLATFORM=/usr/bin/voxl-platform 2> /dev/null
RETURNCODE=$?
if [ $RETURNCODE -ne 0 ]; then
# If we couldn't get the platform from the voxl-platform utility then check
# then we assume that we are on M0052. Otherwise assume M0054.
VERSIONSTRING=$(</etc/version)
M0052SUBSTRING="M0052"
if [[ "$VERSIONSTRING" == "$M0052SUBSTRING" ]]; then
PLATFORM="M0052"
else
PLATFORM="M0054"
fi
fi
We can only run on M0052 or M0054 so exit with error if that is not the case
if [ $PLATFORM = "M0052" ]; then
/bin/echo "Running on M0052"
if [ "$RC" == "CRSF" ]; then
/bin/echo "Error, crossfire not supported on M0052!"
exit 0
fi
elif [ $PLATFORM = "M0054" ]; then
/bin/echo "Running on M0054"
else
/bin/echo "Error, cannot determine platform!"
exit 0
fi
uorb start
muorb start
In order to just exit after starting the uorb / muorb modules define
the environment variable MINIMAL_PX4. (e.g. export MINIMAL_PX4=1)
This is useful for testing / debug where you may want to start drivers
and modules manually from the px4 command shell
if [ ! -z $MINIMAL_PX4 ]; then
/bin/echo "Running minimal script"
exit 0
fi
#!/bin/sh
PX4 commands need the 'px4-' prefix in bash.
(px4-alias.sh is expected to be in the PATH)
. px4-alias.sh
Figure out what platform we are running on.
Eventually there will be a utility called voxl-platform that will
return the platform tag or an error code. This utility is not yet
ubiquitous so it may be that it isn't available. Trying to call a
non existent program will generate an error code by the OS. If the
program exists and doesn't return an error code then use the results.
PLATFORM=/usr/bin/voxl-platform 2> /dev/null
RETURNCODE=$?
if [ $RETURNCODE -ne 0 ]; then
# If we couldn't get the platform from the voxl-platform utility then check
# then we assume that we are on M0052. Otherwise assume M0054.
VERSIONSTRING=$(</etc/version)
M0052SUBSTRING="M0052"
if [[ "$VERSIONSTRING" == "$M0052SUBSTRING" ]]; then
PLATFORM="M0052"
else
PLATFORM="M0054"
fi
fi
We can only run on M0052 or M0054 so exit with error if that is not the case
if [ $PLATFORM = "M0052" ]; then
/bin/echo "Running on M0052"
if [ "$RC" == "CRSF" ]; then
/bin/echo "Error, crossfire not supported on M0052!"
exit 0
fi
elif [ $PLATFORM = "M0054" ]; then
/bin/echo "Running on M0054"
else
/bin/echo "Error, cannot determine platform!"
exit 0
fi
uorb start
muorb start
In order to just exit after starting the uorb / muorb modules define
the environment variable MINIMAL_PX4. (e.g. export MINIMAL_PX4=1)
This is useful for testing / debug where you may want to start drivers
and modules manually from the px4 command shell
if [ ! -z $MINIMAL_PX4 ]; then
/bin/echo "Running minimal script"
exit 0
fi
Sleep a little here. A lot happens when the uorb and muorb start
and we need to make sure that it all completes successfully to avoid
any possible race conditions.
/bin/sleep 1
IMU (accelerometer / gyroscope)
Start this first because it gets the high rate interrupts coming in to the
DSP. Without this the DSP will oversleep and miss critical timeouts.
TODO: Why is that the case?
if [ "$IMU" == "ROTATE_IMU_YAW_180" ]; then
/bin/echo "Starting IMU driver with yaw 180 rotation"
qshell icm42688p start -s -R 4
else
qshell icm42688p start -s
fi
/bin/sleep 1
Load in all of the parameters that have been saved in the file
param load
Start logging and use timestamps for log files when possible.
Add the "-e" option to start logging immediately. Default is
to log only when armed
logger start -t
We do not change the value of SYS_AUTOCONFIG but if it does not
show up as used then it is not reported to QGC and we get a
#!/bin/sh
PX4 commands need the 'px4-' prefix in bash.
(px4-alias.sh is expected to be in the PATH)
. px4-alias.sh
Figure out what platform we are running on.
Eventually there will be a utility called voxl-platform that will
return the platform tag or an error code. This utility is not yet
ubiquitous so it may be that it isn't available. Trying to call a
non existent program will generate an error code by the OS. If the
program exists and doesn't return an error code then use the results.
PLATFORM=/usr/bin/voxl-platform 2> /dev/null
RETURNCODE=$?
if [ $RETURNCODE -ne 0 ]; then
# If we couldn't get the platform from the voxl-platform utility then check
# then we assume that we are on M0052. Otherwise assume M0054.
VERSIONSTRING=$(</etc/version)
M0052SUBSTRING="M0052"
if [[ "$VERSIONSTRING" == "$M0052SUBSTRING" ]]; then
PLATFORM="M0052"
else
PLATFORM="M0054"
fi
fi
We can only run on M0052 or M0054 so exit with error if that is not the case
if [ $PLATFORM = "M0052" ]; then
/bin/echo "Running on M0052"
if [ "$RC" == "CRSF" ]; then
/bin/echo "Error, crossfire not supported on M0052!"
exit 0
fi
elif [ $PLATFORM = "M0054" ]; then
/bin/echo "Running on M0054"
else
/bin/echo "Error, cannot determine platform!"
exit 0
fi
uorb start
muorb start
In order to just exit after starting the uorb / muorb modules define
the environment variable MINIMAL_PX4. (e.g. export MINIMAL_PX4=1)
This is useful for testing / debug where you may want to start drivers
and modules manually from the px4 command shell
if [ ! -z $MINIMAL_PX4 ]; then
/bin/echo "Running minimal script"
exit 0
fi
Sleep a little here. A lot happens when the uorb and muorb start
and we need to make sure that it all completes successfully to avoid
any possible race conditions.
/bin/sleep 1
IMU (accelerometer / gyroscope)
Start this first because it gets the high rate interrupts coming in to the
DSP. Without this the DSP will oversleep and miss critical timeouts.
TODO: Why is that the case?
if [ "$IMU" == "ROTATE_IMU_YAW_180" ]; then
/bin/echo "Starting IMU driver with yaw 180 rotation"
qshell icm42688p start -s -R 4
else
qshell icm42688p start -s
fi
/bin/sleep 1
Load in all of the parameters that have been saved in the file
param load
Start logging and use timestamps for log files when possible.
Add the "-e" option to start logging immediately. Default is
to log only when armed
logger start -t
We do not change the value of SYS_AUTOCONFIG but if it does not
show up as used then it is not reported to QGC and we get a
missing parameter error.
param touch SYS_AUTOCONFIG
Start all of the device drivers on DSP
Magnetometer
if [ "$GPS" == "MATEK" ]; then
# Use this line for the magnetometer in the Matek Systems M8Q-5883 module
/bin/echo "Starting Mateksys M8Q-5883 magnetometer"
qshell qmc5883l start -R 10 -X -b 1
elif [ "$GPS" == "HERE3" ]; then
# Use this line for the magnetometer in the Here3 GPS module
/bin/echo "Starting Here3 ak09916 magnetometer"
qshell ak09916 start -R 2 -X
else
# Use this line for the magnetometer in the Holybro GPS module
/bin/echo "Starting Holybro magnetometer"
qshell ist8311 start -R 10 -X -b 1
fi
LED driver for the Pixhawk 4 GPS module
Older units have i2c address 0x39 (57) and newer ones 0x38 (56)
M0054 only supports the newer one. M0052 can support either.
if [ $PLATFORM = "M0052" ]; then
qshell rgbled_ncp5623c start -X -b 1 -f 400 -a 57
fi
102,18 33%
# Use this line for the magnetometer in the Here3 GPS module
/bin/echo "Starting Here3 ak09916 magnetometer"
qshell ak09916 start -R 2 -X
else
# Use this line for the magnetometer in the Holybro GPS module
/bin/echo "Starting Holybro magnetometer"
qshell ist8310 start -R 10 -X -b 1
fi
LED driver for the Pixhawk 4 GPS module
Older units have i2c address 0x39 (57) and newer ones 0x38 (56)
M0054 only supports the newer one. M0052 can support either.
if [ $PLATFORM = "M0052" ]; then
qshell rgbled_ncp5623c start -X -b 1 -f 400 -a 57
fi
if [ "$GPS" == "HOLYBRO" ]; then
/bin/echo "Starting Holybro LED driver"
qshell rgbled_ncp5623c start -X -b 1 -f 400 -a 56
elif [ "$GPS" == "HERE3" ]; then
# Use this line for the Here3 GPS module LED controller
/bin/echo "Starting Here3 LED"
qshell rgbled start -X -f 400
fi
Barometer
qshell icp10100 start -I -b 5
ESC driver
We start this even if there is a PX4IO module. If there is
a PX4IO (M0065) module it will be plugged into the RC port
117,1 39%