Unsolved Qt Location. QML
-
I have been trying to play with Qt Location, but i couln't make it work.
I get this:: "serialnmea: No known GPS device found. Specify the COM port via QT_NMEA_SERIAL_PORT.
qml:
Failed to create Geoclue client interface. Geoclue error: org.freedesktop.DBus.Error.Disconnected"I have tried to run several devices as external gps for the pc, but no success. ¿ Any workaround? Help would be appreciated.
I have tried the MAP viewer(QML) example and also this basic block code to test it.
import QtQuick 2.7 import QtQuick.Window 2.2 import QtPositioning 5.6 import QtLocation 5.6 Item{ PositionSource{ active: true onPositionChanged: { console.log(position.coordinate); } } }
-
Hi,
Did you get your device to work outside of Qt ?
Does your system recognize them properly ?
-
Is necessary to use any real external device?, is not possible to simulate data?, or gps connection that works with QT?
-
IIRC there's the
simulator
plugin -
Can you tell me a little more please?. where can i get this?
-
Sorry, my bad, Qt Simulator doesn't apply in your case. It's a bit old and was for the Nokia time.
Maybe the gypsy plugin could be an alternative.
-
@Frank84 said:
Is necessary to use any real external device?, is not possible to simulate data?, or gps connection that works with QT?
You can use NMEA files todo so. In QML you can use PositionSource's nmeaSource property
There a tools available to generate such .nmea files.I haven't used it yet though. So i can't tell if it works out of the box.
-
There was a thread about simulated GPS data with QtQuick some time ago: http://forum.qt.io/topic/66845.
-
@Wieland
ah didn't know about the log file position source example yet.
Thats even simpler than messing around with the .nmea files. -
I get this error:
"Failed to create Geoclue client interface. Geoclue error: org.freedesktop.DBus.Error.Disconnected"Do i need another plugin? which one?, i'm using windows.. ..Thank you again
-
You would need DBus running on Windows.
I'd recommend following @Wieland and @raven-worx suggestions for simulating GPS data.
-
You should be able to directly plug in an nmea file to the source, and it'll work. If you don't have one, you can use this - https://github.com/Esri/arcgis-runtime-samples-data/blob/master/gps/campus.txt
Also, ArcGIS Runtime SDK provides a position plugin for Windows, so you can get your current position on Windows, with no need for simulation - https://developers.arcgis.com/qt/qml/guide/show-device-location.htm
-
@Frank84
try to identify your gps socket
PositionSource {
nmeaSource: "socket://127.0.0.1:12345"
}