http-mqtt-bridge

command module
v0.0.0-...-65e5cd5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

README

Http-MQTT-Bridge

Codacy Badge Build Status contributions welcome

The HTTP to MQTT bridge should feel that gap of IFTTT Actions for your Custom IoT Hardwares.
The idea is to receive signals using HTTP requests and transfer them to your MQTT broker. The HTTP to MQTT bridge is written using Golang with Gin for HTTP server and Paho MQTT client.

Usage

This app could be hosted on Heroku

Running on Local Machine
  • git clone git@github.com:subzerobo/http-mqtt-bridge.git
  • cd http-mqtt-bridge
  • go get ./...
  • go build -o hmb
  • hmb s --mqtt-host=tcp://localhost:1883
CLI Help
  • hmb s --help
Configuration Environment Variables
  • MQTT Host : MQTT_HOST
  • MQTT User : MQTT_USER
  • MQTT Pass : MQTT_PASS
  • Basic Auth Username : AUTH_USERNAME
  • Basic AuthPassword : AUTH_PASSWORD
Test

curl -XPOST -H 'Content-Type: application/json' -d '{"topic": "ali","message": "This is a Test Message"}' --user alikaviani:F#@{fW+/ localhost:8090/publish

This will publish message: this is a test message to the topic : ali

Deploying to Heroku

You can add required environment variable through .env File accordingly or after creating the heroku app
Navigate to your app then go to Settings -> Config Vars -> Add Environment variables

git clone git@github.com:subzerobo/http-mqtt-bridge.git  
cd  http-mqtt-bridge  
heroku create  
git push heroku master  
heroku open  

OR

Deploy

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL