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. "No such plugin: 'socketcan'"
Forum Updated to NodeBB v4.3 + New Features

"No such plugin: 'socketcan'"

Scheduled Pinned Locked Moved Solved Mobile and Embedded
15 Posts 4 Posters 2.2k Views 1 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.
  • O Offline
    O Offline
    osos11
    wrote on last edited by osos11
    #3

    Hi,
    Qt does not provide "socketcan" support for android by default.
    Download the "qtserialbus" repo from Github.
    Link: https://github.com/qt/qtserialbus/tree/6.6

    Comment out the "if not Android" and "only Linux" conditions within the cmake files. Compile and install. So you get all plugins for Android including "socketcan".

    Check this 3 files:
    https://github.com/qt/qtserialbus/blob/6.6/tests/auto/CMakeLists.txt -> comment out line 25 and 27

    https://github.com/qt/qtserialbus/blob/6.6/src/serialbus/configure.cmake -> comment out line 32 and 36

    https://github.com/qt/qtserialbus/blob/6.6/src/tools/CMakeLists.txt -> comment out line 6

    Make sure you are using the correct version of the "qtserialbus" repo .
    Make sure you are using android cmake of Qt. (in your 6.6 sources. Like this /home/ubuntu/Qt/6.6/android_arm64_v8a/bin/qt-cmake)

    And check it out: https://blog.csdn.net/qq_19649851/article/details/126227486
    https://bugreports.qt.io/browse/QTBUG-118600

    1 Reply Last reply
    0
    • SGaistS SGaist

      Hi and welcome to devnet,

      Did you also deploy the plugin's dependencies ?

      L Offline
      L Offline
      LeonardoL
      wrote on last edited by
      #4

      @SGaist
      Hi, thanks for the quick response, which plugins?

      jsulmJ 1 Reply Last reply
      0
      • L LeonardoL

        @SGaist
        Hi, thanks for the quick response, which plugins?

        jsulmJ Online
        jsulmJ Online
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #5

        @LeonardoL said in "No such plugin: 'socketcan'":

        which plugins?

        qt.canbus.plugins.socketcan

        Did you deploy the dependencies of this plug-in?

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

        L 1 Reply Last reply
        0
        • jsulmJ jsulm

          @LeonardoL said in "No such plugin: 'socketcan'":

          which plugins?

          qt.canbus.plugins.socketcan

          Did you deploy the dependencies of this plug-in?

          L Offline
          L Offline
          LeonardoL
          wrote on last edited by
          #6

          @jsulm i've put
          libplugins_canbus_qtsocketcanbus_arm64-v8a.so, libplugins_canbus_qtpassthrucanbus_arm64-v8a.so, libplugins_canbus_qtpeakcanbus_arm64-v8a.so, libplugins_canbus_qttinycanbus_arm64-v8a.so, libplugins_canbus_qtvirtualcanbus_arm64-v8a.so

          Now i'm trying to cross compile libsocketcan.so to aarch64.

          O 1 Reply Last reply
          0
          • L LeonardoL

            @jsulm i've put
            libplugins_canbus_qtsocketcanbus_arm64-v8a.so, libplugins_canbus_qtpassthrucanbus_arm64-v8a.so, libplugins_canbus_qtpeakcanbus_arm64-v8a.so, libplugins_canbus_qttinycanbus_arm64-v8a.so, libplugins_canbus_qtvirtualcanbus_arm64-v8a.so

            Now i'm trying to cross compile libsocketcan.so to aarch64.

            O Offline
            O Offline
            osos11
            wrote on last edited by
            #7

            @LeonardoL
            I'm using 6.5.3. I did it as described above and I use it flawlessly. I recommend you compile and install the whole qtcanbus project. Just compiling the plugin and putting it into the project file does not work. I tried it too and it didn't work.

            L 2 Replies Last reply
            0
            • O osos11

              @LeonardoL
              I'm using 6.5.3. I did it as described above and I use it flawlessly. I recommend you compile and install the whole qtcanbus project. Just compiling the plugin and putting it into the project file does not work. I tried it too and it didn't work.

              L Offline
              L Offline
              LeonardoL
              wrote on last edited by
              #8

              @osos11 Hi thanks, i'll try as you described.

              1 Reply Last reply
              0
              • O osos11

                @LeonardoL
                I'm using 6.5.3. I did it as described above and I use it flawlessly. I recommend you compile and install the whole qtcanbus project. Just compiling the plugin and putting it into the project file does not work. I tried it too and it didn't work.

                L Offline
                L Offline
                LeonardoL
                wrote on last edited by
                #9

                @osos11 I did as you mentioned earlier and i got this log when i deploy my application to my board.

                Additionally i set this parameters on the board.

                setenforce 0
                ip link set can0 up type can bitrate 250000     
                

                Log when the application was deployed

                D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 1010109; state: ENABLED
                W ziparchive: Unable to open '/data/app/~~Z9lSHxcSdAN667SHOjZS4g==/teste.qmake-YkNiMRALxdP-xXK51Dmo4A==/base.dm': No such file or directory
                W ziparchive: Unable to open '/data/app/~~Z9lSHxcSdAN667SHOjZS4g==/teste.qmake-YkNiMRALxdP-xXK51Dmo4A==/base.dm': No such file or directory
                V GraphicsEnvironment: ANGLE Developer option for 'teste.qmake' set to: 'default'
                V GraphicsEnvironment: ANGLE GameManagerService for teste.qmake: false
                V GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported.
                D NetworkSecurityConfig: No Network Security Config specified, using platform default
                D NetworkSecurityConfig: No Network Security Config specified, using platform default
                I RenderThread: type=1400 audit(0.0:100): avc: denied { open } for path="/dev/__properties__/u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=319 scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=1
                I RenderThread: type=1400 audit(0.0:101): avc: denied { getattr } for path="/dev/__properties__/u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=319 scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=1
                W System  : ClassLoader referenced unknown path:
                I RenderThread: type=1400 audit(0.0:102): avc: denied { map } for path="/dev/__properties__/u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=319 scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=1
                I QtCore  : Start
                I Qt      : qt started
                D CompatibilityChangeReporter: Compat change id reported: 210923482; UID 1010109; state: DISABLED
                D CompatibilityChangeReporter: Compat change id reported: 37756858; UID 1010109; state: ENABLED
                E OpenGLRenderer: Device claims wide gamut support, cannot find matching config, error = EGL_SUCCESS
                W OpenGLRenderer: Failed to initialize 101010-2 format, error = EGL_SUCCESS
                I display : open gpu gralloc module!
                E OpenGLRenderer: Unable to match the desired swap behavior.
                W Parcel  : Expecting binder but got null!
                W Qt A11Y : Could not (yet) activate platform accessibility.
                W qt.canbus.plugins.socketcan: : Cannot load library socketcan: (dlopen failed: library "socketcan" not found)
                I qt.canbus.plugins.socketcan: : Cannot load library libsocketcan, some functionality will not be available.
                I qt.canbus.plugins.socketcan: Cannot load library socketcan: (dlopen failed: library "socketcan" not found)
                W qt.canbus.plugins.socketcan: : Function can_set_bitrate() is not available.
                W qt.canbus.plugins.socketcan: : Cannot apply parameter: 4 with value: 500000.
                D libteste_Android_Qmake_arm64-v8a.so: QList("passthrucan", "peakcan", "socketcan", "tinycan", "virtualcan")
                I qtMainLoopThrea: type=1400 audit(0.0:103): avc: denied { create } for scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                I qtMainLoopThrea: type=1400 audit(0.0:104): avc: denied { ioctl } for path="socket:[234517]" dev="sockfs" ino=234517 ioctlcmd=0x8933 scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                I qtMainLoopThrea: type=1400 audit(0.0:105): avc: denied { bind } for scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                I qtMainLoopThrea: type=1400 audit(0.0:106): avc: denied { setopt } for scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                D libteste_Android_Qmake_arm64-v8a.so: 0
                D libteste_Android_Qmake_arm64-v8a.so: 0
                D libteste_Android_Qmake_arm64-v8a.so: 0
                I qtMainLoopThrea: type=1400 audit(0.0:107): avc: denied { read } for scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                D libteste_Android_Qmake_arm64-v8a.so: true
                D libteste_Android_Qmake_arm64-v8a.so: false
                I qtMainLoopThrea: type=1400 audit(0.0:108): avc: denied { read } for scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                I qtMainLoopThrea: type=1400 audit(0.0:109): avc: denied { ioctl } for path="socket:[234517]" dev="sockfs" ino=234517 ioctlcmd=0x8906 scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                
                O 1 Reply Last reply
                0
                • L LeonardoL

                  @osos11 I did as you mentioned earlier and i got this log when i deploy my application to my board.

                  Additionally i set this parameters on the board.

                  setenforce 0
                  ip link set can0 up type can bitrate 250000     
                  

                  Log when the application was deployed

                  D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 1010109; state: ENABLED
                  W ziparchive: Unable to open '/data/app/~~Z9lSHxcSdAN667SHOjZS4g==/teste.qmake-YkNiMRALxdP-xXK51Dmo4A==/base.dm': No such file or directory
                  W ziparchive: Unable to open '/data/app/~~Z9lSHxcSdAN667SHOjZS4g==/teste.qmake-YkNiMRALxdP-xXK51Dmo4A==/base.dm': No such file or directory
                  V GraphicsEnvironment: ANGLE Developer option for 'teste.qmake' set to: 'default'
                  V GraphicsEnvironment: ANGLE GameManagerService for teste.qmake: false
                  V GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported.
                  D NetworkSecurityConfig: No Network Security Config specified, using platform default
                  D NetworkSecurityConfig: No Network Security Config specified, using platform default
                  I RenderThread: type=1400 audit(0.0:100): avc: denied { open } for path="/dev/__properties__/u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=319 scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=1
                  I RenderThread: type=1400 audit(0.0:101): avc: denied { getattr } for path="/dev/__properties__/u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=319 scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=1
                  W System  : ClassLoader referenced unknown path:
                  I RenderThread: type=1400 audit(0.0:102): avc: denied { map } for path="/dev/__properties__/u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=319 scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=1
                  I QtCore  : Start
                  I Qt      : qt started
                  D CompatibilityChangeReporter: Compat change id reported: 210923482; UID 1010109; state: DISABLED
                  D CompatibilityChangeReporter: Compat change id reported: 37756858; UID 1010109; state: ENABLED
                  E OpenGLRenderer: Device claims wide gamut support, cannot find matching config, error = EGL_SUCCESS
                  W OpenGLRenderer: Failed to initialize 101010-2 format, error = EGL_SUCCESS
                  I display : open gpu gralloc module!
                  E OpenGLRenderer: Unable to match the desired swap behavior.
                  W Parcel  : Expecting binder but got null!
                  W Qt A11Y : Could not (yet) activate platform accessibility.
                  W qt.canbus.plugins.socketcan: : Cannot load library socketcan: (dlopen failed: library "socketcan" not found)
                  I qt.canbus.plugins.socketcan: : Cannot load library libsocketcan, some functionality will not be available.
                  I qt.canbus.plugins.socketcan: Cannot load library socketcan: (dlopen failed: library "socketcan" not found)
                  W qt.canbus.plugins.socketcan: : Function can_set_bitrate() is not available.
                  W qt.canbus.plugins.socketcan: : Cannot apply parameter: 4 with value: 500000.
                  D libteste_Android_Qmake_arm64-v8a.so: QList("passthrucan", "peakcan", "socketcan", "tinycan", "virtualcan")
                  I qtMainLoopThrea: type=1400 audit(0.0:103): avc: denied { create } for scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                  I qtMainLoopThrea: type=1400 audit(0.0:104): avc: denied { ioctl } for path="socket:[234517]" dev="sockfs" ino=234517 ioctlcmd=0x8933 scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                  I qtMainLoopThrea: type=1400 audit(0.0:105): avc: denied { bind } for scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                  I qtMainLoopThrea: type=1400 audit(0.0:106): avc: denied { setopt } for scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                  D libteste_Android_Qmake_arm64-v8a.so: 0
                  D libteste_Android_Qmake_arm64-v8a.so: 0
                  D libteste_Android_Qmake_arm64-v8a.so: 0
                  I qtMainLoopThrea: type=1400 audit(0.0:107): avc: denied { read } for scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                  D libteste_Android_Qmake_arm64-v8a.so: true
                  D libteste_Android_Qmake_arm64-v8a.so: false
                  I qtMainLoopThrea: type=1400 audit(0.0:108): avc: denied { read } for scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                  I qtMainLoopThrea: type=1400 audit(0.0:109): avc: denied { ioctl } for path="socket:[234517]" dev="sockfs" ino=234517 ioctlcmd=0x8906 scontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tcontext=u:r:untrusted_app_30:s0:c109,c256,c522,c768 tclass=can_socket permissive=1
                  
                  O Offline
                  O Offline
                  osos11
                  wrote on last edited by
                  #10

                  @LeonardoL
                  It seems like working, right?
                  I don't know why it still gives the plugin not found error. It is weird.

                  Check my issue. I wrote "SELinux allow" policies for Qt socketcan apps on Enforcing mode. If you have android source code of your device, you can add the policy in the source code.
                  My issue: https://bugreports.qt.io/browse/QTBUG-118600

                  L 1 Reply Last reply
                  0
                  • O osos11

                    @LeonardoL
                    It seems like working, right?
                    I don't know why it still gives the plugin not found error. It is weird.

                    Check my issue. I wrote "SELinux allow" policies for Qt socketcan apps on Enforcing mode. If you have android source code of your device, you can add the policy in the source code.
                    My issue: https://bugreports.qt.io/browse/QTBUG-118600

                    L Offline
                    L Offline
                    LeonardoL
                    wrote on last edited by
                    #11

                    @osos11 It worked!!!! the problem were in my board with permissive.

                    1 Reply Last reply
                    0
                    • L LeonardoL has marked this topic as solved on
                    • O Offline
                      O Offline
                      osos11
                      wrote on last edited by osos11
                      #12

                      @LeonardoL
                      I did some research and realized there is another library called libsocketcan. When the application starts, it searches for that library. Apps gives a warning if apps cannot find libsocketcan.
                      I compiled and tested the libsocketcan library for Android. I couldn't test the "resetController" function because my can devices never entered to "BusOff" state. Also, "BusStatus" functions works fine. If you would like to include libsocketcan in your project, I shared it on my github page.

                      Check the two functions at the bottom of the page : https://doc.qt.io/qt-6/qtserialbus-socketcan-overview.html
                      Libsocketcan sources: https://github.com/lalten/libsocketcan/tree/master
                      My github for precompiled libsocketcan : https://github.com/osos11-Git/libsocketcan_android
                      You should add the following to your .pro project file:
                      $$PWD -> your project directory

                      android:arm64-v8a:LIBS += -L/$$PWD/android_libs/libsocketcan/lib -lsocketcan
                      android:arm64-v8a:INCLUDEPATH += /$$PWD/android_libs/libsocketcan/include
                      android:arm64-v8a:DEPENDPATH += /$$PWD/android_libs/libsocketcan/include
                       
                      contains(ANDROID_TARGET_ARCH,arm64-v8a) {
                      
                          ANDROID_EXTRA_LIBS = \
                              $$PWD/android_libs/libsocketcan/lib/libsocketcan.so
                      }
                      
                      L 2 Replies Last reply
                      0
                      • O osos11

                        @LeonardoL
                        I did some research and realized there is another library called libsocketcan. When the application starts, it searches for that library. Apps gives a warning if apps cannot find libsocketcan.
                        I compiled and tested the libsocketcan library for Android. I couldn't test the "resetController" function because my can devices never entered to "BusOff" state. Also, "BusStatus" functions works fine. If you would like to include libsocketcan in your project, I shared it on my github page.

                        Check the two functions at the bottom of the page : https://doc.qt.io/qt-6/qtserialbus-socketcan-overview.html
                        Libsocketcan sources: https://github.com/lalten/libsocketcan/tree/master
                        My github for precompiled libsocketcan : https://github.com/osos11-Git/libsocketcan_android
                        You should add the following to your .pro project file:
                        $$PWD -> your project directory

                        android:arm64-v8a:LIBS += -L/$$PWD/android_libs/libsocketcan/lib -lsocketcan
                        android:arm64-v8a:INCLUDEPATH += /$$PWD/android_libs/libsocketcan/include
                        android:arm64-v8a:DEPENDPATH += /$$PWD/android_libs/libsocketcan/include
                         
                        contains(ANDROID_TARGET_ARCH,arm64-v8a) {
                        
                            ANDROID_EXTRA_LIBS = \
                                $$PWD/android_libs/libsocketcan/lib/libsocketcan.so
                        }
                        
                        L Offline
                        L Offline
                        LeonardoL
                        wrote on last edited by
                        #13

                        @osos11 Thank you so much, I'll try this solution.

                        1 Reply Last reply
                        0
                        • O osos11

                          @LeonardoL
                          I did some research and realized there is another library called libsocketcan. When the application starts, it searches for that library. Apps gives a warning if apps cannot find libsocketcan.
                          I compiled and tested the libsocketcan library for Android. I couldn't test the "resetController" function because my can devices never entered to "BusOff" state. Also, "BusStatus" functions works fine. If you would like to include libsocketcan in your project, I shared it on my github page.

                          Check the two functions at the bottom of the page : https://doc.qt.io/qt-6/qtserialbus-socketcan-overview.html
                          Libsocketcan sources: https://github.com/lalten/libsocketcan/tree/master
                          My github for precompiled libsocketcan : https://github.com/osos11-Git/libsocketcan_android
                          You should add the following to your .pro project file:
                          $$PWD -> your project directory

                          android:arm64-v8a:LIBS += -L/$$PWD/android_libs/libsocketcan/lib -lsocketcan
                          android:arm64-v8a:INCLUDEPATH += /$$PWD/android_libs/libsocketcan/include
                          android:arm64-v8a:DEPENDPATH += /$$PWD/android_libs/libsocketcan/include
                           
                          contains(ANDROID_TARGET_ARCH,arm64-v8a) {
                          
                              ANDROID_EXTRA_LIBS = \
                                  $$PWD/android_libs/libsocketcan/lib/libsocketcan.so
                          }
                          
                          L Offline
                          L Offline
                          LeonardoL
                          wrote on last edited by
                          #14

                          @osos11 said in "No such plugin: 'socketcan'":

                          android:arm64-v8a:LIBS += -L/$$PWD/android_libs/libsocketcan/lib -lsocketcan
                          android:arm64-v8a:INCLUDEPATH += /$$PWD/android_libs/libsocketcan/include
                          android:arm64-v8a:DEPENDPATH += /$$PWD/android_libs/libsocketcan/include

                          It worked. Thank you again. you've saved me :D

                          O 1 Reply Last reply
                          0
                          • L LeonardoL

                            @osos11 said in "No such plugin: 'socketcan'":

                            android:arm64-v8a:LIBS += -L/$$PWD/android_libs/libsocketcan/lib -lsocketcan
                            android:arm64-v8a:INCLUDEPATH += /$$PWD/android_libs/libsocketcan/include
                            android:arm64-v8a:DEPENDPATH += /$$PWD/android_libs/libsocketcan/include

                            It worked. Thank you again. you've saved me :D

                            O Offline
                            O Offline
                            osos11
                            wrote on last edited by
                            #15

                            @LeonardoL
                            You are welcome.

                            Can you click on the link below and do what is said in the last 1-2 messages so that the Selinux problem can at least be investigated by Qt, or can you at least share a log( with device specs, at least Android version etc.) indicating that you have the same problem in the link?

                            https://bugreports.qt.io/browse/QTBUG-118600

                            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