INTERMAGNET / wg-www-gins-data-formats

Repository to track working group discussions for WWW/Gins/Data Formats
2 stars 1 forks source link

Implementation of MQTT at Edinburgh GIN #12

Open SimonFlower opened 1 year ago

SimonFlower commented 1 year ago

This issue originated in issue #6

Architecture for implementation of MQTT.

The MQTT broker is off-the-shelf open source software. The clients are bespoke programs, using an MQTT client library to gain access to the MQTT broker. Questions:

Things that need to be decided for implementation at the Edinburgh GIN

To load data into the GIN's data store the following metadata is needed:

For the data, the following is required:

Questions:

Notes from Roman

Required installations for full MQTT support (and python support)

Broker installation: https://github.com/geomagpy/MARTAS#5-setup-of-a-broker

Authentication and ssl: https://github.com/geomagpy/MARTAS#23-install-mqtt

Quality-of-service (or how to verify the identity between send and received): https://github.com/geomagpy/MARTAS#33-understanding-quality-of-service-qos

Notes from Stephan

You can find the client/server libraries here https://mqtt.org/getting-started/

I also found it very useful to go through the explanations written down by the people from HiveMQ https://www.hivemq.com/mqtt-essentials/ It is well written and complete info on what is mqtt and how to use it.

As you can see the broker used by me and Roman is mosquitto.(https://mosquitto.org/) which is easy to set up.

As client library people often tend to use paho-mqtt because it is one of the first packages available and supports major programming languages (https://www.eclipse.org/paho/index.php?page=downloads.php). I used lots of different clients and all were easy to setup and straight forward to use.

stephanbracke commented 1 year ago

Some comments

First of all is this right : Yes. Are more mqtt servers involved ? Not necessarily. In the institute you can use your own mqtt server and bridge just the topics that are needed towards the MQTT broker at BGS DMZ. What are the advantages :

disadvantage :

Personnally I use a broker in Antarctica that is bridged towards a broker in Dourbes ( for the one in Dourbes it is like a normal client no bridge config on the broker in Dourbes) When You don't use a local broker you need to provide a sort of caching/resend/reconnect mechanism in your client code because when client disconnect in general the messages are just lost. In the end it is a decision on the institute level and will not have big influences on the way you implement it on BGS side. I have to admit that I only have experience with bridging mosquitto with mosquitto brokers so I don't know what happens if you use different brokers. The reason why I used mosquitto is simple : it does the job for what I need and I had no big issues with it.Naturally I don't have big load.

SimonFlower commented 1 year ago

Thanks for all the information everyone. It looks to me as though one of the next tasks is for us to agree a payload format for Geomag data in Intermagnet (which I will need to know in order to start writing the software to receive MQTT data into the Edinburgh GIN). Are there any existing candidates for this format from people who are already using MQTT or do we need to design an Intermagnet MQTT payload format from scratch? I think these are the things we need to resolve (please tell me if I've missed anything):

SimonFlower commented 7 months ago

I've put together a draft service description for an MQTT service to be implemented at the Edinburgh GIN, including a suggestion for the payload format. Please can you have a look https://github.com/INTERMAGNET/wg-www-gins-data-formats/tree/master/ImagMQTT and send me any comments / alterations by the end of December? Please do let me know if this deadline is too short and I'll extend it, but I would like to get started on implementation early in the New Year. Please can people with MQTT expertise check what I've said about the MQTT configuration - my knowledge of this comes only from reading documentation, not from experience!