Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement proposal]: Implementation of an MQTT-Client #2435

Open
soester opened this issue Jan 26, 2022 · 5 comments
Open

[enhancement proposal]: Implementation of an MQTT-Client #2435

soester opened this issue Jan 26, 2022 · 5 comments

Comments

@soester
Copy link

soester commented Jan 26, 2022

Introduction

It would be great if QField would have some sort of interface to receive data from outside your tablet. This could be external sensors or any kind of data available through a network connection. Also to publish data to send commands would in some cases be usefull

A versatile and universally applicable solution to this problem would be the implementation of an MQTT client.

MQTT

(http://mqtt.org)
MQTT is an OASIS standard messaging protocol for the Internet of Things (IoT). It is designed as an extremely lightweight publish/subscribe messaging transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth. MQTT today is used in a wide variety of industries, such as automotive, manufacturing, telecommunications, oil and gas, etc.

Proposed implementation

Qfield

Enable Qfield to subscribe and publish to mqtt topics. There are different (opensource libraries available, eg. in java:

  • subscribe: make a topic available as a project (or rather mqtt) variable
  • publish: publish a user defined expression as specific topic via mqtt (eg. when digitizing a feature)

MQTT-Broker

To publish and subscribe to MQTT access to a mqtt-broker must be available. This can be achieved over network. There are different payed, some free services available. Or you can host your own service. An other option ist to run it locally on your tablet (eg. as an app or via termux + node-red). The choice is dependent on the use case.

Use cases

I think there is an endless number of use cases for this. Some examples:

Use cases subscription:

  • Get value from external sensor (connect sensor to local mqtt-broker): This could be anything but really useful for environmental sensors.
  • Get value from web service: Why not to log meteorological data while acquiring filed data?
  • If you publish sensor data of your mobile device to your local broker it would even be be possible to solve problems like described in: Feature request: geologic compass #1882
  • ...

Use cases publication:

We would be glad to fund some parts of required development. Is there anyone else interested in this?

Whats your opinion @m-kuhn?

@m-kuhn
Copy link
Member

m-kuhn commented Mar 25, 2022

I like the idea, very nice.
Where would you see the configuration pf connection parameters (host etc) in QField or the project?
Where do you see login credentials fit best?

@soester
Copy link
Author

soester commented Mar 25, 2022

Glad you like it :-)

Where would you see the configuration pf connection parameters (host etc) in QField or the project?
I think there are arguments for both:

  • QField: Easy adaption on each Tablet for Tablet specific parameters. A similar approach like connecting to an external gnss reciever could be used.
  • Project: Prepare project in QGIS and distribute it to all fieldworkers. I think like this also an implementation in QGIS would be required?

Where do you see login credentials fit best?

I think for use cases restricted to local usage (all run on localhost) anonymus access without credentials would be possible.
But to subscribe to internet based services authentication is a must (either via user/password and TLS or via X.509 Certificate Based Authentication).
I think something like the pg_conf file would be a good option? For the certificate based approach selecting certificates via GUI would be nice!

@soester
Copy link
Author

soester commented Mar 8, 2023

@m-kuhn @nirvn if we are talking about upstream implementation in qgis qgis/QGIS-Enhancement-Proposals#257 might be interesting?
and more specifically this: FraunhoferIOSB/FROST-Server#1297

@nirvn
Copy link
Member

nirvn commented Aug 11, 2024

@soester , out of curiosity, have you made some tests using the TCP/UDP/serial port sensor support added a while back?

@soester
Copy link
Author

soester commented Aug 13, 2024

@nirvn yes we are using UDP sensor support in production. Our old system (via termux float widget) was no longer reliable on newer Android versions. Since then we have been using a combination of yoctopuce (serial connector), node-red and udp sensor interface in Qfield.
Unfortunately, the generation of measuring devices for which this system works is very old and needs to be replaced. Therefore, despite the cool function, we only use it sporadically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants