Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using socketcan on QT
Forum Updated to NodeBB v4.3 + New Features

Using socketcan on QT

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 3 Posters 889 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.
  • G Offline
    G Offline
    Garza
    wrote on 3 Dec 2020, 13:38 last edited by
    #1

    I'm currently using your CAN example and socket can to read CAN frames. I notices I get the same time stamp for 2 or 3 (sometimes more) consecutive messages, So I found out it was because this is "software" timestamp and not "hardware". I found out because I asked Peak and they clear this for me, so when I call:
    "candump -tA -H can0"
    the -H gets the correct time stamp, although from 1970 but that's OK.
    My question is how can I set QT so that it uses the hardware timestamp?
    Thanks,
    Kind regards,
    Jorge Garza

    A 1 Reply Last reply 3 Dec 2020, 14:16
    0
    • G Garza
      3 Dec 2020, 13:38

      I'm currently using your CAN example and socket can to read CAN frames. I notices I get the same time stamp for 2 or 3 (sometimes more) consecutive messages, So I found out it was because this is "software" timestamp and not "hardware". I found out because I asked Peak and they clear this for me, so when I call:
      "candump -tA -H can0"
      the -H gets the correct time stamp, although from 1970 but that's OK.
      My question is how can I set QT so that it uses the hardware timestamp?
      Thanks,
      Kind regards,
      Jorge Garza

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 3 Dec 2020, 14:16 last edited by aha_1980 12 Mar 2020, 14:19
      #2

      Hi @Garza,

      that's currently not possible. You may want to comment and vote on QTBUG-55295 to get that implemented.

      Regards

      Edit: Of course you can also use the peakcan plugin together with Peak's own driver on Linux, where this should already work as expected.

      Qt has to stay free or it will die.

      G 1 Reply Last reply 6 Jan 2021, 12:45
      3
      • A aha_1980
        3 Dec 2020, 14:16

        Hi @Garza,

        that's currently not possible. You may want to comment and vote on QTBUG-55295 to get that implemented.

        Regards

        Edit: Of course you can also use the peakcan plugin together with Peak's own driver on Linux, where this should already work as expected.

        G Offline
        G Offline
        Garza
        wrote on 6 Jan 2021, 12:45 last edited by
        #3

        @aha_1980 I tried installing peak driver but always ended ruining my system.

        A 1 Reply Last reply 6 Jan 2021, 12:59
        0
        • G Garza
          6 Jan 2021, 12:45

          @aha_1980 I tried installing peak driver but always ended ruining my system.

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 6 Jan 2021, 12:59 last edited by
          #4

          @Garza you can try to patch the socketcan plugin locally and recompile QtSerialBus.

          An official solution is not that easy, as all the plugins need to be adjusted. I don't expect that to happen anytime soon. As always: Patches welcome.

          Regards

          Qt has to stay free or it will die.

          G 1 Reply Last reply 7 Jan 2021, 08:57
          2
          • A aha_1980
            6 Jan 2021, 12:59

            @Garza you can try to patch the socketcan plugin locally and recompile QtSerialBus.

            An official solution is not that easy, as all the plugins need to be adjusted. I don't expect that to happen anytime soon. As always: Patches welcome.

            Regards

            G Offline
            G Offline
            Garza
            wrote on 7 Jan 2021, 08:57 last edited by
            #5

            @aha_1980 how can I do that? I only see .so files where the QtSerialBus is located.

            J 1 Reply Last reply 7 Jan 2021, 08:58
            0
            • G Garza
              7 Jan 2021, 08:57

              @aha_1980 how can I do that? I only see .so files where the QtSerialBus is located.

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 7 Jan 2021, 08:58 last edited by
              #6

              @Garza said in Using socketcan on QT:

              how can I do that?

              https://wiki.qt.io/Building_Qt_5_from_Git
              But don't build whole Qt, just QtSerialBus module.

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

              G 1 Reply Last reply 13 Apr 2021, 10:58
              3
              • J jsulm
                7 Jan 2021, 08:58

                @Garza said in Using socketcan on QT:

                how can I do that?

                https://wiki.qt.io/Building_Qt_5_from_Git
                But don't build whole Qt, just QtSerialBus module.

                G Offline
                G Offline
                Garza
                wrote on 13 Apr 2021, 10:58 last edited by
                #7

                @jsulm So, do I need to pull the whole QT code and then build only the module I want or should should I pull only the module I need?

                J 1 Reply Last reply 13 Apr 2021, 11:21
                0
                • G Garza
                  13 Apr 2021, 10:58

                  @jsulm So, do I need to pull the whole QT code and then build only the module I want or should should I pull only the module I need?

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 13 Apr 2021, 11:21 last edited by
                  #8

                  @Garza You can clone the modules you need as described in the link I gave you: https://wiki.qt.io/Building_Qt_5_from_Git

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

                  G 1 Reply Last reply 13 Apr 2021, 12:04
                  0
                  • J jsulm
                    13 Apr 2021, 11:21

                    @Garza You can clone the modules you need as described in the link I gave you: https://wiki.qt.io/Building_Qt_5_from_Git

                    G Offline
                    G Offline
                    Garza
                    wrote on 13 Apr 2021, 12:04 last edited by
                    #9

                    @jsulm I downloaded the sub module I wanted and went to the branch 5.12.2. then there is no CMakelists.txt on that branch, only on the main branch and when running the CMakelists.txt that is there It asks for qt6 which I dont have.

                    J 1 Reply Last reply 13 Apr 2021, 12:06
                    0
                    • G Garza
                      13 Apr 2021, 12:04

                      @jsulm I downloaded the sub module I wanted and went to the branch 5.12.2. then there is no CMakelists.txt on that branch, only on the main branch and when running the CMakelists.txt that is there It asks for qt6 which I dont have.

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 13 Apr 2021, 12:06 last edited by
                      #10

                      @Garza Qt5 uses QMake, Qt6 uses CMake. Main branch is Qt6. If you want to build Qt5 modules use QMake.

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

                      G 1 Reply Last reply 13 Apr 2021, 12:24
                      0
                      • J jsulm
                        13 Apr 2021, 12:06

                        @Garza Qt5 uses QMake, Qt6 uses CMake. Main branch is Qt6. If you want to build Qt5 modules use QMake.

                        G Offline
                        G Offline
                        Garza
                        wrote on 13 Apr 2021, 12:24 last edited by
                        #11

                        @jsulm said in Using socketcan on QT:

                        Main branch is Qt6

                        sorry my dumb questions, so I need to run qmake with the .pro file and then run make, and the .so files on the bin folder will be the ones I have to substitute on the qt?

                        J 1 Reply Last reply 13 Apr 2021, 12:38
                        0
                        • G Garza
                          13 Apr 2021, 12:24

                          @jsulm said in Using socketcan on QT:

                          Main branch is Qt6

                          sorry my dumb questions, so I need to run qmake with the .pro file and then run make, and the .so files on the bin folder will be the ones I have to substitute on the qt?

                          J Offline
                          J Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 13 Apr 2021, 12:38 last edited by
                          #12

                          @Garza Yes, use qmake from your Qt, then "make" and "make install"

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

                          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