Why is MQTT supported both as an Adaptor and a Driver?

14 views
Skip to first unread message

Jay Newman

unread,
Jun 6, 2018, 7:58:57 PM6/6/18
to gobotio
Hello,

I'm new to Gobot, but I am working hard to understand it. I have Gobot installed on three machines, my linux laptop, a Raspberry Pi 3B+, and a Raspberry Pi Zero W. Just today I managed to get simple communication working between my laptop and the Pi Zero W. I used the Adaptor version.

What I'm curious about is why there is both an Adaptor and a Driver version, and which should I be using.

Probably later this week I will work on using the Driver version and making the communication less simple.

Thanks to all for providing this framework.
-
Jay

Ron Evans

unread,
Jun 7, 2018, 1:08:40 PM6/7/18
to gobotio
Hi, Jay

Generally speaking in Gobot an Adaptor handles the communication with something, and a Driver is what knows about behavior.

For example, the Raspberry Pi Adaptor implements the GPIO interface, and the LED Driver consumes the interface to be able to implement its own Toggle() function.

In the case of MQTT the Adaptor handles the communication with the MQTT server. The MQTT Driver is intended as a convenience to serve as a sort of "virtual device". Some IoT cloud services call them "device shadows".

Anyhow, hopefully that explains a little better what is intended here.

Jay Newman

unread,
Jun 7, 2018, 2:50:23 PM6/7/18
to gobotio
Ron,

Thank you very much. It explains it well.
-
Jay
Reply all
Reply to author
Forward
0 new messages