Grove Mini Motor Error

Hi
I am trying the"/GrovePi/Software/Python/grove_mini_motor_driver/driver_example.py" file. However, I keep receiving the errors (see below)

Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "copyright", "credits" or "license()" for more information.
>>> 
 RESTART: /home/pi/Desktop/GrovePi/Software/Python/grove_mini_motor_driver/driver_example.py 
[04-Apr-2019 18:30:03.885318][forward][speed = 0%]
[04-Apr-2019 18:30:03.911064][left motor warning][undervoltage lockout]
[IO Error]
Exception ignored in: <bound method DRV8830.__del__ of <grove_mini_motor_driver.DRV8830 object at 0x751d23b0>>
Traceback (most recent call last):
  File "/home/pi/Desktop/GrovePi/Software/Python/grove_mini_motor_driver/grove_mini_motor_driver.py", line 129, in __del__
    self.motorWrite(self.STANDBY)
  File "/home/pi/Desktop/GrovePi/Software/Python/grove_mini_motor_driver/grove_mini_motor_driver.py", line 101, in motorWritePython 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "copyright", "credits" or "license()" for more information.
>>> 
 RESTART: /home/pi/Desktop/GrovePi/Software/Python/grove_mini_motor_driver/driver_example.py 
[04-Apr-2019 18:30:03.885318][forward][speed = 0%]
[04-Apr-2019 18:30:03.911064][left motor warning][undervoltage lockout]
[IO Error]Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "copyright", "credits" or "license()" for more information.
>>> 
 RESTART: /home/pi/Desktop/GrovePi/Software/Python/grove_mini_motor_driver/driver_example.py 
[04-Apr-2019 18:30:03.885318][forward][speed = 0%]
[04-Apr-2019 18:30:03.911064][left motor warning][undervoltage lockout]
[IO Error]
Exception ignored in: <bound method DRV8830.__del__ of <grove_mini_motor_driver.DRV8830 object at 0x751d23b0>>
Traceback (most recent call last):
  File "/home/pi/Desktop/GrovePi/Software/Python/grove_mini_motor_driver/grove_mini_motor_driver.py", line 129, in __del__
    self.motorWrite(self.STANDBY)
  File "/home/pi/Desktop/GrovePi/Software/Python/grove_mini_motor_driver/grove_mini_motor_driver.py", line 101, in motorWrite
    self.bus.write_byte_data(self.address, self.CONTROL_REG, register_value)
  File "/usr/local/lib/python3.5/dist-packages/smbus_cffi-0.5.1-py3.5-linux-armv7l.egg/smbus/util.py", line 59, in validator
    return fn(*args, **kwdefaults)
  File "/usr/local/lib/python3.5/dist-packages/smbus_cffi-0.5.1-py3.5-linux-armv7l.egg/smbus/smbus.py", line 145, in write_byte_data
    raise IOError(ffi.errno)
OSError: 121
Exception ignored in: <bound method DRV8830.__del__ of <grove_mini_motor_driver.DRV8830 object at 0x751d23b0>>
Traceback (most recent call last):
  File "/home/pi/Desktop/GrovePi/Software/Python/grove_mini_motor_driver/grove_mini_motor_driver.py", line 129, in __del__
    self.motorWrite(self.STANDBY)
  File "/home/pi/Desktop/GrovePi/Software/Python/grove_mini_motor_driver/grove_mini_motor_driver.py", line 101, in motorWrite
    self.bus.write_byte_data(self.address, self.CONTROL_REG, register_value)
  File "/usr/local/lib/python3.5/dist-packages/smbus_cffi-0.5.1-py3.5-linux-armv7l.egg/smbus/util.py", line 59, in validator
    return fn(*args, **kwdefaults)
  File "/usr/local/lib/python3.5/dist-packages/smbus_cffi-0.5.1-py3.5-linux-armv7l.egg/smbus/smbus.py", line 145, in write_byte_data
    raise IOError(ffi.errno)
OSError: 121
    self.bus.write_byte_data(self.address, self.CONTROL_REG, register_value)
  File "/usr/local/lib/python3.5/dist-packages/smbus_cffi-0.5.1-py3.5-linux-armv7l.egg/smbus/util.py", line 59, in validator
    return fn(*args, **kwdefaults)
  File "/usr/local/lib/python3.5/dist-packages/smbus_cffi-0.5.1-py3.5-linux-armv7l.egg/smbus/smbus.py", line 145, in write_byte_data
    raise IOError(ffi.errno)
OSError: 121

Please advise

I see your mini motor driver keeps sending you a warning about the left motor. Can you try disconnecting anything that you might have from the driver and see if it starts working?

And also, what’s your current configuration? Could you describe it?

Thank you!

Hi Robert,

I connected the motor to I2C-1 port on Grove Pi Plus. For your information, I didn’t connect anything to any of the motors.

Kityee

I just checked the source code and it seems this exception is raised whenever a warning comes from the motors. So check this out:

So that’s why this is happening. The code is working as expected. It’s the board that’s telling you it’s not working within the right voltages.

I might suggest checking the input voltage on the board and see if it’s within the appropriate range. I’d also connect the motors and see what happens when I run the example script. Here’s also the datasheet of the driver - notice that the UVLO point is found at ~2.5 volts.
http://www.ti.com/lit/ds/slvsab2g/slvsab2g.pdf

Thank you!