Cold traps allow for highly accurate rotational spectroscopy of ions. Six rotational transitions of H2D+ and D2H+ have been measured. The 211 ← 212 transition of H2D+ has been detected for the first time. For H2D+ and D2H+ improved sets of spectroscopic parameters were obtained.