Introduction
This article describes the provisioning instructions for Maivin with EdgeFirst Middleware. This is necessary after Updating Torizon for Maivin, which itself must be followed after performing a Maivin System Recovery.
Each Maivin ships from Au-Zone with this provisioning already performed, but if you ever perform a system recovery you will need to repeat these steps to get your Maivin in the correct operating configuration.
If you don't know what kind of Maivin you have, refer to the How to Identify Your Maivin page.
The following commands require you to SSH into the Maivin.
Procedure
Configure the Appropriate Maivin Device Tree Overlays
To configure the camera drivers, you will need to create or edit (as root) the contents of the /etc/overlays.txt file. Once the file has been edited, you will need to reboot the device and allow it time to perform an auto-reboot. Once that is finished, you should be able to list the appropriate video device file and confirm the contents of the overlays files in the OS Tree directory.
Maivin |
Contents of /etc/overlays.txt |
/dev/videoX |
Maivin 1 | fdt_overlays=maivin1.dtbo maivin1-ar0541.dtbo | 4 |
Maivin 1 w/Omni |
fdt_overlays=maivin1.dtbo maivin1-os08a20.dtbo |
2 |
Maivin 2 |
fdt_overlays=maivin2.dtbo maivin2-os08a20.dtbo |
3 |
For example, for a Maivin 2:
torizon@verdin-imx8mp-15139764:~$ ls /dev/video*
/dev/video0 /dev/video1 /dev/video2 /dev/video3
and:
torizon@verdin-imx8mp-15139764:~$ cat /boot/ostree/torizon-*/dtb/overlays.txt
fdt_overlays=maivin2.dtbo maivin2-os08a20.dtbo
fdt_overlays=maivin2.dtbo maivin2-os08a20.dtbo
NOTE: Ensure the correct overlays are included if the Maivin was configured with an additional peripheral such as Modem or Neural Network Accelerator.
Maivin SD Card Formatting
If the Maivin comes with an SD Card, you will need to format and mount it. To do this, follow the instructions in the link above. If you don't know if you have an SD Card, run the command below; you have an SD Card if the output looks like:
torizon@verdin-imx8mp-15141030:~$ ls /dev/mmcblk1p1
/dev/mmcblk1p1
else:
torizon@verdin-imx8mp-07011868:~$ ls /dev/mmcblk1p1
ls: cannot access '/dev/mmcblk1p1': No such file or directory
When formatting your SD card, it is important to follow the final, optional step to allow the torizon user write access to the SD card.
Configure the EdgeFirst Services
The EdgeFirst services use systemd to manage their states. A quick overview of the commands necessary to follow the instructions below are included in the following table.
If you wish to... |
Run the following command... |
Start the camera service | sudo systemctl start camera |
Restart the camera service | sudo systemctl restart camera |
Stop the detect service | sudo systemctl stop detect |
Get the status of the recorder service | systemctl status recorder |
Enable the recorder service to start at boot | sudo systemctl enable recorder |
Disable the IMU service from starting at boot | sudo systemctl disable imu |
Some of the EdgeFirst Services have default configuration files associated with them, located at:
- /usr/etc/default/camera
- /usr/etc/default/recorder
- /usr/etc/default/detect
- /usr/etc/zenohd.yaml
Running a difference on the defaults with the respective running configuration files is a good idea when upgrading from one release to another.
torizon@verdin-imx8mp-07011868:~$ diff -sU 0 /usr/etc/default/camera /etc/default/camera
--- /usr/etc/default/camera
+++ /etc/default/camera
@@ -4 +4 @@
-CAMERA = "/dev/video3"
+CAMERA = "/dev//dev/video4"
@@ -11 +11 @@
-CAMERA_SIZE = "1920 1080"
+CAMERA_SIZE = "640 480"
@@ -17 +17 @@
-STREAM_SIZE = "1920 1080"
+STREAM_SIZE = "640 480"
It should be noted that new releases of EdgeFirst may have more options in available in the newer configuration files; but copying these new configuration files will overwrite the current running configurations. The files should be checked and differences understood before copying new files.
The Maivin Camera Service
The first service to configure is the Maivin Camera Service. The configuration file for the camera service is located at /etc/default/camera and must be edited as root. The most important option to configure is to make sure the CAMERA option is configured to the correct video device as noted above.
If you have a Maivin 1 with the AR0541 camera sensor, configure the CAMERA_SIZE and STREAM_SIZE options as well.
Once the camera service is configured, restart it.
sudo systemctl restart camera
Confirm the service is running:
torizon@verdin-imx8mp-15141030:~$ systemctl status camera
● camera.service - Maivin Camera Service
Loaded: loaded (/usr/lib/systemd/system/camera.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2024-03-21 19:42:35 UTC; 4 days ago
Main PID: 790 (camera)
Tasks: 20 (limit: 4072)
Memory: 41.8M
CGroup: /system.slice/camera.service
└─ 790 /usr/bin/camera
Notice: journal has been rotated since unit was started, output may be incomplete.
The Maivin Detection Service
By default, there should be no reconfigurations necessary for the Detect Service. Confirm the service is running:
torizon@verdin-imx8mp-15141030:~$ systemctl status detect
● detect.service - Maivin Detection Service
Loaded: loaded (/usr/lib/systemd/system/detect.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2024-03-21 19:42:35 UTC; 4 days ago
Main PID: 791 (detect)
Tasks: 20 (limit: 4072)
Memory: 114.8M
CGroup: /system.slice/detect.service
└─ 791 /usr/bin/detect
Notice: journal has been rotated since unit was started, output may be incomplete.
The Maivin Detection UI Application
Ensure that the Maivin Detection UI Application is up and running and showing a live camera stream, live detection, and a stable framerate of 30 FPS.
systemctl status detectionui
The Maivin IMU Service
If this is a Maivin 2 or Maivin 1 with IMU + GPS expansion board, confirm the service is running:
torizon@verdin-imx8mp-15141030:~$ systemctl status imu
● imu.service - Maivin IMU Service
Loaded: loaded (/usr/lib/systemd/system/imu.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2024-03-21 19:42:35 UTC; 4 days ago
Main PID: 792 (imu)
Tasks: 16 (limit: 4072)
Memory: 10.6M
CGroup: /system.slice/imu.service
└─ 792 /usr/bin/imu
Notice: journal has been rotated since unit was started, output may be incomplete.
Otherwise, stop and disable the service and confirm it is stopped:
torizon@verdin-imx8mp-07011868:~$ systemctl status imu
○ imu.service - Maivin IMU Service
Loaded: loaded (/usr/lib/systemd/system/imu.service; disabled; vendor preset: enabled)
Active: inactive (dead)
The Maivin NavSat Service
If this is a Maivin 2 or Maivin 1 with IMU + GPS expansion board, confirm the service is running:
torizon@verdin-imx8mp-15141030:~$ systemctl status navsat
● navsat.service - Maivin NavSat Service
Loaded: loaded (/usr/lib/systemd/system/navsat.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2024-03-21 19:42:35 UTC; 4 days ago
Main PID: 793 (navsat)
Tasks: 16 (limit: 4072)
Memory: 7.6M
CGroup: /system.slice/navsat.service
└─ 793 /usr/bin/navsat
Notice: journal has been rotated since unit was started, output may be incomplete.
Otherwise, stop and disable the service and confirm it is stopped:
torizon@verdin-imx8mp-07011868:~$ systemctl status navsat
○ navsat.service - Maivin NavSat Service
Loaded: loaded (/usr/lib/systemd/system/navsat.service; disabled; vendor preset: enabled)
Active: inactive (dead)
This service requires the GPS Daemon Service (gpsd), so confirm its status as well. It should be running for Maivin 2 and Maivin 1 with IMU + GPS expansion boards and disabled for Maivin 1 without.
The Zenoh Message Router Service
Confirm this service (zenohd) is running.
Maivin Dataset Recording Service
This service should not be running by default as the resultant MCAP files can grow large enough to fill the Maivin's hard drive. The configuration file for this service is located at /etc/default/recorder . If the device has a SD Card that's formatted, the STORAGE setting should point to the new SD Card mount point.
STORAGE = "/media/DATA/recordings"
If the Maivin is a Maivin 1 without IMU + GPS expansion boards, remove the /imu and /gps topics.
TOPICS = "/camera/info /camera/h264 /detect/boxes2d"
Comments
0 comments
Please sign in to leave a comment.