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. Cannot open Serial Port using CuteCom
QtWS25 Last Chance

Cannot open Serial Port using CuteCom

Scheduled Pinned Locked Moved General and Desktop
10 Posts 2 Posters 15.9k 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.
  • H Offline
    H Offline
    houmingc
    wrote on last edited by
    #1

    I am using Cutecom to connect to my device
    When i "open device", Error "could not open /dev/ttyUSB0

    sudo apt-get install cutecom
    may i know where is cutecom installed. <Which CuteCom not working>

    Finding ports ttyUSB0 connected
    dmesg |grep tty shows ttyUSB0 connected
    usb 2-1.3:pl203 now attached to ttyUSB0

    I have check with lsusb, and device is connected

    I set the baud rate, data bits, stops bits and hex input at the right bottom.
    I tried with minicom, but i can't open serial port too

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

      Hi,

      Not really a Qt question but anyway, do you have the rights to access your device ?

      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
        houmingc
        wrote on last edited by
        #3

        sudo chmod a+rw /dev/ttyUSB0

        works

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

          And that's a security hole wide open.

          You should rather add your user to the correct group.

          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
            houmingc
            wrote on last edited by
            #5

            It is troublesome to run this command everytimes.
            Is there other alternatives?

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

              Yes there is. What I suggested in my last message

              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
                houmingc
                wrote on last edited by
                #7

                I do not know what is the benefit of doing so.
                Below is the steps on 'how to add user to correct Group'?
                What is the difference between primary and secondary group

                @
                First, list all group $ cut -d: -f1 /etc/group
                Second, login as root user, $ su -
                Third, add user: $ sudo adduser new_username
                & add group: $ groupadd groupname
                & add user into group $ useradd -G groupname new_username
                Fouth, grant sudo privilege $visudo
                below root, add newuser ALL=(ALL:ALL) ALL
                Fifth, save and closed Ctrl + X
                @

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

                  The benefit ? You don't allow everybody and anybody the rights to access the serial port.

                  The secondary groups are just the additional groups your user is part of e.g. dial out

                  @useradd -G dialout username@
                  is a bit simpler

                  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
                    houmingc
                    wrote on last edited by
                    #9

                    CuteCom can always open serial port but Qt program open serial port sometimes. What is the solution

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

                      Is there a pattern when it fails to open the device ? Did you check if there's an error message returned by QSerialPort ?

                      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

                      • Login

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