Skip to content

OSError exception [Errno 4] EINTR when running motors in EV3 #727

Open
@orioldelos

Description

@orioldelos
  • ev3dev version: PASTE THE OUTPUT OF uname -r HERE
    4.14.117-ev3dev-2.3.4-ev3
  • ev3dev-lang-python version: INSERT ALL VERSIONS GIVEN BY dpkg-query -l {python3,micropython}-ev3dev* HERE
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                  Version         Architecture    Description
+++-=====================-===============-===============-================================================
ii  micropython-ev3dev2   2.0.0           all             Python language bindings for ev3dev for MicroPyt
ii  python3-ev3dev        1.2.0           all             Python language bindings for ev3dev
ii  python3-ev3dev2       2.0.0           all             Python language bindings for ev3dev

I have the following code runing on a thread in micropython with the only intention of moving the motor back and forth:

 while not self.timeToStop:
            try:
                self.sonarmotor.on_to_position(motorspeed,sweepangle/2)
                self.sonarmotor.on_to_position(motorspeed,-sweepangle/2)
            except OSError as e:
                type, value, traceback = sys.exc_info()
                logging.info("------------------------------------------Motor Exception: ")
                logging.info("Type:" + str(type))
                logging.info("Value:" + str(value))
                logging.info(str(traceback))

I was forced to handle the exception to avoid the aplication from aborting each time an OSError exception [Errno 4] EINTR was thrown.

I believe this might be a bug. Am I running the latest versions of Ev3dev2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions