I am using the [SparkFun JetBot AI Kit v3.0 (Without Jetson Nano) with a Jetson Nano 2GB I bought separately. I downloaded the [sparkfun_2GB_jetbot_v00-02_linux.zip image and wrote this to the provided SD card. I followed the SparkFun assembly and setup guide and got the basic motion and teleoperation examples working without issue.
However, the collision avoidance “live_demo.ipynb” example does not show updated camera images in the camera widget in the Jupyter notebook, and the robot does not move. I see the following error message printed under the 5th block of code, which creates the camera and slider widgets:
Error loading module `ublox_gps`: No module named 'serial'
The widgets are still created and appear below the error message. At this stage, the camera image in the widget gets updated as I move the robot around by hand. The camera image stops being updated after running the 7th code block, which defines the “update” function.
Thinking that the missing “serial” module might be the cause of the issue, I manually installed it with pip3 as the jetbot user:
sudo pip3 install serial
I restarted the Jetson Nano and re-ran the code, but the above error message still appears.
Does anyone have any suggestions on how to solve this problem?](https://sfecdn.s3.amazonaws.com/jetbot/sparkfun_2GB_jetbot_v00-02_linux.zip)](SparkFun JetBot AI Kit v3.0 (Without Jetson Nano) - KIT-18487 - SparkFun Electronics)
Try to comment-out the line that imports the ublox_gps module, or try comment out that specific code? (Use “#” at the beginning of the line to accomplish this)
Thanks for the suggestion, but the ublox_gps module is never imported directly. The code is here: https://github.com/NVIDIA-AI-IOT/jetbot … demo.ipynb
The imports I can see in the code blocks are:
import torch
import torchvision
import cv2
import numpy as np
import traitlets
from IPython.display import display
import ipywidgets.widgets as widgets
from jetbot import Camera, bgr8_to_jpeg
from jetbot import Robot
import torch.nn.functional as F
import time
Do you know which import might be referencing the ublox_gps module?
I solved the “No module named ‘serial’” error by running pip3 install serial
in the terminal in Jupyter. This causes the command to run inside the Jupyter Docker Container. Previously I had been running the pip3 command via SSH as the jetbot user, which is why it had no effect.
However, that had no impact on the camera freezing. I found a related thread on the Nvidia forum [Rpi v2 CSI camera freezes with Jetson Nano 2GB and surmised that the problem was insufficient memory. I fixed the issue by adding 6GB swap space, reducing other memory usage, then allocating 8G swap space to the jetbot_jupyter container:
# Disable ZRAM:
sudo systemctl disable nvzramconfig
# Prevent X-Server from starting:
sudo systemctl set-default multi-user.target
# Create additional 6GB swap file
sudo fallocate -l 6G /mnt/6GB.swap
sudo chmod 600 /mnt/6GB.swap
sudo mkswap /mnt/6GB.swap
# Append the following line to /etc/fstab
sudo su
echo "/mnt/6GB.swap swap swap defaults 0 0" >> /etc/fstab
exit
# REBOOT
# Check swap space
free -h
cd jetbot/docker
./disable.sh
# Edit configure.sh to change export JETBOT_JUPYTER_MEMORY_SWAP from 3G to 8G
# Edit enable.sh to comment out ./display/enable.sh since the display takes up extra memory for little benefit
./enable.sh
](Rpi v2 CSI camera freezes with Jetson Nano 2GB - Jetson Nano - NVIDIA Developer Forums)