Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for MCUs
  4. Unable to open I2C device: No such file or directory on Boot2Qt
QtWS25 Last Chance

Unable to open I2C device: No such file or directory on Boot2Qt

Scheduled Pinned Locked Moved Solved Qt for MCUs
6 Posts 3 Posters 2.1k 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.
  • T Offline
    T Offline
    Thomas D.M.
    wrote on last edited by
    #1

    Hi everyone,
    I'm trying to run a Qt5 application wrote from us that use the i2c interface to communicate to some buttons. We followed this guide https://doc.qt.io/archives/qt-5.8-devicecreation/qtee-preparing-hardware-rasberrypi.html on how to configure the sd card and Qt Creator.

    Once we compiled the and deployed the application, at first the rpi3 reported an error on missing wiringPi libraries. To solve that problem we copied a compiled version of libwiringPi.so.2.50 and libwiringPiDev.so.2.50 in the /usr/lib/ rpi3 directory using scp. But now, if we try to run the application this error comes out:

    Unable to open I2C device: No such file or directory
    Process exited with exit code 1
    quit
    

    We tried, by mounting /dev/mmcblk0p1, to edit the config.txt file enabling:

    dtparam=i2c_arm=on
    dtparam=spi=on
    

    Nothing changed.

    Thank you in advance for your help. If you also know some other guides to develop Qt5 applications using the i2c interface on Boot2Qt it would be awsome.

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

      Hi and welcome to devnet,

      This is just a wild guess but did you check that you indeed have the corresponding devices active ?

      There's this guide that seemed to be quite complete in that reguard.

      Hope it helps

      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
      • T Offline
        T Offline
        Thomas D.M.
        wrote on last edited by
        #3

        Hi,
        Thanks for your reply. I'm currently using Boot2Qt from Qt for device creation so I cannot open raspi-config.
        I found a thread that almost solved my problem: https://www.raspberrypi.org/forums/viewtopic.php?t=188248.
        Basically by running:

        modprobe i2c-dev
        

        the i2c turns on and my application does work. The problem is that I need the i2c to be active at boot time.

        Can I write a script that can automatically be executed at boot time in which I run the command above?

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Thomas D.M.
          wrote on last edited by
          #4

          Ok I solved my problem thanks to this guide: https://retifrav.github.io/blog/2017/12/08/b2qt-startup-script/.

          Basically I created a script which run:

          modprobe i2c-dev
          

          and my application.

          Everything works fine.

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

            Or you can edit /etc/modules which lists the modules you want to be explicitly loaded at boot time.

            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
            • H Offline
              H Offline
              Harish18
              wrote on last edited by Harish18
              #6

              Thank you in advance for your help. If you also know some other guides to develop Qt5 applications using the i2c interface on Boot2Qt it would be awsome.
              Download Piano Music Tiles 2 Mod

              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