thin-edge / thin-edge.io

The open edge framework for lightweight IoT devices
https://thin-edge.io
Apache License 2.0
221 stars 54 forks source link

Cloud communication without MQTT #288

Closed pavel-at-adamos closed 3 years ago

pavel-at-adamos commented 3 years ago

I saw in the Architecture FAQs that:

"Using MQTT for cloud communication is not mandatory. You are free to add additional protocols beside MQTT: Because thin-edge.io has an internal bus, you can implement a bridge to another protocol (e.g. LWM2M or plain HTTPS). In that case, MQTT is used inside the edge devices, and another protocol is used for external communication."

As far as I understand anyone can implement a custom bridge that communicates with some cloud provider not via MQTT but via REST over HTTPS for example. However I couldn't find any documentation about how such a custom bridge can be implemented. I found only the documentation about the mapper. Are there examples of using some other protocol than MQTT for cloud communication?

Also while going through the documentation and examples it seems that the mapper also specifies the outbound MQTT topic that forwards the messages to the cloud, e.g. here for C8Y. Is that correct?

didier-wenzek commented 3 years ago

Your understanding is correct. Thin-edge is designed so a custom bridge can be implemented to forward local MQTT messages to a cloud end-point over HTTPS. However, there is currently no such implementation or example.

The principles are simple.

In practice, things are more involved.

didier-wenzek commented 3 years ago

Do you have a concrete use-case in mind?

pavel-at-adamos commented 3 years ago

@didier-wenzek thanks a lot for the info!

Yes, the use-case is to make a connection to the ADAMOS HUB similar to the way it is available for Cumulocity and Azure. This way thin-edge.io users could just go tedge connect adamos or something to that effect.

I know that MQTT is the go-to protocol for thin-edge.io but do you know if there is a plan to add bridges for other protocols like OPC-UA and HTTPS? A reference implementation of such bridges at first would also be very helpful.

I mean ideally cloud providers would just have to implement a Thin-Edge-JSON-Mapper so that the messages get translated but the cloud connection could be configured by the client. Cumulocity also has a REST API so theoretically someone could decide, for whatever reason, that they want to use the HTTPS bridge instead of the MQTT one. But probably that's not as easy as it sounds :)

itsyitsy commented 3 years ago

Hey @pavel-at-adamos, absolutely right the connection to some of the cloud platforms could also be done via other mediums than MQTT. For us, it is more about supporting platforms than a specific medium. That said sooner or later thin-edge.io might also connect to platforms that do not support MQTT, but currently, we have nothing specific on our roadmap not using MQTT as their main channel. Of course that does not mean that anything is stopping a contributor to connect to his cloud (as ADAMOS HUB) via https or any other protocol. The isolation of internals and external communication in the thin-edge.io should make that a pretty doable project. 👍

pavel-at-adamos commented 3 years ago

Ok, thanks for the feedback, @itsyitsy! I'll close the issue.