Custom binary will not boot

  1. Raspberry Pi 3 with Navio2 HAT and latest image.
  2. I have built a custom binary and edited the /etc/systemd/system/ardupilot.service file to point to where the binary is located but our changes do not take effect. It just uses default settings. any thoughts? Thanks!

Hello there!
Could you please post the output of these:
sudo systemctl status ardupilot sudo journalctl -u ardupilot

I will grab those this afternoon and post them, thanks!

putty.log (4.6 KB)

Here is the log with the outputs.

login as: pi
pi@192.168.0.101’s password:

            #     #    #    #     # ### #######
            ##    #   # #   #     #  #  #     #
            # #   #  #   #  #     #  #  #     #
            #  #  # #     # #     #  #  #     #
            #   # # #######  #   #   #  #     #
            #    ## #     #   # #    #  #     #
            #     # #     #    #    ### #######

To enable ArduPilot on boot:
STEP 1:
Choose your vehicle, board and ArduPilot version using update-alternatives
(Please, read carefully all options and select appropriate one for either Navio 2 or Navio+)
- sudo update-alternatives --config arducopter
- sudo update-alternatives --config arduplane
- sudo update-alternatives --config ardurover

STEP 2:
Set your GCS IP
- sudo nano /etc/default/arducopter
- sudo nano /etc/default/arduplane
- sudo nano /etc/default/ardurover
STEP 3:
Reload configuration by issuing these commands
- sudo systemctl daemon-reload

To start ardupilot (this won’t load ArduPilot on boot):
- sudo systemctl start arducopter
- sudo systemctl start arduplane
- sudo systemctl start ardurover

STEP 4:
Enable service on boot:
- sudo systemctl enable arducopter
- sudo systemctl enable arduplane
- sudo systemctl enable ardurover

To disable ArduPilot on boot:
- sudo systemctl disable arducopter
- sudo systemctl disable arduplane
- sudo systemctl disable ardurover

IMPORTANT:

To show this message one more time type “emlidtool ardupilot”

  • Documentation: https://docs.emlid.com/
    Last login: Mon Apr 17 22:32:07 2017 from 192.168.0.102
    pi@navio:~ $ sudo systemctl status ardupilot
    ● ardupilot.service - ArduPilot for Linux
    Loaded: loaded (/etc/systemd/system/ardupilot.service; enabled)
    Active: active (running) since Mon 2017-04-17 22:53:47 UTC; 2min 39s ago
    Docs: https://docs.emlid.com/navio2/navio-ardupilot/installation-and-runnin g/#autostarting-ardupilot-on-boot
    Main PID: 411 (sh)
    CGroup: /system.slice/ardupilot.service
    ├─411 /bin/sh -c /home/pi/ardupilot/build/navio2/bin/arducopter-si…
    └─413 /home/pi/ardupilot/build/navio2/bin/arducopter-single -C /de…

Apr 17 22:53:47 navio systemd[1]: Started ArduPilot for Linux.
Apr 17 22:53:49 navio sh[411]: Init APM:Copter V3.4.6 (e707341b)
Apr 17 22:53:49 navio sh[411]: Free RAM: 262144
Apr 17 22:53:49 navio sh[411]: FW Ver: 120
Apr 17 22:53:49 navio sh[411]: ----------------------------------------
Apr 17 22:53:49 navio sh[411]: load_all took 158us
Apr 17 22:53:49 navio sh[411]: 0 0 0 DataFlash_File: buffer size=16384
Apr 17 22:53:49 navio sh[411]: [1B blob data]
Apr 17 22:53:49 navio sh[411]: AK8963: Onboard compass detected
Apr 17 22:53:49 navio sh[411]: HMC5843: Could not detect version
Apr 17 22:53:49 navio sh[411]: HMC5843: External compass not detected
Apr 17 22:53:52 navio sh[411]: [12B blob data]
Apr 17 22:53:57 navio sh[411]: [25B blob data]
Apr 17 22:54:55 navio sh[411]: [2B blob data]
pi@navio:~ $ sudo journalctl -u ardupilot
– Logs begin at Mon 2017-04-17 22:53:46 UTC, end at Mon 2017-04-17 22:57:42 UTC. –
Apr 17 22:53:47 navio systemd[1]: Starting ArduPilot for Linux…
Apr 17 22:53:47 navio systemd[1]: Started ArduPilot for Linux.
Apr 17 22:53:49 navio sh[411]: Init APM:Copter V3.4.6 (e707341b)
Apr 17 22:53:49 navio sh[411]: Free RAM: 262144
Apr 17 22:53:49 navio sh[411]: FW Ver: 120
Apr 17 22:53:49 navio sh[411]: ----------------------------------------
Apr 17 22:53:49 navio sh[411]: load_all took 158us
Apr 17 22:53:49 navio sh[411]: 0 0 0 DataFlash_File: buffer size=16384
Apr 17 22:53:49 navio sh[411]: [1B blob data]
Apr 17 22:53:49 navio sh[411]: AK8963: Onboard compass detected
Apr 17 22:53:49 navio sh[411]: HMC5843: Could not detect version
Apr 17 22:53:49 navio sh[411]: HMC5843: External compass not detected
Apr 17 22:53:52 navio sh[411]: [12B blob data]
Apr 17 22:53:57 navio sh[411]: [25B blob data]
Apr 17 22:54:55 navio sh[411]: [2B blob data]
Apr 17 22:56:56 navio sh[411]: [12B blob data]

It seems like something is wrong with parameters that are passed to the binary. Could you please post cat /etc/default/ardupilot?

Here they are!

To enable ArduPilot on boot:
STEP 1:
Choose your vehicle, board and ArduPilot version using update-alternatives
(Please, read carefully all options and select appropriate one for either Navio 2 or Navio+)
- sudo update-alternatives --config arducopter
- sudo update-alternatives --config arduplane
- sudo update-alternatives --config ardurover

STEP 2:
Set your GCS IP
- sudo nano /etc/default/arducopter
- sudo nano /etc/default/arduplane
- sudo nano /etc/default/ardurover
STEP 3:
Reload configuration by issuing these commands
- sudo systemctl daemon-reload

To start ardupilot (this won’t load ArduPilot on boot):
- sudo systemctl start arducopter
- sudo systemctl start arduplane
- sudo systemctl start ardurover

STEP 4:
Enable service on boot:
- sudo systemctl enable arducopter
- sudo systemctl enable arduplane
- sudo systemctl enable ardurover

To disable ArduPilot on boot:
- sudo systemctl disable arducopter
- sudo systemctl disable arduplane
- sudo systemctl disable ardurover

IMPORTANT:

To show this message one more time type “emlidtool ardupilot”

  • Documentation: https://docs.emlid.com/
    Last login: Tue Apr 18 21:29:39 2017 from 192.168.0.102
    pi@navio:~ $ cat /etc/default/ardupilot

Default settings for ArduPilot for Linux.

The file is sourced by systemd from ardupilot.service

#TELEM1="-A udp:192.168.1.102:14550"
TELEM2="-C /dev/ttyAMA0"

Options to pass to ArduPilot

ARDUPILOT_OPTS="$TELEM1 $TELEM2"

                      #    # ###### #      #####
                      #    # #      #      #    #
                      ###### #####  #      #    #
                      #    # #      #      #####
                      #    # #      #      #
                      #    # ###### ###### #

-A is a console switch (usually this is a Wi-Fi link)

-C is a telemetry switch

Usually this is either /dev/ttyAMA0 - UART connector on your Navio

or /dev/ttyUSB0 if you’re using a serial to USB convertor

-B or -E is used to specify non default GPS

Type “emlidtool ardupilot” for further help

are you aware that you are logging in from ip 192.168.0.102 and pointing telemetry to 192.168.1.102 ?

We are using 3DR radios for telemetry, we have not used udp in mission planner.

Here is a combined output for cat /etc/systemd/system/ardupilot.service as well.

ogin as: pi
pi@192.168.0.101’s password:

            #     #    #    #     # ### #######
            ##    #   # #   #     #  #  #     #
            # #   #  #   #  #     #  #  #     #
            #  #  # #     # #     #  #  #     #
            #   # # #######  #   #   #  #     #
            #    ## #     #   # #    #  #     #
            #     # #     #    #    ### #######

To enable ArduPilot on boot:
STEP 1:
Choose your vehicle, board and ArduPilot version using update-alternatives
(Please, read carefully all options and select appropriate one for either Navio 2 or Navio+)
- sudo update-alternatives --config arducopter
- sudo update-alternatives --config arduplane
- sudo update-alternatives --config ardurover

STEP 2:
Set your GCS IP
- sudo nano /etc/default/arducopter
- sudo nano /etc/default/arduplane
- sudo nano /etc/default/ardurover
STEP 3:
Reload configuration by issuing these commands
- sudo systemctl daemon-reload

To start ardupilot (this won’t load ArduPilot on boot):
- sudo systemctl start arducopter
- sudo systemctl start arduplane
- sudo systemctl start ardurover

STEP 4:
Enable service on boot:
- sudo systemctl enable arducopter
- sudo systemctl enable arduplane
- sudo systemctl enable ardurover

To disable ArduPilot on boot:
- sudo systemctl disable arducopter
- sudo systemctl disable arduplane
- sudo systemctl disable ardurover

IMPORTANT:

To show this message one more time type “emlidtool ardupilot”

  • Documentation: https://docs.emlid.com/
    Last login: Tue Apr 18 21:29:39 2017 from 192.168.0.102
    pi@navio:~ $ cat /etc/default/ardupilot

Default settings for ArduPilot for Linux.

The file is sourced by systemd from ardupilot.service

#TELEM1="-A udp:192.168.1.102:14550"
TELEM2="-C /dev/ttyAMA0"

Options to pass to ArduPilot

ARDUPILOT_OPTS="$TELEM1 $TELEM2"

                      #    # ###### #      #####
                      #    # #      #      #    #
                      ###### #####  #      #    #
                      #    # #      #      #####
                      #    # #      #      #
                      #    # ###### ###### #

-A is a console switch (usually this is a Wi-Fi link)

-C is a telemetry switch

Usually this is either /dev/ttyAMA0 - UART connector on your Navio

or /dev/ttyUSB0 if you’re using a serial to USB convertor

-B or -E is used to specify non default GPS

Type “emlidtool ardupilot” for further help

pi@navio:~ $ ^C
pi@navio:~ $ cat /etc/systemd/system/ardupilot.service
[Unit]
Description=ArduPilot for Linux
After=systemd-modules-load.service
Documentation=https://docs.emlid.com/navio2/navio-ardupilot/installation-and-running/#autostarting-ardupilot-on-boot
Conflicts=arduplane.service arducopter.service ardurover.service

[Service]
EnvironmentFile=/etc/default/ardupilot

###############################################################################
####### DO NOT EDIT ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU"RE DOING #########
###############################################################################

#Uncomment and modify this line if you want to launch your own binary
ExecStart=/bin/sh -c “/home/pi/ardupilot/build/navio2/bin/arducopter-single ${ARDUPILOT_OPTS}”

CAUTION

There should be only one uncommented ExecStart in this file

###############################################################################
######## DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU"RE DOING ########
###############################################################################

Restart=on-failure

[Install]
WantedBy=multi-user.target

Could you please run sudo arducopter -C /dev/ttyAMA0 and check if you can connect to MP afterwards?

Yeah it was able to run and we were able to get it to connect to mission planner, here is the output.

pi@navio:~ $ sudo arducopter -C /dev/ttyAMA0
Raspberry Pi 2/3 with BCM2709!

Init APM:Copter V3.4.6 (5221448a)

Free RAM: 262144
FW Ver: 120

load_all took 162us
0 0 0 DataFlash_File: buffer size=16384
¦ Q}¦LSM9DS1: Onboard compass detected
AK8963: Onboard compass detected
HMC5843: Could not detect version
HMC5843: External compass not detected
PANIC: AP_Baro::read unsuccessful for more than 500ms in AP_Baro::calibrate [2]

Would you be available for a skype session to troubleshoot?

that’s some progress!
make sure navio is tightly attached to rpi;

I prefer solving these kind of issues in a public space so that all users could benefit from the troubleshooting results.

I cannot agree more with this statement:

We’ll need to have photos of your setup and the output of i2cdetect -y 1.

Everything is seated as well as it can be, here are some pictures and the output of the command.

pi@navio:~ $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – 77

1 Like

Would it be possible to get a list of commands we can run to reduce the turn around time on diagnostics? Thanks again for all of your assistance.

Any updates on this?

Any updates on this?

any red flags with “sudo journalctl” ?

@micahmosier65 Georgii is currently on vacation, sorry for not updating you for so long.

Could you please save an image of your SD card an upload it somewhere? Then post the link here or PM it to me.