Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. Use Libmodbus library
Forum Updated to NodeBB v4.3 + New Features

Use Libmodbus library

Scheduled Pinned Locked Moved Solved QtonPi
3 Posts 2 Posters 3.6k 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.
  • D Offline
    D Offline
    davidino
    wrote on last edited by davidino
    #1

    Goodmorning to all,
    I've build a custom OS image and sdk generated with yocto poky-morty so that I could cross compile my applications for a Raspberrypi3.
    Qt version is 5.7.1. I've done the folling steps:

    • Yocto generated the following modbus library files:
      libmodbus.so
      libmodbus.la
      libmodbus.so.5
      libmodbus.so.5.0.5
      saved in the following path of my host sytem:
      /opt/poky/sdk-2.2.2/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/lib

    • I've downloaded the following modbus qt wrapper project:
      https://github.com/kiug/QModbus

    • When I try to compile the project I get the error:
      modbus.h: No such file or directory

    • I tried to include the external library, giving the path for libmodbus.so reported above but I get the same error.

    Can you help me?
    Thank you.

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

      Hi,

      Why not use the QtSerialBus module ?

      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
      2
      • D Offline
        D Offline
        davidino
        wrote on last edited by davidino
        #3

        Hello StGaist,
        thank you again for your answer. I didn't know of this library, and it looks simpler to use than the qt wrappeer that I found, I'll definitely pass to this.

        Just for information for those ones who use Yocto, the problem was that I had to add the following for seeing modbus.h:
        INCLUDEPATH += $$PWD/../../../../opt/poky/sdk-2.2.2/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/modbus
        DEPENDPATH += $$PWD/../../../../opt/poky/sdk-2.2.2/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/modbus
        After that I had the following problem:
        cannot find /lib/arm-linux-gnueabihf/libpthread.so.0
        and found solution here:
        https://stackoverflow.com/questions/14207189/crosstools-ng-cant-find-pthread-so

        Thank you again StGaist :)

        1 Reply Last reply
        1

        • Login

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