Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. serialnmea plugin help
Qt 6.11 is out! See what's new in the release blog

serialnmea plugin help

Scheduled Pinned Locked Moved Solved QML and Qt Quick
12 Posts 3 Posters 3.4k Views 2 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #3

    Hi and welcome to devnet,

    One thing you should do is enumerate the serial ports of your computer with QSerialPortInfo::availableaPortsto see which one matches 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

    C 1 Reply Last reply
    0
    • SGaistS SGaist

      Hi and welcome to devnet,

      One thing you should do is enumerate the serial ports of your computer with QSerialPortInfo::availableaPortsto see which one matches your device.

      C Offline
      C Offline
      cswingle
      wrote on last edited by
      #4

      @SGaist Thanks! I'm not sure how to do that in QML, but I have copied the serialnmea code into my own version of the plugin and added logging lines to the NmeaSource::NmeaSource() function where it loops through QSerialPortInfo (lines 148-153 of qgeopositioninfosourcefactory_serialnmea.cpp). When I do that I get logging lines like this:

      myserialnmea: vendor identifier 67b, port name cu.usbserial-1420
      myserialnmea: found a supported device, cu.usbserial-1420
      

      However, no matter what I do (specifying that serial port, or leaving the plugin to load it on it's own (since it's supported)), I always get something similar to this (the order of the "Failed to open" message and "invalid nullptr parameter" varies, probably due to threading):

      QObject::connect(QSerialPort, Unknown): invalid nullptr parameter
      serialnmea: Failed to open cu.usbserial-1420
      

      When I set QT_FATAL_WARNINGS=1 and use my plugin source code so I can determine the line number of the crash, it appears to be crashing on this line (equivalent to line 68 of qgeopositioninfosourcefactory_serialnmea.cpp):

      QSerialPort *port = new QSerialPort(portName);
      

      But I don't know how to diagnose this any further. In cases where I'm not specifying portName using a QML parameter, the plugin is determining the port name itself via QSerialPortInfo, so I'd think there could be no issue with the naming. It seems like it should "just work," but it's not and I am out of ideas on how to fix it. I haven't tried other versions of Qt beyond 5.14.2, and I can't use 5.15 because the ESRI SDK doesn't support it yet.

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

        Is that plugin code available somewhere ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        C 2 Replies Last reply
        0
        • SGaistS SGaist

          Is that plugin code available somewhere ?

          C Offline
          C Offline
          cswingle
          wrote on last edited by
          #6

          @SGaist Which? You mean the code I modified? I can share it if that's what you mean, but it's essentially identical to serialnmea except I renamed it and added a bunch of qWarning() statements so I could trace the progress of the plugin. I'm having the same trouble with the Qt-supplied serialnmea; mine just attempts to explain what's going on. But if you think it'd help identify where serialnmea is failing, I'm happy to dump it somewhere you can access.

          1 Reply Last reply
          0
          • SGaistS SGaist

            Is that plugin code available somewhere ?

            C Offline
            C Offline
            cswingle
            wrote on last edited by
            #7

            @SGaist The serialnmea code is in $QT_HOME/$QT_VERSION/Src/qtlocation/src/plugins/position/serialnmea. It looks to be different between 5.14.2 and 5.12.9. In 5.14.2 it's subclassing QGeoPositionInfoSourceFactoryV2 instead of
            QGeoPositionInfoSourceFactory, which means it can take parameters. The older version uses environment variables (or searching for a supported device using QSerialPortInfo).

            1 Reply Last reply
            0
            • C Offline
              C Offline
              cswingle
              wrote on last edited by
              #8

              An update: I built my app using 5.12.9 and the serialnmea plugin works as advertised with the same code and hardware GPS I was using before. Unfortunately, this version of the plugin doesn't allow for parameters because it doesn't subclass QGeoPositionInfoSourceFactoryV2, which was introduced in 5.14.

              To me, this seems like a regression between 5.12.9 and 5.14.2 since the same code works with 5.12.9 and doesn't with 5.14.2. Is there a place to report regressions like this? Can someone help me figure out how to get the 5.14.2 version to work so I can dynamically change the serial port being used (rather than require users pass it in at startup via environment variable or depend on the auto-detection of supported devices)?

              Pablo J. RoginaP 1 Reply Last reply
              0
              • C cswingle

                An update: I built my app using 5.12.9 and the serialnmea plugin works as advertised with the same code and hardware GPS I was using before. Unfortunately, this version of the plugin doesn't allow for parameters because it doesn't subclass QGeoPositionInfoSourceFactoryV2, which was introduced in 5.14.

                To me, this seems like a regression between 5.12.9 and 5.14.2 since the same code works with 5.12.9 and doesn't with 5.14.2. Is there a place to report regressions like this? Can someone help me figure out how to get the 5.14.2 version to work so I can dynamically change the serial port being used (rather than require users pass it in at startup via environment variable or depend on the auto-detection of supported devices)?

                Pablo J. RoginaP Offline
                Pablo J. RoginaP Offline
                Pablo J. Rogina
                wrote on last edited by
                #9

                @cswingle said in serialnmea plugin help:

                Is there a place to report regressions like this?

                I'd say Qt Bug Tracker
                Please provide any meaningful information (and even data sets if applicable) so the issue is easy and quickly reproducible.

                Upvote the answer(s) that helped you solve the issue
                Use "Topic Tools" button to mark your post as Solved
                Add screenshots via postimage.org
                Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                C 1 Reply Last reply
                0
                • Pablo J. RoginaP Pablo J. Rogina

                  @cswingle said in serialnmea plugin help:

                  Is there a place to report regressions like this?

                  I'd say Qt Bug Tracker
                  Please provide any meaningful information (and even data sets if applicable) so the issue is easy and quickly reproducible.

                  C Offline
                  C Offline
                  cswingle
                  wrote on last edited by
                  #10

                  @Pablo-J-Rogina Thanks! I found the bug: QTBUG-82819. Using the patch in that issue against 5.14.2 fixed the serialnmea plugin, at least in early testing. I don't know what the Qt protocols are for fixing bugs in previous versions, but it seems like the patch for that issue should have been applied to 5.14 and a new release made (or applied when there is a new point release of 5.14).

                  Pablo J. RoginaP 1 Reply Last reply
                  0
                  • C cswingle

                    @Pablo-J-Rogina Thanks! I found the bug: QTBUG-82819. Using the patch in that issue against 5.14.2 fixed the serialnmea plugin, at least in early testing. I don't know what the Qt protocols are for fixing bugs in previous versions, but it seems like the patch for that issue should have been applied to 5.14 and a new release made (or applied when there is a new point release of 5.14).

                    Pablo J. RoginaP Offline
                    Pablo J. RoginaP Offline
                    Pablo J. Rogina
                    wrote on last edited by Pablo J. Rogina
                    #11

                    @cswingle said in serialnmea plugin help:

                    but it seems like the patch for that issue should have been applied to 5.14 and a new release made

                    Well, it looks like the patch is applied to 5.15.0, from the bug details:

                    Fix Version/s: 5.15.0 Beta2, 5.15

                    which at some point makes sense with the ongoing policy regarding patches and open-source versions, LTS and commercial offering

                    We are making this change to encourage open-source users to quickly adopt new versions

                    BTW, would you consider using Qt 5.15.0 as it's the latest (as of today) LTS release?

                    Upvote the answer(s) that helped you solve the issue
                    Use "Topic Tools" button to mark your post as Solved
                    Add screenshots via postimage.org
                    Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                    C 1 Reply Last reply
                    0
                    • Pablo J. RoginaP Pablo J. Rogina

                      @cswingle said in serialnmea plugin help:

                      but it seems like the patch for that issue should have been applied to 5.14 and a new release made

                      Well, it looks like the patch is applied to 5.15.0, from the bug details:

                      Fix Version/s: 5.15.0 Beta2, 5.15

                      which at some point makes sense with the ongoing policy regarding patches and open-source versions, LTS and commercial offering

                      We are making this change to encourage open-source users to quickly adopt new versions

                      BTW, would you consider using Qt 5.15.0 as it's the latest (as of today) LTS release?

                      C Offline
                      C Offline
                      cswingle
                      wrote on last edited by
                      #12

                      @Pablo-J-Rogina I would use 5.15 if I could, but I'm also using the ESRI ArcGIS Runtime SDK for Qt (100.8) in the project, and they don't yet support 5.15. Version 100.9 will, but it's not out yet. For now, I'll patch and build the serialnmea plugin for 5.14.2.

                      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