Electron spin resonance of Eu and Gd ions in SmB6