Welcome to DOFBOT-JetsonNANO repository
1.Manage APP control service
Disable Startup Programs
Disable Startup ProgramsRaspberry PiTemporarily Disable Startup ProgramsDocker BasicsEntering the Same Container from Multiple TerminalsRunning the scriptPermanently Disable the Startup ProgramExiting the ContainerRunning in the ForegroundRunning in the BackgroundStartup ScriptModifying the Startup ScriptRun the Startup ScriptDisable the Docker Autostart ScriptRestore Docker Startup Script
Since our image is factory-configured to start with a startup program, running other examples without disabling it will result in some abnormal errors!
The method for disabling startup programs on Raspberry Pi and Jetson motherboards using Dofbot is the same!
Raspberry Pi
Temporarily Disable Startup Programs
Docker Basics
This section only introduces some Docker commands; for more detailed information, please refer to the Docker chapter tutorial.
Entering the Same Container from Multiple Terminals
Since our system automatically starts a specific container upon boot, we need to enter the same container to run the script that disables startup programs.
docker ps
Used to list currently running containers.
docker run
Used to create and start a new container instance.
xxxxxxxxxx#Start a container in interactive mode and execute the `/bin/bash` command inside the containerdocker exec -it 820a4376b538 /bin/bash

Running the script
xcd /root/APP_DOFBOT/sh kill_app.sh

Temporarily stopping a large program only takes effect in the currently running container. If you restart the container yourself using a script, Docker will rerun the large program at startup!
xxxxxxxxxxThe script that starts the large program is added to the .bashrc file inside Docker. Therefore, every time a new container starts, the large program runs at startup. If multiple containers are started and not properly shut down, the large program will display a message indicating that the port is in use!
Permanently Disable the Startup Program
Since our large-scale startup program is configured within the .bashrc file, we need to either comment out or delete the lines in .bashrc that relate to YahboomArm.pyc. This content is located at the very bottom of the file.

Once the modifications are complete, we need to commit a new version of the Docker image:
First, check the currently running containers:
xxxxxxxxxxdocker ps
docker commit
This command is used to save the current state of a container as a new image. Since tags such as 1.0 and dofbot already exist within the Docker environment, I will demonstrate this process using the tag dofbot_v1.0.
xxxxxxxxxx# docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]docker commit 820a4376b538 192.168.2.51:5000/dofbot_ai:V1
Exiting the Container
Running in the Foreground
If the container is currently running in the foreground, you can simply type exit in the terminal to quit!

Running in the Background
docker stop
This command is used to stop a specified container.
xxxxxxxxxx# docker stop [OPTIONS] CONTAINERdocker stop 632bb2472420

Startup Script
Modifying the Startup Script
The startup script for automatic execution upon boot: Docker_Ros.sh
x#!/bin/bash# Wait for the Docker service to startwhile true; doif systemctl is-active --quiet docker; thenecho "Docker service has been started"breakelseecho "The Docker service has not started, waiting..."sleep 1fidone# Docker startxhost +docker run -it --rm \--privileged=true \--net=host \--env="DISPLAY" \--env="QT_X11_NO_MITSHM=1" \-v /tmp/.X11-unix:/tmp/.X11-unix \--security-opt apparmor:unconfined \-v /home/pi/Temp:/root/Temp \--device=/dev/video0 \--device=/dev/i2c-1 \192.168.2.51:5000/dofbot_ai:3.0.1 /bin/bash
Update to the new Docker image we just submitted:
xxxxxxxxxx#!/bin/bash# Wait for the Docker service to startwhile true; doif systemctl is-active --quiet docker; thenecho "Docker service has been started"breakelseecho "The Docker service has not started, waiting..."sleep 1fidone# Docker startxhost +docker run -it --rm \--privileged=true \--net=host \--env="DISPLAY" \--env="QT_X11_NO_MITSHM=1" \-v /tmp/.X11-unix:/tmp/.X11-unix \--security-opt apparmor:unconfined \-v /home/pi/Temp:/root/Temp \--device=/dev/video0 \--device=/dev/i2c-1 \192.168.2.51:5000/dofbot_ai:V1 /bin/bash
Run the Startup Script
xxxxxxxxxx./Docker_Ros.sh
This prevents the large startup application from launching. If you do need to launch the large startup application, simply modify the specified container within the Docker_Ros.sh script to use the factory default image.
That's all there is to it!
Disable the Docker Autostart Script
Enter the following command to restart:
xxxxxxxxxx#RaspberryPi5sudo rm -rf /home/pi/.config/autostart/Docker_Ros.desktop#jetson—nanosudo rm -rf /home/jetson/.config/autostart/Docker_Ros.desktop

Restore Docker Startup Script
Enter the command below to restart:
xxxxxxxxxx#RaspberryPi5sudo cp Docker_Ros.desktop /home/pi/.config/autostart/#jetson-nanosudo cp Docker_Ros.desktop /home/jetson/.config/autostart/
