JetBot Examples doesn't work

I tried to run Jetbot’s ‘Example 1 - Basic Motion’ but encountered an error after ‘robot.left(speed=0.3)’


OSError Traceback (most recent call last)
in
----> 1 robot.left(speed=0.3)

/usr/local/lib/python3.6/dist-packages/jetbot-0.3.0-py3.6.egg/jetbot/robot.py in left(self, speed)
37
38 def left(self, speed=1.0):
—> 39 self.left_motor.value = -speed
40 self.right_motor.value = speed
41

/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in set(self, obj, value)
582 raise TraitError(‘The “%s” trait is read-only.’ % self.name)
583 else:
→ 584 self.set(obj, value)
585
586 def _validate(self, obj, value):

/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in set(self, obj, value)
571 # we explicitly compare silent to True just in case the equality
572 # comparison above returns something other than True/False
→ 573 obj._notify_trait(self.name, old_value, new_value)
574
575 def set(self, obj, value):

/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
1203 new=new_value,
1204 owner=self,
→ 1205 type=‘change’,
1206 ))
1207

/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in notify_change(self, change)
1208 def notify_change(self, change):
1209 “”“Notify observers of a change event”“”
→ 1210 return self._notify_observers(change)
1211
1212 def _notify_observers(self, event):

/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in _notify_observers(self, event)
1245 c = getattr(self, c.name)
1246
→ 1247 c(event)
1248
1249 def _add_notifiers(self, handler, name, type):

/usr/local/lib/python3.6/dist-packages/jetbot-0.3.0-py3.6.egg/jetbot/motor.py in _observe_value(self, change)
22 @traitlets.observe(‘value’)
23 def _observe_value(self, change):
—> 24 self._write_value(change[‘new’])
25
26 def _write_value(self, value):

/usr/local/lib/python3.6/dist-packages/jetbot-0.3.0-py3.6.egg/jetbot/motor.py in _write_value(self, value)
30 self._motor.setSpeed(speed)
31 if mapped_value < 0:
—> 32 self._motor.run(Adafruit_MotorHAT.FORWARD)
33 else:
34 self._motor.run(Adafruit_MotorHAT.BACKWARD)

/usr/local/lib/python3.6/dist-packages/Adafruit_MotorHAT-1.4.0-py3.6.egg/Adafruit_MotorHAT/Adafruit_MotorHAT_Motors.py in run(self, command)
198 return
199 if (command == Adafruit_MotorHAT.FORWARD):
→ 200 self.MC.setPin(self.IN2pin, 0)
201 self.MC.setPin(self.IN1pin, 1)
202 if (command == Adafruit_MotorHAT.BACKWARD):

/usr/local/lib/python3.6/dist-packages/Adafruit_MotorHAT-1.4.0-py3.6.egg/Adafruit_MotorHAT/Adafruit_MotorHAT_Motors.py in setPin(self, pin, value)
238 raise NameError(‘Pin value must be 0 or 1!’)
239 if (value == 0):
→ 240 self._pwm.setPWM(pin, 0, 4096)
241 if (value == 1):
242 self._pwm.setPWM(pin, 4096, 0)

/usr/local/lib/python3.6/dist-packages/Adafruit_MotorHAT-1.4.0-py3.6.egg/Adafruit_MotorHAT/Adafruit_PWM_Servo_Driver.py in setPWM(self, channel, on, off)
88 self.i2c.write8(self.__LED0_ON_L+4channel, on & 0xFF)
89 self.i2c.write8(self.__LED0_ON_H+4
channel, on >> 8)
—> 90 self.i2c.write8(self.__LED0_OFF_L+4channel, off & 0xFF)
91 self.i2c.write8(self.__LED0_OFF_H+4
channel, off >> 8)
92

/usr/local/lib/python3.6/dist-packages/Adafruit_GPIO-1.0.3-py3.6.egg/Adafruit_GPIO/I2C.py in write8(self, register, value)
114 “”“Write an 8-bit value to the specified register.”“”
115 value = value & 0xFF
→ 116 self._bus.write_byte_data(self._address, register, value)
117 self._logger.debug(“Wrote 0x%02X to register 0x%02X”,
118 value, register)

/usr/local/lib/python3.6/dist-packages/Adafruit_PureIO-0.2.3-py3.6.egg/Adafruit_PureIO/smbus.py in write_byte_data(self, addr, cmd, val)
254 # Send the data to the device.
255 self._select_device(addr)
→ 256 self._device.write(data)
257
258 def write_word_data(self, addr, cmd, val):

OSError: [Errno 121] Remote I/O error

You can check the wire connections under your jetbot. Follow the hardware part of the wiki. The plug pin is easy to split off.

Hi vonszt,

Seems like there’s an issue writing over I2C. This most likely indicates a wiring issue with the Motor Driver. A couple things to check.

  1. Are the SDA / SCL (the yellow / orange wires in setup guide) reversed?
  2. Are 3.3V / GND soldered in the correct position on the Motor Driver board? Please note, the 3.3V pin isn’t the corner pin on motor driver board, it’s actually offset by 1 pin.

Best,
John

Hi jaybdub,

I have the same error as above,

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-5-b418ad9f6ab3> in <module>
----> 1 robot = Robot()

/usr/local/lib/python3.6/dist-packages/jetbot-0.3.0-py3.6.egg/jetbot/robot.py in __init__(self, *args, **kwargs)
     20     def __init__(self, *args, **kwargs):
     21         super(Robot, self).__init__(*args, **kwargs)
---> 22         self.motor_driver = Adafruit_MotorHAT(i2c_bus=self.i2c_bus)
     23         self.left_motor = Motor(self.motor_driver, channel=self.left_motor_channel, alpha=self.left_motor_alpha)
     24         self.right_motor = Motor(self.motor_driver, channel=self.right_motor_channel, alpha=self.right_motor_alpha)

/usr/local/lib/python3.6/dist-packages/Adafruit_MotorHAT-1.4.0-py3.6.egg/Adafruit_MotorHAT/Adafruit_MotorHAT_Motors.py in __init__(self, addr, freq, i2c, i2c_bus)

/usr/local/lib/python3.6/dist-packages/Adafruit_MotorHAT-1.4.0-py3.6.egg/Adafruit_MotorHAT/Adafruit_PWM_Servo_Driver.py in __init__(self, address, debug, i2c, i2c_bus)

/usr/local/lib/python3.6/dist-packages/Adafruit_MotorHAT-1.4.0-py3.6.egg/Adafruit_MotorHAT/Adafruit_PWM_Servo_Driver.py in setAllPWM(self, on, off)

/usr/local/lib/python3.6/dist-packages/Adafruit_GPIO-1.0.3-py3.6.egg/Adafruit_GPIO/I2C.py in write8(self, register, value)
    114         """Write an 8-bit value to the specified register."""
    115         value = value & 0xFF
--> 116         self._bus.write_byte_data(self._address, register, value)
    117         self._logger.debug("Wrote 0x%02X to register 0x%02X",
    118                      value, register)

/usr/local/lib/python3.6/dist-packages/Adafruit_PureIO-0.2.3-py3.6.egg/Adafruit_PureIO/smbus.py in write_byte_data(self, addr, cmd, val)
    254         # Send the data to the device.
    255         self._select_device(addr)
--> 256         self._device.write(data)
    257 
    258     def write_word_data(self, addr, cmd, val):

OSError: [Errno 121] Remote I/O error

and I had check I2C on Jetson (I connect with PCA9658 and don’t connect with OLED)

jetbot@jetbot:~$ sudo i2cdetect -y -r 1
0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

update:
I had control servo using Jetson.GPIO and PCA9685, but As the above case I still have errors.

Help me, please…
Thank you!

[url]http://wiki.sunfounder.cc/images/e/eb/MG_1687.JPG[/url]

I also tried out the same program using the board shown in the link above and got same error(Remote I/O error)

Is there any solution to overcome this error?

Make sure you are carefully matching the motor driver outputs to Nano inputs. You want to make sure you are connecting to pins 1, 3, 5, and 9 in the below link.

Thanks ,but i tried this and got a same error again [ Remote I/O error]

I am trying to set up SparkFun JetBot AI Kit with NVIDIA Jetson Nano.
I am not able to run the 1st experiment called Basic motion through python notebook.

I have made sure the soldering is correct on the motor driver board, I can see red LED blinking every 2.5 seconds (working normally).
The connection from Micro OLED to motor driver is correct (Yellow to “SCL,” Blue to “SDA,” Black to “GND”)

I also tested motors separately (They work by powering through my AA batteries)

I don’t get any errors while initializing the robot and calling methods right and left by passing speed arguments. It’s just that the robot doesn’t do anything.

Can somebody help how can I debug my setup ?

Hey I’m experiencing the exact same issue as abhinavmasters on a brand new Sparkfun Jetbot that I just setup.

I even tested running jupyter notebook on the Ubuntu OS that is on the NVIDIA board. You just need to open a browser in Ubuntu and navigate to the loopback interface (127.0.0.1 or something) to get to the notebook. The code in the example program executes successfully with no error but the motors do not turn.

My next step in debugging is to reflash the OS onto the micro SD with step 1 of these instructions: [url]Software Setup · NVIDIA-AI-IOT/jetbot Wiki · GitHub

Or I could try the jetbot image: [url]Assembly Guide for SparkFun JetBot AI Kit - learn.sparkfun.com

Another debugging step that I cannot perform is to make sure the sparkfun motor controller works. The example 1 from this tutorial: [url]https://learn.sparkfun.com/tutorials/serial-controlled-motor-driver-hookup-guide[/url] would be the way to do that but I don’t have the correct board to test it.

Hey Guys,
I am also experiencing the exact same issue.
Did anyone get a hold of it ?
Anyhelp would be appreciated.

Thanks

I figured it out.
For me I needed to solder three more joints on the back of the motor controller. The instructions are the second picture in step 3 of the assembly guide [url]https://learn.sparkfun.com/tutorials/assembly-guide-for-sparkfun-jetbot-ai-kit/all[/url].
Must’ve missed that when I went through the tutorial…

@rptallman
Are you talking about this step which you missed?

You will need to create a solder jumper on pad #3 only for the SparkFun Jetbot Image to work properly.

Yes the whole thing.

You will need to solder both triple jumpers labeled below as "I2C pull-up enable jumpers" as the SparkFun pHat utilizes the I2C protocol. 
The default I2C address that is used by the pre-flashed SparkFun Jetbot image is 0x5D which is equavalent to soldering pad #3 noted as "configuration bits" on the back of the SparkFun serial controlled motor driver; see below. 
You will need to create a solder jumper on pad #3 only for the SparkFun Jetbot Image to work properly

Maybe I don’t need the solder jumper on pad #3 since we are running an NVIDIA image?

It finally worked for me.

I just needed to created a solder jumper on pad #3. I wished the original documentation had a picture of explicitly soldering jumper on pad#3.

https://learn.sparkfun.com/tutorials/assembly-guide-for-sparkfun-jetbot-ai-kit/3-motor-driver-assembly--configuration