The invention relates to compound of the formula I (I) or a salt thereof, wherein the substituents are as defined in the specification; to its preparation and to medicaments comprising it for treating diseases connected to the inhibition of H3 receptor.