Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Qt program freezing with CAN bus periodically
Forum Updated to NodeBB v4.3 + New Features

Qt program freezing with CAN bus periodically

Scheduled Pinned Locked Moved Solved 3rd Party Software
4 Posts 2 Posters 659 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.
  • I Offline
    I Offline
    Imeshsps
    wrote on 28 Mar 2023, 14:32 last edited by
    #1

    I'm trying to interface CAN bus sensor which publish around 2500 massages for a second. The application starts OK and after receiving about 20,000 messages, it starts freezing, stops debug messages and GUI and resumes periodically. I tried placing callback function to a separate thread but still the issue continues. How can I handle that volume of data with Qt ?

    Any helping is really appreciated. Thanks in advance.

    J 1 Reply Last reply 28 Mar 2023, 14:57
    0
    • I Imeshsps
      28 Mar 2023, 16:10

      @JoeCFD I have added a incrementing counter on call back function and for about continuous 25,000 frames, data displays normally with qDebug and all the frames are detected. After that freezing starts. Also, framesAvailable value is most of the time 0 and does not exceed 10. When I send about 30,000 messages continuous with my CAN bus analyzer, it starts freezing around 26,000 and from 30,000 only around 28,800 frames are detected. It seems like it looses the frames sent during freezing period.

      Processor is from NXP i.MX 8 family and it is hexa core. When freezing, one CPU core seems to reach 100%. I checked it with htop.

      I detected same behavior with the "CAN Bus example" comes with Qt.

      This does not seems to occur even when there is 1ms delay between frames. I tried sending 100,000 frames with 1ms delay and it detected all the frames.

      I Offline
      I Offline
      Imeshsps
      wrote on 10 May 2023, 08:23 last edited by
      #4

      @Imeshsps This was solved by reading the CAN messages on a seperate process and pass only necessary data to Qt through a Named pipe. Seems like large number of signals occur from CAN messages overflow the Qt signal space.

      1 Reply Last reply
      1
      • I Imeshsps
        28 Mar 2023, 14:32

        I'm trying to interface CAN bus sensor which publish around 2500 massages for a second. The application starts OK and after receiving about 20,000 messages, it starts freezing, stops debug messages and GUI and resumes periodically. I tried placing callback function to a separate thread but still the issue continues. How can I handle that volume of data with Qt ?

        Any helping is really appreciated. Thanks in advance.

        J Offline
        J Offline
        JoeCFD
        wrote on 28 Mar 2023, 14:57 last edited by
        #2

        @Imeshsps are these 2500 messages/s displayed?

        I 1 Reply Last reply 28 Mar 2023, 16:10
        0
        • J JoeCFD
          28 Mar 2023, 14:57

          @Imeshsps are these 2500 messages/s displayed?

          I Offline
          I Offline
          Imeshsps
          wrote on 28 Mar 2023, 16:10 last edited by Imeshsps
          #3

          @JoeCFD I have added a incrementing counter on call back function and for about continuous 25,000 frames, data displays normally with qDebug and all the frames are detected. After that freezing starts. Also, framesAvailable value is most of the time 0 and does not exceed 10. When I send about 30,000 messages continuous with my CAN bus analyzer, it starts freezing around 26,000 and from 30,000 only around 28,800 frames are detected. It seems like it looses the frames sent during freezing period.

          Processor is from NXP i.MX 8 family and it is hexa core. When freezing, one CPU core seems to reach 100%. I checked it with htop.

          I detected same behavior with the "CAN Bus example" comes with Qt.

          This does not seems to occur even when there is 1ms delay between frames. I tried sending 100,000 frames with 1ms delay and it detected all the frames.

          I 1 Reply Last reply 10 May 2023, 08:23
          0
          • I Imeshsps
            28 Mar 2023, 16:10

            @JoeCFD I have added a incrementing counter on call back function and for about continuous 25,000 frames, data displays normally with qDebug and all the frames are detected. After that freezing starts. Also, framesAvailable value is most of the time 0 and does not exceed 10. When I send about 30,000 messages continuous with my CAN bus analyzer, it starts freezing around 26,000 and from 30,000 only around 28,800 frames are detected. It seems like it looses the frames sent during freezing period.

            Processor is from NXP i.MX 8 family and it is hexa core. When freezing, one CPU core seems to reach 100%. I checked it with htop.

            I detected same behavior with the "CAN Bus example" comes with Qt.

            This does not seems to occur even when there is 1ms delay between frames. I tried sending 100,000 frames with 1ms delay and it detected all the frames.

            I Offline
            I Offline
            Imeshsps
            wrote on 10 May 2023, 08:23 last edited by
            #4

            @Imeshsps This was solved by reading the CAN messages on a seperate process and pass only necessary data to Qt through a Named pipe. Seems like large number of signals occur from CAN messages overflow the Qt signal space.

            1 Reply Last reply
            1
            • I Imeshsps has marked this topic as solved on 10 May 2023, 08:23

            • Login

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