How to start Vimba API as ubuntu service

226 views Asked by At

I'm having an issue with ubuntu service that includes Vimba API which is about the Allied Vision Cameras. the application that i built includes Vimba API, tcp/ip server and rs485 communication. It is going to be used in closed loop system so i have to write an ubuntu service. first of all i created a script that runs the application. The script im using is as follows:

#!/bin/sh
user="$(whoami)"
if [ X"$(uname -m)" = X"x86_64" ]
then
    arch="x86_64"
elif [ X"$(uname -m)" = X"aarch64" ]
then
    arch="arm_64"   
fi

echo $user
echo $arch

/home/${user}/Desktop/App/App_Scripts/bin/${arch}bit/changeName jetson1
/home/${user}/Desktop/App/App_Scripts/App.sh

The service im using is as follows:

[Unit]
Description=App Service
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=6
User=jetson1
ExecStart=/home/Desktop/App/App_Scripts/App.sh/

[Install]
WantedBy=multi-user.target

When i run the App.sh with my bare hands as a standard user it works but when i start the app service it gives me No Transport Layer error.

i tried to add the necessary libraries or dependencies to the ubuntu service. i changed the script owner and group and also add sudo at the beginning of the command.

1

There are 1 answers

1
dk523 On

A couple of things may help:

  1. Can you run the script as sudo -E? (-E saves environment variables)
  2. Add one of these to your .bashrc file:

32-bit

export GENICAM_GENTL32_PATH=$GENICAM_GENTL32_PATH:"/opt/Vimba_6_0/VimbaGigETL/CTI/x86_32bit/"

64-bit

export GENICAM_GENTL64_PATH=$GENICAM_GENTL64_PATH:"/opt/Vimba_6_0/VimbaGigETL/CTI/x86_64bit/"

Then type source .bashrc to make sure the path is created in your environment variables.