Pionic hydrogen and deuterium