Hi, I just want to make few comments about Disco on last version and Parrot / Arduplane script and ask for help to improve the whole workflow of dual FC Arduplane/Dragon.
1/ internal folder that already exist in my disco is internal_000/ardupilot/
2/ when pressing the 3 short on power button, it call this script : shortpress_3.sh
in /bin/onoffblink. (or something like that on name - don’t remember exactly his filepath)
this script is :
ulog_tag="APM:Plane Disco"
source /usr/share/ulog/ulog_api.sh
/usr/bin/apm-plane-disco.sh prepare
if [ $? -eq 0 ] ; then
ulogi "Stopping stock autopilot"
kk
else
ulogi "Keep Dragon alive"
exit 0
fi
ulogi "Starting APM:Plane"
media-ctl -l '"mt9f002 0-0010":0->"avicam.0":0[1]'
media-ctl -l '"avicam_dummy_dev.0":0->"avicam.0":0[0]'
pstop ledd
prestart apm-plane-disco
prestart dxowrapperd
prestart pimp
Question: here what is prestart apm-plane-disco ? the .sh script in /usr/bin OR the launchable apm-plane-disco ‘firmware’ in the theorically /internal_000/APM/apm-plane-disco ???
3/ the /usr/bin/apm-plane-disco.sh
is :
rw_apm=/data/ftp/internal_000/ardupilot/arduplane
if [ -f "${rw_apm}" ]; then
chmod +x ${rw_apm}
ret=0
else
ret=1
fi
if [ "$1" = "prepare" ]; then
exit $ret
else
exec ${rw_apm} $@
fi
nb: I don’t remember if I change this script on his filepath…perhaps it was this instead
rw_apm=/data/ftp/internal_000/APM/apm-plane-disco…Above what I had now
4/ about rcS_mode_default
in /etc/init.d
:
Orginal script on my disco was :
ulog_tag="rcS Mode default"
source /usr/share/ulog/ulog_api.sh
# default rcS running mode script
ulogi "rcS_mode_default"
echo $((1024*1024)) > /proc/sys/net/core/wmem_max # inscrease the max socket size
DragonStarter.sh &
sleep 1
If I use script provide here https://github.com/ArduPilot/ardupilot/blob/master/Tools/Frame_params/Parrot_Disco/rcS_mode_default on the tuto, it’s not booting (still have wifi but Dragon not launching), even after change the filepath
Here this script :
# default rcS running mode script
echo $((1024*1024)) > /proc/sys/net/core/wmem_max # inscrease the max socket size
if test -x /data/ftp/internal_000/APM/start_ardupilot.sh; then
ulogger -t "rcS_mode_default" -p I "Launching ArduPilot"
/data/ftp/internal_000/APM/start_ardupilot.sh
else
ulogger -t "rcS_mode_default" -p I "Launching Dragon"
DragonStarter.sh -out2null &
fi
sleep 1
I changed it with ulogi because logging api seem to have change in main image disk but didn’t find the argument for ulogi. Moreover, with ulogger, it’s not starting Dragon or Arduplane.
# default rcS running mode script
echo $((1024*1024)) > /proc/sys/net/core/wmem_max # inscrease the max socket size
# default rcS running mode script Arduplane
if test -x /data/ftp/internal_000/ardupilot/start_ardupilot.sh; then
ulog_tag "rcS_mode_default" -p I "Launching ArduPilot"
/data/ftp/internal_000/ardupilot/start_ardupilot.sh
else
# default rcS running mode script Dragon
ulog_tag="rcS Mode default" -p I "Launching Dragon"
source /usr/share/ulog/ulog_api.sh
ulogi "rcS_mode_default"
DragonStarter.sh &
fi
sleep 1
5/ Finally, I put the start_ardupilot.sh script and arduplane firmware(download here http://firmware.ardupilot.org/Plane/stable/disco/) in my /ftp/internal_000/ardupilot
Notice that grants are modified by the prepare script to make it executable (cf above chmod +x ${rw_apm})
cd /data/ftp/internal_000/ardupilot
(
date
# stop stock led daemon
pstop ledd
# startup fan
echo 1 > /sys/devices/platform/user_gpio/FAN/value
while :; do
echo "$(date) Starting arduplane"
./arduplane -A udp:192.168.42.255:14550:bcast -B /dev/ttyPA1 -C udp:192.168.53.255:14550:bcast --module-directory modules
done
) >> start_ardupilot.log 2>&1 &
I change the usb IP from 192.168.43.255:14550 to 192.168.53.255:14550 because I read that IP have evolve in Parrot system and 192.168.43* are now specifig to their debug system. My skycontroller is 1.0.6 so greater to 1.0.4 so output “RTP” like stream on 192.168.53 and not 192.168.43. I have test with Trendnet TU2-ET100 like ‘Nicolas’ from Parrot write here http://forum.developer.parrot.com/t/skycontroller-2-wifi-and-hdmi-out/4530.
Tridge, If only you could have a look quickly on my modified script (especially rcS_mode_default and shortpress_3.sh) to see if it s correct or not. It will be very kind. I’m not fan of bash and not developper… Later when everything will be ok and TESTED, I will make a pull request to update github doc. Thanks !
nb2: I removed all the comment at the beginning of scipt because had some issue with this kind ok mardown here #!/bin/sh