I just flashed the ZED Box, installed the drivers, sdk, jetpack… and was trying to use a stereo pair of two zed x mono. I do everything according to the docs, restart the machine and, to my surprise, zed_media_server_cli.service
is not working properly. It starts an endless loop of auto-restarts with the following logs:
user@GTW-ONX16-ubuntu:/usr/local$ journalctl -fu zed_media_server_cli.service
May 09 13:47:29 GTW-ONX16-ubuntu ZED_Media_Server[22299]: ** CLI version **
May 09 13:47:31 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Main process exited, code=exited, status=1/FAILURE
May 09 13:47:31 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Failed with result 'exit-code'.
May 09 13:47:32 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Scheduled restart job, restart counter is at 6.
May 09 13:47:32 GTW-ONX16-ubuntu systemd[1]: Stopped ZED Media Server.
May 09 13:47:32 GTW-ONX16-ubuntu systemd[1]: Started ZED Media Server.
May 09 13:47:32 GTW-ONX16-ubuntu ZED_Media_Server[22305]: [ZEDMediaServer] Version 0.1.8
May 09 13:47:32 GTW-ONX16-ubuntu ZED_Media_Server[22305]: ** CLI version **
May 09 13:47:34 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Main process exited, code=exited, status=1/FAILURE
May 09 13:47:34 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Failed with result 'exit-code'.
May 09 13:47:35 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Scheduled restart job, restart counter is at 7.
May 09 13:47:35 GTW-ONX16-ubuntu systemd[1]: Stopped ZED Media Server.
May 09 13:47:35 GTW-ONX16-ubuntu systemd[1]: Started ZED Media Server.
May 09 13:47:35 GTW-ONX16-ubuntu ZED_Media_Server[22311]: [ZEDMediaServer] Version 0.1.8
May 09 13:47:35 GTW-ONX16-ubuntu ZED_Media_Server[22311]: ** CLI version **
May 09 13:47:37 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Main process exited, code=exited, status=1/FAILURE
May 09 13:47:37 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Failed with result 'exit-code'.
May 09 13:47:38 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Scheduled restart job, restart counter is at 8.
May 09 13:47:38 GTW-ONX16-ubuntu systemd[1]: Stopped ZED Media Server.
May 09 13:47:38 GTW-ONX16-ubuntu systemd[1]: Started ZED Media Server.
May 09 13:47:39 GTW-ONX16-ubuntu ZED_Media_Server[22319]: [ZEDMediaServer] Version 0.1.8
May 09 13:47:39 GTW-ONX16-ubuntu ZED_Media_Server[22319]: ** CLI version **
May 09 13:47:41 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Main process exited, code=exited, status=1/FAILURE
May 09 13:47:41 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Failed with result 'exit-code'.
May 09 13:47:42 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Scheduled restart job, restart counter is at 9.
May 09 13:47:42 GTW-ONX16-ubuntu systemd[1]: Stopped ZED Media Server.
May 09 13:47:42 GTW-ONX16-ubuntu systemd[1]: Started ZED Media Server.
May 09 13:47:42 GTW-ONX16-ubuntu ZED_Media_Server[22324]: [ZEDMediaServer] Version 0.1.8
May 09 13:47:42 GTW-ONX16-ubuntu ZED_Media_Server[22324]: ** CLI version **
May 09 13:47:44 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Main process exited, code=exited, status=1/FAILURE
May 09 13:47:44 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Failed with result 'exit-code'.
May 09 13:47:45 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Scheduled restart job, restart counter is at 10.
May 09 13:47:45 GTW-ONX16-ubuntu systemd[1]: Stopped ZED Media Server.
May 09 13:47:45 GTW-ONX16-ubuntu systemd[1]: Started ZED Media Server.
May 09 13:47:45 GTW-ONX16-ubuntu ZED_Media_Server[22329]: [ZEDMediaServer] Version 0.1.8
May 09 13:47:45 GTW-ONX16-ubuntu ZED_Media_Server[22329]: ** CLI version **
May 09 13:47:47 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Main process exited, code=exited, status=1/FAILURE
May 09 13:47:47 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Failed with result 'exit-code'.
May 09 13:47:48 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Scheduled restart job, restart counter is at 11.
After excruciating debugging, I think figured out why this might be happening. It seems that where you run the service executable (/usr/local/zed/tools/ZED_Media_Server
) matters. If I run the GUI version in a given directory and setup the configuration of a virtual stereo camera, then save, close and open again the same directory, that configuration is loaded and I can see it in the GUI (so far, so good). On the other hand, if I open the ZED_Media_Server
GUI in another directory, it does not load the previous configuration. If I run ZED_Media_Server --cli
in a directory without the virtual configuration, I get a very similar result as in the previous logs, it executes and leaves:
user@GTW-ONX16-ubuntu:~/Desktop/debug_zedx/no_config_dir$ ZED_Media_Server --cli
[ZEDMediaServer] Version 0.1.8
** CLI version **
user@GTW-ONX16-ubuntu:~/Desktop/debug_zedx/no_config_dir$
Also, I found out that using sudo, even in the same directory, also matters. Therefore the configuration for the stereo camera setup is dependent on the current directory.
So, with all of this, I decided to run the ZED_Media_Server
GUI in the root directory /
with sudo
and set up the virtual stereo camera. Then, closed the GUI and restarted the zed_media_server_cli.server
, and it’s working now. Which make sense.
Even the command ZED_Media_Server --clear-config
only cleans the configuration associated with the current directory, which means I’d have to remember everywhere I set up cameras to clean them all.
Questions
-
Is this behavior intended?
-
Where are the configuration files? Where is this being saved?