About jetson reboot, when I use camera function

please teach me about ‘https://github.com/NVIDIA-AI-IOT/jetbot/wiki/examples

(https://www.sparkfun.com/products/18486#documents-tab)

I want to use camera function.

Jetson reboots when camera function is used.

For example, When I try to run the code given below,

jetson restarts…


directory:Notebooks/collision_avoidance/data_collection.ipynb

import traitlets

import ipywidgets.widgets as widgets

from IPython.display import display

from jetbot import Camera, bgr8_to_jpeg

camera = Camera.instance(width=224, height=224)

image = widgets.Image(format=‘jpeg’, width=224, height=224) # this width and height doesn’t necessarily have to match the camera

camera_link = traitlets.dlink((camera, ‘value’), (image, ‘value’), transform=bgr8_to_jpeg)

display(image)


why?

It could be a few things…

Be sure to install the modification files mentioned toward the bottom here https://learn.sparkfun.com/tutorials/as … rom-nvidia

Do the other preceding notebooks (1&2) work?

Can you run the camera at all? Motors?

Also be sure the camera’s connectors/cable are facing the correct way and secure

thank you for your reply.

I ran the below command.

ーーーーー

git clone https://github.com/NVIDIA-AI-IOT/jetbot

cd jetbot

sudo python3 setup.py install

sudo apt-get install rsync

rsync jetbot/notebooks ~/Notebooks

sudo nvpmodel -m1

sudo nvpmodel -q

ーーーーーー

the motor can move.(notebook1,Example 1 - Basic Motion)

It is confirmed that the camera also projects in a different way

Be sure to install the modification files mentioned toward the bottom here https://learn.sparkfun.com/tutorials/as … rom-nvidia

oh…I’m sorry.

I can not confirmed!!I’ll try .

Be sure to install the modification files mentioned toward the bottom here https://learn.sparkfun.com/tutorials/as … rom-nvidia

I could not do it…

I have two concern…

・About 「Replace the old notebooks with the new notebooks by entering」(https://github.com/NVIDIA-AI-IOT/jetbot … ware-setup)

jetbot@jetson-4-3:~/jetbot$ rsync jetbot/notebooks ~/Notebooks

rsync: link_stat “/home/jetbot/jetbot/jetbot/notebooks” failed: No such file or directory (2)

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]

・About Basic Motion

[2]robot = Robot()


OSError Traceback (most recent call last)

in

----> 1 robot = Robot()

/usr/local/lib/python3.6/dist-packages/jetbot-0.4.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)

229 self.motors = [ Adafruit_DCMotor(self, m) for m in range(4) ]

230 self.steppers = [ Adafruit_StepperMotor(self, 1), Adafruit_StepperMotor(self, 2) ]

→ 231 self._pwm = PWM(addr, debug=False, i2c=i2c, i2c_bus=i2c_bus)

232 self._pwm.setPWMFreq(self._frequency)

233

/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)

57 self.i2c = get_i2c_device(address, i2c, i2c_bus)

58 logger.debug(“Reseting PCA9685 MODE1 (without SLEEP) and MODE2”)

—> 59 self.setAllPWM(0, 0)

60 self.i2c.write8(self.__MODE2, self.__OUTDRV)

61 self.i2c.write8(self.__MODE1, self.__ALLCALL)

/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)

93 def setAllPWM(self, on, off):

94 “Sets a all PWM channels”

—> 95 self.i2c.write8(self.__ALL_LED_ON_L, on & 0xFF)

96 self.i2c.write8(self.__ALL_LED_ON_H, on >> 8)

97 self.i2c.write8(self.__ALL_LED_OFF_L, off & 0xFF)

/usr/local/lib/python3.6/dist-packages/Adafruit_GPIO-1.0.4-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-1.0.4-py3.6.egg/Adafruit_PureIO/smbus.py in write_byte_data(self, addr, cmd, val)

266 # Send the data to the device.

267 self._select_device(addr)

→ 268 self._device.write(data)

269

270 def write_word_data(self, addr, cmd, val):

OSError: [Errno 121] Remote I/O error

★★solution:sudo pip install pyserial

About image

It’s OK?

jetbot_image_v0p4p0.zip(https://github.com/NVIDIA-AI-IOT/jetbot … ware-setup)

I use Jetson Nano 4G

I’m sorry.

I could resolve this problem.

Thank you.

For the latest instructions, follow this guide: https://jetbot.org/master/

You’ll have to install the [SparkFun Qwiic Python package, but the code changes for our hardware should have been [pulled into the Nvidia’s jetbot repo.

Additionally, I would recommend using [iPython to exceute lines individually instead of the enitre cell of the Jupyter notebook. Jupyter notebook doesn’t always show all the error messages and executing each line individually will help you isolate where the error is occuring (i.e. which instruction is cauing it).](IPython Documentation — IPython 8.26.0 documentation)](Add SparkFun hardware support by santaimpersonator · Pull Request #467 · NVIDIA-AI-IOT/jetbot · GitHub)](GitHub - sparkfun/Qwiic_Py: Python package for the qwiic system.)

I appreciate your kind and information.

I want to execute train_model.ipynb.

But I got an error as below.

Why?num_samples=0?

‘dateset.zip’ has been obtained by ‘data_collection.ipynb’


train_loader = torch.utils.data.DataLoader(

train_dataset,

batch_size=16,

shuffle=True,

num_workers=4

)

test_loader = torch.utils.data.DataLoader(

test_dataset,

batch_size=16,

shuffle=True,

num_workers=4

)



ValueError Traceback (most recent call last)

in

3 batch_size=16,

4 shuffle=True,

----> 5 num_workers=4

6 )

7

/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py in init(self, dataset, batch_size, shuffle, sampler, batch_sampler, num_workers, collate_fn, pin_memory, drop_last, timeout, worker_init_fn, multiprocessing_context)

211 else: # map-style

212 if shuffle:

→ 213 sampler = RandomSampler(dataset)

214 else:

215 sampler = SequentialSampler(dataset)

/usr/local/lib/python3.6/dist-packages/torch/utils/data/sampler.py in init(self, data_source, replacement, num_samples)

92 if not isinstance(self.num_samples, int) or self.num_samples <= 0:

93 raise ValueError("num_samples should be a positive integer "

—> 94 “value, but got num_samples={}”.format(self.num_samples))

95

96 @property

ValueError: num_samples should be a positive integer value, but got num_samples=0


Sorry, It’s resolved.

Oh, cool. Glad you were able to figure it out on your own!

Thank you:man_bowing:

Is it possible to implement collision avoidance and automatic driving on a container? I am investigating this,

I was able to confirm by referring to the manual that collision avoidance and automatic driving are possible on the host OS.

https://github.com/NVIDIA-AI-IOT/jetbot … ware-setup

Is this link implemented in docker?

It is a recognition implemented in the host OS.

jetbot@jetson-4-3:~$ sudo docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

jetbot@jetson-4-3:~$

sorry for my lack of knowledge:man_bowing:

Again, I wouldn’t follow the instructions from the GitHub wiki. They are older instructions for an older version of the software.

I would focus on the information from the jetbot.org website. They have some information here regarding that question: https://jetbot.org/master/examples/comm … mples.html

Also the information there, indicates that the “jetbot” software is already running in a docker container: https://jetbot.org/master/software_setup/docker.html

Also, most of our expertise will be limited to assemblying our kit and getting started with their examples. I would recommend the [Nvidia forum for more technical questions.](Jetson Nano - NVIDIA Developer Forums)

.

No jetbot on container,

jetbot@jetson-4-3:~$ sudo docker run -it --rm -v $HOME:$HOME -v /usr/local/lib/python3.6/dist-packages:/usr/local/lib/python3.6/dist-packages --device /dev/i2c-1 --privileged --entrypoint /bin/bash python:3

root@9eae61bc7e45:/# python3 a.py

Traceback (most recent call last):

File “//a.py”, line 2, in

from jetbot import Robot

ModuleNotFoundError: No module named ‘jetbot’

root@9eae61bc7e45:/#

jetbot@jetson-4-3:~$ more a.py

import time

from jetbot import Robot

robot = Robot()

robot.forward(0.3)

time.sleep(3)

robot.stop()

Again, I wouldn’t follow the instructions from the GitHub wiki. They are older instructions for an older version of the software.

I would focus on the information from the jetbot.org website. They have some information here regarding that question: https://jetbot.org/master/examples/comm … mples.html

Also the information there, indicates that the “jetbot” software is already running in a docker container: https://jetbot.org/master/software_setup/docker.html

Also, most of our expertise will be limited to assemblying our kit and getting started with their examples. I would recommend the Nvidia forum for more technical questions.

sorry, I just realized now.

aok:
I’m sorry.

I could resolve this problem.

Thank you.

Hi,

Could you pls tell how you solved this?

Thanks in advance