Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. run application on startup Raspbian RPI3B+
Forum Updated to NodeBB v4.3 + New Features

run application on startup Raspbian RPI3B+

Scheduled Pinned Locked Moved Solved QML and Qt Quick
7 Posts 3 Posters 1.8k Views 2 Watching
  • 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.
  • MonoFoxM Offline
    MonoFoxM Offline
    MonoFox
    wrote on last edited by
    #1

    Well, first of all I would like to say that the application I created works great, it is a counter for the car. I'm starting it right after the start of the RPI. It takes 10 seconds but this is not my problem ...

    The application is started using the init / systemd service ... and the service runs the script
    Start.sh

    #!/bin/bash
    echo "Starting..."
    ip link set can0 type can bitrate 100000
    
    ifconfig can0 up
    
    /home/pi/cluster -platform linuxfb
    

    After running the script, the CAN interface is switched on and then the application. Unfortunately, when you run it, there are terrible lags, I do not know what's happening ... When I run this script using the console or ssh everything works great, so as you can guess the problem is incorrect initialization.
    Does anyone have other tried and tested ways to run the GUI application after the rpi startup and make it work as it should ??

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      From old memories, you have to ensure that you start your application at the right level / order so that your system is sufficiently initialised.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      MonoFoxM 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        From old memories, you have to ensure that you start your application at the right level / order so that your system is sufficiently initialised.

        MonoFoxM Offline
        MonoFoxM Offline
        MonoFox
        wrote on last edited by
        #3

        @SGaist
        Thank You for answer :)
        I think you have right.. When i tried to run aplication by bashrc and after loading desktop of raspbian and sign in by ssh, my instrument cluster was running curectly with no lags.
        So where I must to start search best solution ? When i run my qt app by init/systemd (service) or rc.local, my app starting before load desktop with lags.
        I thinking about other idea like create console application that will start working before loading the desktop, then wait a few seconds and run my shell script that will launch the can interface and my counter, is it good idea?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Why are you loading the desktop environment of your RPi since you have an application that uses the frame buffer ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          MonoFoxM 1 Reply Last reply
          1
          • SGaistS SGaist

            Why are you loading the desktop environment of your RPi since you have an application that uses the frame buffer ?

            MonoFoxM Offline
            MonoFoxM Offline
            MonoFox
            wrote on last edited by MonoFox
            #5

            @SGaist
            All the time I thought I needed some graphic libraries that are loaded with the desktop. So how to do it? Should I stop running X server from local.rc and run my application directly?
            @edit
            When I loaded my application using serverX ---> xinitrc ... my application started, but it does not get anything from the CAN interface ...
            xinitrc:

            
            #!/bin/sh
            
            # /etc/X11/xinit/xinitrc
            #
            # global xinitrc file, used by all X sessions started by xinit (startx)
            
            #~pi/.xinitrc
            sudo modprobe can_dev
            sudo modprobe gs_usb
            sudo modprobe can
            sudo modprobe slcan
            
            /usr/bin/start.sh
            
            # invoke global X session script
            . /etc/X11/Xsession
            
            

            start.sh:

            
            
            #!/bin/bash
            sleep 5
            ip link set can0 type can bitrate 100000
            ifconfig can0 up
            /home/pi/Desktop/nienazwany  -platform xcb
            
            
            
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              That's likely because your user doesn't have the proper rights to access the device. You should check which group it should belong to for that.

              Next, you should use Linux setup facilities to load the modules you need. .xinitrc is not the right place for that.

              Same goes for the network setup. You should again use your distribution network setup capabilities / configuration management.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • M Offline
                M Offline
                maxwell31
                wrote on last edited by
                #7

                I start my application also with systemd and have no problems. However, I use eglfs, and not xserver (which is probably what you should do too: https://wiki.qt.io/RaspberryPi2EGLFS

                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