Electronic and magnetic properties of57Fe in NiCl2, NiBr2, NiI2and CoI2from Mossbauer spectroscopy