/mqtt-mode

MQTT client for Emacs.

Primary LanguageEmacs Lisp

mqtt-mode – publish and subscribe to MQTT

Overview

mqtt-mode provides a major mode for interaction with MQTT servers.

Dependencies

This mode makes use of mosquitto_pub and mosquitto_sub from the Mosquitto MQTT server. Therefore mosquitto must be installed. The binaries are sometimes distributed as separate package.

Debian:

apt install mosquitto-clients

Gentoo:

emerge mosquitto

Installation

To install this mode, add the repository to your load path and load it:

(add-to-list 'load-path "~/path/to/mqtt-mode/")
(require 'mqtt-mode)

Configuration

For configuration options, please look at the customization group mqtt. Most importantly, you should probably configure

  • mqtt-host — host name of MQTT server
  • mqtt-port — port of MQTT server
  • mqtt-username — username for MQTT server
  • mqtt-password — password for MQTT server
  • mqtt-subscribe-topic and mqtt-publish-topic — topics to subscribe and publish to

Usage

You can either run the consumer with mqtt-start-consumer or run the comint based client with mqtt-run. Messages can be sent with mqtt-publish-message and mqtt-publish-region.