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. Detect SD card in Qt linux
QtWS25 Last Chance

Detect SD card in Qt linux

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 831 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.
  • ivanicyI Offline
    ivanicyI Offline
    ivanicy
    wrote on last edited by
    #1

    Hello!!

    I need to detect a SD card inserted in the system in linux. I want to know the available storage for showing it in the interface.

    How can I work with this, because I tried with QStorageInfo but it couldn't detect it.

    Thank you very much!

    aha_1980A 1 Reply Last reply
    0
    • ivanicyI ivanicy

      Hello!!

      I need to detect a SD card inserted in the system in linux. I want to know the available storage for showing it in the interface.

      How can I work with this, because I tried with QStorageInfo but it couldn't detect it.

      Thank you very much!

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @ivanicy,

      does Linux detect the SD card insertion?

      What does dmesg --follow print while you insert the SD card?

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      1
      • ivanicyI Offline
        ivanicyI Offline
        ivanicy
        wrote on last edited by
        #3
        [20515.536057] usb 7-2: new high-speed USB device number 10 using xhci_hcd
        [20515.697534] usb 7-2: New USB device found, idVendor=05e3, idProduct=0745
        [20515.697540] usb 7-2: New USB device strings: Mfr=0, Product=1, SerialNumber=2
        [20515.697543] usb 7-2: Product: USB Storage
        [20515.697546] usb 7-2: SerialNumber: 000000000902
        [20515.699125] usb-storage 7-2:1.0: USB Mass Storage device detected
        [20515.699421] scsi host8: usb-storage 7-2:1.0
        [20516.717964] scsi 8:0:0:0: Direct-Access     Generic  STORAGE DEVICE   0902 PQ: 0 ANSI: 6
        
        

        Ubuntu recognises the sd card but, I don't know how to obtain its information with qt

        aha_1980A 1 Reply Last reply
        0
        • ivanicyI ivanicy
          [20515.536057] usb 7-2: new high-speed USB device number 10 using xhci_hcd
          [20515.697534] usb 7-2: New USB device found, idVendor=05e3, idProduct=0745
          [20515.697540] usb 7-2: New USB device strings: Mfr=0, Product=1, SerialNumber=2
          [20515.697543] usb 7-2: Product: USB Storage
          [20515.697546] usb 7-2: SerialNumber: 000000000902
          [20515.699125] usb-storage 7-2:1.0: USB Mass Storage device detected
          [20515.699421] scsi host8: usb-storage 7-2:1.0
          [20516.717964] scsi 8:0:0:0: Direct-Access     Generic  STORAGE DEVICE   0902 PQ: 0 ANSI: 6
          
          

          Ubuntu recognises the sd card but, I don't know how to obtain its information with qt

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @ivanicy

          Yeah, but it misses vital information. For me it looks like this:

          [153610.743719] usb-storage 3-2:1.0: USB Mass Storage device detected
          [153610.743841] scsi host4: usb-storage 3-2:1.0
          [153610.744018] usbcore: registered new interface driver usb-storage
          [153610.745940] usbcore: registered new interface driver uas
          [153611.958041] scsi 4:0:0:0: Direct-Access                               1100 PQ: 0 ANSI: 4
          [153611.958981] sd 4:0:0:0: Attached scsi generic sg2 type 0
          [153611.958995] sd 4:0:0:0: [sdc] 15810560 512-byte logical blocks: (8.10 GB/7.54 GiB)
          [153611.959453] sd 4:0:0:0: [sdc] Write Protect is off
          [153611.959460] sd 4:0:0:0: [sdc] Mode Sense: 43 00 00 00
          [153611.959975] sd 4:0:0:0: [sdc] No Caching mode page found
          [153611.959991] sd 4:0:0:0: [sdc] Assuming drive cache: write through
          [153611.970892]  sdc: sdc1
          [153611.972933] sd 4:0:0:0: [sdc] Attached SCSI removable disk
          

          Here you see, that a partition sdc was detected, and then the media was mounted into media/user/<device-id> (can be checked with mount).

          Is that the case for you too?

          Regards

          Qt has to stay free or it will die.

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

            Hi,

            KDE's Solid library can help you there.

            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

            • Login

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