Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt app launched at startup of a Jetson Nano
Forum Updated to NodeBB v4.3 + New Features

Qt app launched at startup of a Jetson Nano

Scheduled Pinned Locked Moved Solved Mobile and Embedded
4 Posts 2 Posters 857 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    steph27
    wrote on last edited by
    #1

    Hi,

    I made a Qt quick application (with Qt 5.15.2) that works well on a Jetson Card.
    I now want to launch it automaticaly at startup, so I created a service to do that :

    [Unit]
    Description= Camera_quick autostart
    After=graphical.target
    
    [Service]
    Type=simple
    User=jetson
    WorkingDirectory=/home/jetson/Startup/Camera_quick
    ExecStart=/home/jetson/Startup/Camera_quick/Camera_quick
    
    [Install]
    WantedBy=multi-user.target
    

    But this service is not able to run the app :

    camera-quick.service - Camera_quick autostart
       Loaded: loaded (/lib/systemd/system/camera-quick.service; enabled; vendor preset: enabled)
       Active: failed (Result: core-dump) since Wed 2022-01-19 16:51:53 CET; 1min 18s ago
      Process: 7749 ExecStart=/home/jetson/Startup/Camera_quick/Camera_quick (code=dumped, signal=ABRT)
     Main PID: 7749 (code=dumped, signal=ABRT)
    
    Jan 19 16:51:47 jetson systemd[1]: Started Camera_quick autostart.
    Jan 19 16:51:52 jetson Camera_quick[7749]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
    Jan 19 16:51:52 jetson Camera_quick[7749]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    Jan 19 16:51:52 jetson Camera_quick[7749]: Available platform plugins are: xcb.
    Jan 19 16:51:53 jetson systemd[1]: camera-quick.service: Main process exited, code=dumped, status=6/ABRT
    Jan 19 16:51:53 jetson systemd[1]: camera-quick.service: Failed with result 'core-dump'.
    

    However, when I run "/home/jetson/Startup/Camera_quick/Camera_quick", the app is launched (so the plugin "xcb" is found!).

    To summarize :
    - launched by Qt : works
    - launched by terminal : works
    - launched by service : doesn't work

    Any ideas ?

    Regards

    jsulmJ 1 Reply Last reply
    0
    • S steph27

      Hi,

      I made a Qt quick application (with Qt 5.15.2) that works well on a Jetson Card.
      I now want to launch it automaticaly at startup, so I created a service to do that :

      [Unit]
      Description= Camera_quick autostart
      After=graphical.target
      
      [Service]
      Type=simple
      User=jetson
      WorkingDirectory=/home/jetson/Startup/Camera_quick
      ExecStart=/home/jetson/Startup/Camera_quick/Camera_quick
      
      [Install]
      WantedBy=multi-user.target
      

      But this service is not able to run the app :

      camera-quick.service - Camera_quick autostart
         Loaded: loaded (/lib/systemd/system/camera-quick.service; enabled; vendor preset: enabled)
         Active: failed (Result: core-dump) since Wed 2022-01-19 16:51:53 CET; 1min 18s ago
        Process: 7749 ExecStart=/home/jetson/Startup/Camera_quick/Camera_quick (code=dumped, signal=ABRT)
       Main PID: 7749 (code=dumped, signal=ABRT)
      
      Jan 19 16:51:47 jetson systemd[1]: Started Camera_quick autostart.
      Jan 19 16:51:52 jetson Camera_quick[7749]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
      Jan 19 16:51:52 jetson Camera_quick[7749]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
      Jan 19 16:51:52 jetson Camera_quick[7749]: Available platform plugins are: xcb.
      Jan 19 16:51:53 jetson systemd[1]: camera-quick.service: Main process exited, code=dumped, status=6/ABRT
      Jan 19 16:51:53 jetson systemd[1]: camera-quick.service: Failed with result 'core-dump'.
      

      However, when I run "/home/jetson/Startup/Camera_quick/Camera_quick", the app is launched (so the plugin "xcb" is found!).

      To summarize :
      - launched by Qt : works
      - launched by terminal : works
      - launched by service : doesn't work

      Any ideas ?

      Regards

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @steph27 You should search here for this topic.
      There was one recently, with a solution.
      I guess that your app is started before X server is. That means: your app should depend on X server.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        steph27
        wrote on last edited by steph27
        #3

        Ok I should have missed it...

        I tried to start the service directly to test it and it was through a remote desktop with VNC so the X server was running.
        Moreover, the line

        After=graphical.target
        

        should wait for it no ?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          steph27
          wrote on last edited by
          #4

          Ok I changed the way of doing that :
          I created a *.desktop file in .config/autostart

          [Desktop Entry]
          Path=/home/jetson/Startup/Camera_quick
          Exec=/bin/bash /home/jetson/Startup/Camera_quick/run.sh
          Type=Application
          

          and the run.sh file is :

          #!/bin/bash
          export LD_LIBRARY_PATH=/usr/local/Qt-5.15.2/lib/
          /home/jetson/Startup/Camera_quick/Camera_quick
          

          And that works !
          Thanks

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved