def METHOD_NAME(self, command: str, wait: float = WAIT) -> Iterator[str]:
    logger.debug("exec_command(%s)", command)
    with self.serial.lock:
        drain_serial(self.serial)
        self.serial.write(f"{command}\r".encode("ascii"))
        sleep(wait)
        retries = 0
        max_retries = _max_retries(self.bandwidth, self.datapoints)
        logger.debug("Max retries: %s", max_retries)
        while True:
            line = self.serial.readline()
            line = line.decode("ascii").strip()
            if not line:
                retries += 1
                if retries > max_retries:
                    raise IOError("too many retries")
                sleep(wait)
                continue
            if line == command:  # suppress echo
                continue
            if line.startswith("ch>"):
                logger.debug("Needed retries: %s", retries)
                break
            yield line