Unable to Arm: (PreArm: Waiting for Terrain data)

I have reinstalled google earth pro and then mission planner, both in their latest version. Here is a screenshot of the main MP screen with copter connected and GPS lock.

Have you tried reformatting your SD card? I have seen instances where the terrain directory is wrong/missing and that confuses things.

Also can u check if this paramter is set to 1

terrain_enable

the other confusing part is why you have 336 ter_pend…hmmm

Did you plan some kind of way point mission 100’s miles away from your home location where the laptop is?

You are using a good quality SD card correct? Not the crappy Chinese 8MB card that comes with Pixhawk…

Make sure you are not in Auto mode.

I also noticed that you have 3D GPS fix, but I am not seeing Sat counts as shown in my pic.

Also make sure your compass settings are like this.

Good guess. I removed the microSD from the FC and formatted it on the laptop, but it doesn’t seem to be the solution, the problem persists.

I confirm that the parameter terrain_enable is set to 1. I’m also surprised that ter_pend equals 336. Plus, it’s always that value, I don’t see it changing.

As far as I know, I haven’t planned anything that far. Besides, I’ve been planning small missions near the home point, where I do have SRTM terrain data in the planning tab, and downloading them into the drone.

The SD card in my opinion is good. An 8Gb Sandisk.

The prearm message pops up in any flight mode alt_hold, loiter, etc…

You can see the number of satellites in the lower left corner of the map. Sat count equal to 12 satellites

My compass settings are the same. Except I don’t use the internal one, in this unit I prefer to use only the external, due to magnetic interference in the internal. Do you think this can influence this problem?

try enabling internal compass. Remove all way points. Just let FC download your home terrian data.

ter_pend must reach 0. That’s what the issue we are trying to solve.

is the problem solved?

I’ve activated and calibrated the internal compass (although I don’t understand how this could affect this problem). The existing mission of the FC has also been erased. The problem persists.

On the other hand, I noticed something else. As always, when I boot up the copter, it takes a few seconds to do a GPS fix. In these first instants in which the drone does not have GPS fix the value of ter_pend is zero and the drone can be armed without problem in a flight mode that does not require GPS, ej: AltHold. But as soon as the GPS receives enough satellites and makes 3D fix the ter_pend value jumps to 336 and the prearm message appears again.

This is what I don’t understand, because in the computer I have this terrain data and in other drones it works correctly. Furthermore, I have tried this drone with MP installed in other different computers and the result is the same, ter_pend equal to 336 when GPS 3D fix is obtained.

I am lost myself. When you say other drones it works, you mean you have another drone with the same FC, GPS and setup and no problem?

The only other thing I can think of is bad FC. For whatever reason. Do you have another FC and GPS to try?

I may have a found the solution to your problem.

Set this to 0, TERRAIN_FOLLOW = 0

Also read this thread…PreArm: Waiting for Terrain data

Yeah, I mean another copter with the same FC, GPS, firmware and configuration, almost clones. The FC is a Cube with the mini carrier board and the GPS is the Here 1. I might try changing some of the hardware to see if it makes a difference.

And yes, as I said in my first post, if I set the TERRAIN_FOLLOW parameter to 0 the problem is solved. But I would like to be able to solve it without having to lose this functionality.

And by the way, thanks for the help and effort :wink:

Edit: I was wrong about the other copter working correctly. I’ve done more in-depth tests with the second copter, and the problem is exactly the same (when the drone gets a GPS: 3D Fix the pre-am message “Waiting for Terrain data” appears and ter_pend equals 336).

At least with this I can assume that the problem does not lie in the hardware.

Oh so you have a cube, not Pixhawk 2.4.8 and Here GNSS GPS.

I have heard bad things about Here+ GNSS GPS.

You should go search at this Forum. Its for cube users.

Hi,

I’ve finally figured out the cause of this problem and I’ve been able to solve it.

When I boot up the Cube running A.C 4.0.3 with a clean and freshly formatted microSD card inside, ArduCopter fails to correctly create the microSD card directories, always failing to create the “TERRAIN” directory. And this is the cause of my problem, as there is no “TERRAIN” directory in the microSD, the terrain data cannot be downloaded, causing the ter_pend value to be stuck at the same number and consequently popping the PreArm message “Waiting for Terrain data”.

If I flash the copter with an older version of ArduCopter (for my tests I have been using A.C 3.6.11), and I boot it up for the first time with the same freshly formatted microSD card. All directories on the microSD card are created correctly and the terrain data starts downloading immediately to the “TERRAIN” folder.

Now if I just delete the terrain data from within the “TERRAIN” folder. And re-flash the copter with A.C 4.0.3 again, everything works correctly as the “TERRAIN” folder already exists in the microSD, and the terrain data can be downloaded without any problem.

I have tested this behavior with more than one copter, and I can confirm that for me the results are always these. So maybe this is a Bug, worth being checked out by some developer. Or at least I hope this can help someone with this same problem.

1 Like

Excellent…open up a bug request on git

I’m reviving this subject!
I too am trying to get terrain following to work without the groundstation attached.
I have:
TERRAIN_ENABLE,1
TERRAIN_FOLLOW,1
TERRAIN_OPTIONS,0 (set to 1 prevents download from the GCS)
TERRAIN_SPACING,30

Currently testing this on 4.0.4rc4, but also had been trying with 4.0.3 with the same results.
This is a small quad without telemetry - it would be extremely handy to have terrain following for RTL and failsafe events since this is a hilly/uneven area.

The TERRAIN folder is present on the SD card and I’ve pre-populated it from https://terrain.ardupilot.org/
…and I have also uploaded a large mission and allowed the terrain to download from the GCS via USB cable.
The pending tiles and downloaded tiles does oscillate around the last 56 or so, sometime going down to 0 pending then it will immediately jump up to 56 pending and download them again.
Plane doco talks about the downloaded terrain data being usable even without a GCS connection (such as dropouts in a telemetry link) however I cant see why the terrain functions wouldnt work entirely without a GCS connection once valid data is on the SD card.

TERRAIN_OPTIONS is new and I thought it might prevent AC from waiting for a GCS and just go ahead and use the preloaded terrain data, but it appears to prevent all terrain activity - I’ll test more.

EDIT: the whole time there is “PreArm: Waiting for Terrain data” and we cant arm.
I will also retest with TERRAIN_SPACING,100 and LOG_DISARMED
Any hints, suggestions or otherwise are welcomed.

EDIT: TERRAIN_SPACING,100 and LOG_DISARMED didnt offer any insights. There doesnt appear to be anything special in the .bin file except the recurring “Waiting for Terrain data” message.
Anyone that’s familiar with how this works can feel free to ask for logs or other info.

EDIT with apparent solution:
EDIT again - still inconsistent results, NOT solved
This quad without telemtry was able to successfully download terrain data over USB once I disabled the batch logging for Harmonic Notch filter:
INS_LOG_BAT_MASK,0
INS_LOG_BAT_OPT,0
…since Harmonic notch filter was already set up and working OK.
I presume there was just too much activity going on for the poor old Pixfalcon (FMUv2).

Log downloads via USB are now OK too, was a bit dodgy before.

Another quad with telemetry quickly gets “ter_pend” to 0 and “ter_load” 672 with TERRAIN_SPACING,30
We will try test flights tomorrow with and without telemetry.

EDIT: tested this one all OK with and without telemetry. Terrain data remained in place and seemed to be working OK.

FC was CUAV V5 Nano
Harmonic notch filter batch logging or anything else didnt seem to impede the ability to download or retain terrain data.

hello help, i can’t figure out the problem. everything was done according to the instructions, but the terrain folder does not load files, more precisely, one with the name n68e033 is loaded. this file is empty. I went to a site where you can generate tile files but I can not select my coordinates. I am on the Kola Peninsula