Can't get to upgrade firmware via Mission Planner

Hi, and thanks in advance to the community for reading this.

I’m building a quadcopter using a RasPi 4 and a Navio2 board. I know linux a drones basics but I’m far from being an expert !

I’m struggling with getting my arducopter firmware upgraded.

What I have :

  • Raspbian 10,
  • Linux navio 5.10.11-emlid-v7l+
  • Mission planner 1.3.77 build 1.3.8110.38294
  • ArduCopter V4.0.3 (according to Mission Planner)
  • Connecting to Mission Planner via 3DR 433MHz telemetry.
  • Correct connection between Mission Planner and Navio, reading data, configuring etc.

When connecting the drone, MP reminds me to upgrade to version 4.2.2 of Copter.
First, I’m not sure of what is the difference between upgrading via ssh (apt update && apt upgrade), and upgrading via the Setup > Install Firmware menu on Mission Planner.

I did update and upgrade through ssh, everything is up to date and no error is mentionned.

Now Mission Planner still says my copter version is 4.0.3 and that I should upgrade to 4.2.2 - So I look into the Setup > Install firmware menu.

  • If using the main “install firmware” pannel, clicking “Copter 4.2.2 OFFICIAL”, an error message says “failed to discover board id. Please reconnect via usb and try again”.
  • If using “Install Firmware Legacy”, clicking ArduCopter V4.2.1 Quad, a message ask “Is this a linux board ?” - clicking “yes”, then “Is this Bebop 2 ?” - clicking no, then “Is this Disco ?”, cliking no.
    Then it freezes. Nothing happens and the Mission planner is freezed.

Fun fact is that Mission planner can unfreeze, only when I physically disconnect or shut down the drone : if shutting down the board,

  • He keep asking if it’s an APM2+,
  • Then says the board has been retired, “Planner will upload the last available verison to your board”
  • And then of course “Communication error - no connection”

Can anyone explain me the right way to do that ?

I also tried to connect directly via USB, but didn’t even manage to connect to the board. Reading emlid documentation, they suggest to go with telemetry or Wifi connections.

I’m probably doing something wrong, any help would be really appreciated !

Cheers,

Corentin LR - from Toulouse, France

Hi Corentin,

Welcome to our forum! Thanks for the detailed description of the issue you faced. It always helps to understand what went wrong faster.

If you want to work with the ArduCopter version, which is not currently supported by Navio2, you can install it manually. It’s hardly possible to do this via Mission Planner as this action isn’t supported. But there are just a few steps you need to do directly in the terminal.

Basically, you need to download a binary with the necessary firmware version from the ArduPilot server and add it to the ardupilot.service file. Here’s the part of the guide that explains how to do that. Have you had a chance to try it?

1 Like

Hi Liudmila,

And thank you for your kind answer. I’ll try to build from sources this very day and I’ll be back with some news !

Hi Liudmila,

  • I first tried to check ardupilot service status using systemctl status ardupilot :
    it returns Loaded: bad-setting (Reason: Unit ardupilot.service has a bad unit file setting.)
  • I downloaded the latest stable binary from https://firmware.ardupilot.org/Copter/stable/navio2/arducopter using wget.
  • I added execute permission using chmod.
  • I uncommented the line in ardupilot.service to match the path to my binary :
    ExecStart=/bin/sh -c "/home/pi/ardupilotBinary/arducopter ${ARDUPILOT_OPTS}"
  • Tried to start ardupilot using sudo systemctl start ardupilot but it still returns :
    Failed to start ardupilot.service: Unit ardupilot.service has a bad unit file setting.

Also, the arducopter service is still running well : The drone is working. Stoping arducopter service doesn’t allow me to start ardupilot service.

I must admit that I’m having trouble understanding the difference between the ardupilot service and the arducopter service. If arducopter is in charge and get the drone to work ?, what is the ardupilot service doing ?

Also this bad unit file setting is probably causing some trouble here.

So I found this thread, where Iyad Salameh explains it sohould have just restarted the arducopter service instead of ardupilot.

After restarting the arducopter service successfully, and connecting the drone to Mission planner, MP is stille saying that Copter 4.2.2 is available and invites me to upgrade.

Maybe there is something I’m not getting here ? Any help and explanations would be really appreciated :slight_smile:

Also, Mission planner shows that Arducopter version is still V4.0.3, even though the firmware-version.txt file in the build server indicates the last version is 4.2.1-FIRMWARE_VERSION_TYPE_OFFICIAL.

Hi Corentin,

Thanks for the details!

Can you please show how your /etc/systemd/system/ardupilot.service file looks like?

Running ardupilot allows you to work with the custom binary. This is how the system knows that it needs to work on the different firmware versions.

If you run arducopter, then you get the default firmware version supported by the current Navio2 image.

1 Like

Hi Liudmila,

Reading your explanations I understood way better the complete picture.

I properly stopped arducopter service before starting ardupilot service. The service started like a charm.

pi@navio:~ $ sudo systemctl stop arducopter
pi@navio:~ $ sudo systemctl status arducopter
● arducopter.service - ArduPilot for Linux
   Loaded: loaded (/etc/systemd/system/arducopter.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Mon 2022-07-04 19:34:49 BST; 7s ago
     Docs: https://docs.emlid.com/navio2/navio-ardupilot/installation-and-running/#autostarting-ardupilot-on-boot
  Process: 467 ExecStart=/bin/sh -c /usr/bin/arducopter ${ARDUPILOT_OPTS} (code=killed, signal=TERM)
 Main PID: 467 (code=killed, signal=TERM)

Jul 04 16:22:06 navio systemd[1]: Started ArduPilot for Linux.
Jul 04 19:34:49 navio systemd[1]: Stopping ArduPilot for Linux...
Jul 04 19:34:49 navio systemd[1]: arducopter.service: Main process exited, code=killed, status=15/TERM
Jul 04 19:34:49 navio sh[467]: Raspberry Pi 4 Model B Rev 1.4. (intern: 2)
Jul 04 19:34:49 navio sh[467]: MS5611 found on bus 1 address 0x77
Jul 04 19:34:49 navio sh[467]: MPU: temp reset IMU[0] 2544 0
Jul 04 19:34:49 navio sh[467]: MPU: IMU[0] stop at 24 of 37
Jul 04 19:34:49 navio systemd[1]: arducopter.service: Succeeded.
Jul 04 19:34:49 navio systemd[1]: Stopped ArduPilot for Linux.
pi@navio:~ $ sudo systemctl start ardupilot
pi@navio:~ $ sudo systemctl status ardupilot
● ardupilot.service - ArduPilot for Linux
   Loaded: loaded (/etc/systemd/system/ardupilot.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2022-07-04 19:35:16 BST; 21s ago
     Docs: https://docs.emlid.com/navio2/navio-ardupilot/installation-and-running/#autostarting-ardupilot-on-boot
 Main PID: 839 (sh)
    Tasks: 9 (limit: 4915)
   CGroup: /system.slice/ardupilot.service
           ├─839 /bin/sh -c /home/pi/ardupilotBinary/arducopter $TELEM1 $TELEM2
           └─840 /home/pi/ardupilotBinary/arducopter -A udp:127.0.0.1:14550

Also, I noticed that I now have to use the /etc/default/ardupilot configuration file instead of the /etc/default/arducopter one.

The pilot connected perfectly with Mission planner and the system is indeed up to date.

Thank you very much for you clear and detailed explanations ! That was very helpful.
I won’t hesitate to share when the project will be more advanced :).

Cheers,

Corentin

1 Like

Hi Corentin,

Cool that you’ve sorted this out! I’m glad I could help you :slightly_smiling_face:.

1 Like