Sign inSign up

firesphere/http2mqtt

By firesphere

•Updated about 1 year ago

A fairly simple http to mqtt bridge, for when you have clients that don't speak mqtt

Image
Networking
Message queues
Web servers
0

1.0K

firesphere/http2mqtt repository overview

⁠HTTP2MQTT

A simple HTTP server with web.py that forwards POST data to MQTT

Useful for when you have a server that can't use mqtt in curl, but you want to put data in to MQTT anyway.

⁠WARNING

There is no security in front of the http requests! So don't expose this to the internet, or put it behind a proxy that handles BasicAuth for you.

⁠Usage

⁠Making a post

Post to http://example.com:8080/mqtt/YOUR/TOPIC⁠

The post data will be forwarded to YOUR/TOPIC in MQTT.

⁠Reading MQTT messages

Visit http://example.com:8080/http/YOUR/TOPIC⁠

The post data will be requested from YOUR/TOPIC in MQTT.

⁠Configuration

⁠Stand-alone
MQTT_HOST=127.0.0.1
MQTT_PORT=1883
MQTT_USER="user"
MQTT_PASS="password"
MQTT_RETAIN=True|False

MQTT_RETAIN can be set to False if the messages should not be retained.

⁠Docker

Use the provided docker-compose.yml. It will pick up the .env

⁠Cow?

Cow!


             /( ,,,,, )\
            _\,;;;;;;;,/_
         .-"; ;;;;;;;;; ;"-.
         '.__/`_ / \ _`\__.'
            | (')| |(') |
            | .--' '--. |
            |/ o     o \|
            |           |
           / \ _..=.._ / \
          /:. '._____.'   \
         ;::'    / \      .;
         |     _|_ _|_   ::|
       .-|     '==o=='    '|-.
      /  |  . /       \    |  \
      |  | ::|         |   | .|
      |  (  ')         (.  )::|
      |: |   |;  U U  ;|:: | `|
      |' |   | \ U U / |'  |  |
      ##V|   |_/`"""`\_|   |V##
         ##V##         ##V##

Tag summary

Content type

Image

Digest

sha256:99a096aa9…

Size

101.6 MB

Last updated

about 1 year ago

docker pull firesphere/http2mqtt