MQTT client

Related tags

Network mqttcli
Overview

mqttcli -- MQTT Client for shell scripting

mqttcli is an MQTT 3.1.1 Client which has almost same options with mosquitto_pub/sub. However, it has additional functionality and a pubsub command which is suite for the shell script pipelining.

Install

Download from here. Please choose your artitecture. (and chmod ugo+x if needed)

curl https://raw.githubusercontent.com/shirou/mqttcli/master/install.sh | sh

Or if you have golang environment, type this to build on your host.

go get github.com/shirou/mqttcli

Usage

common

You can set host, port, username and password on the Environment variables.

export MQTT_HOST="localhost"
export MQTT_PORT="1883"
export MQTT_USERNAME="user"
export MQTT_PASSWORD="blahblah"

or using a config file. You can specify a config file by --conf option. or automatically load from ~/.mqttcli.cfg.

% mqttcli sub --conf yoursettings.json -t "some/topic"

example:

{
  "host": "localhost",
  "port": 1883,
  "username": "user",
  "password": "blahblah"
}

If you use AWS IoT, you can use these JSON as mqttcli config file, such as

{
  "host": "A3HVHEAALED.iot.ap-northeast-1.amazonaws.com",
  "port": 8883,
  "clientId": "something",
  "thingName": "something",
  "caCert": "path/to/root-CA.crt",
  "clientCert": "path/to/2a338xx2xxf-certificate.pem.crt",
  "privateKey": "path/to/aad380efffx-private.pem.key"
}

You may change cert files path to where you placed.

Pub

mqttcli pub -t "some/where" -m "your message"

or

tail -f /var/log/nginx.log | mqttcli pub -t "some/where" -s

-s is diffrent from mosquitto_pub, it sends one line to one message.

Sub

mqttcli sub -t "some/#"

PubSub

Note: This subcommand is just a concept work. Might be delete in the future.

Publish from stdin AND Subscribe from some topics and print stdout.

tail -f /vag/log/nginx.log | mqttcli pubsub --pub "some/a" --sub "some/#" > filterd.log

This is useful when other client manuplate something and send back to the topic.

Reference

paho.mqtt.golang.git
http://godoc.org/git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.golang.git

License

Eclipse Public License - v 1.0 (same as Paho's)

Comments
Releases(0.1.0)
Owner
shirou
shirou
Proof of concept project with MQTT and PLC4X imported as Go modules

portal-connect PoC for a edge MQTT client written in Go Basic project setup with PLC4X and Eclipse Paho How to run Install latest Go version https://g

pragmatic industries GmbH 8 Jan 19, 2022
Prisma Client Go is an auto-generated and fully type-safe database client

Prisma Client Go Typesafe database access for Go Quickstart • Website • Docs • API reference • Blog • Slack • Twitter Prisma Client Go is an auto-gene

Prisma 1.4k Jan 9, 2023
The Dual-Stack Dynamic DNS client, the world's first dynamic DNS client built for IPv6.

dsddns DsDDNS is the Dual-Stack Dynamic DNS client. A dynamic DNS client keeps your DNS records in sync with the IP addresses associated with your hom

Ryan Young 15 Sep 27, 2022
Go Substrate RPC Client (GSRPC)Go Substrate RPC Client (GSRPC)

Go Substrate RPC Client (GSRPC) Substrate RPC client in Go. It provides APIs and types around Polkadot and any Substrate-based chain RPC calls. This c

Chino Chang 1 Nov 11, 2021
Server and client implementation of the grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs from gRPC go introduction

Description This is an implementation of a gRPC client and server that provides route guidance from gRPC Basics: Go tutorial. It demonstrates how to u

Joram Wambugu 0 Nov 24, 2021
Godaddy-domains-client-go - Godaddy domains api Client golang - Write automaticly from swagger codegen

Go API client for swagger Overview This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you c

Mickael Stanislas 0 Jan 9, 2022
Tailscale-client-go - A client implementation for the Tailscale HTTP API

tailscale-client-go A client implementation for the Tailscale HTTP API Example p

David Bond 0 Sep 8, 2022
Comunicación de envios de archivos entres cliente-servidor, client-client.

Client - Server - Client Estes es un proyecto simple de comunicacion de envios de archivos del cliente al servidor y viceversamente, y de cliente a cl

Melvin RB 1 Jul 16, 2022
CoAP Client/Server implementing RFC 7252 for the Go Language

Canopus Canopus is a client/server implementation of the Constrained Application Protocol (CoAP) Updates 25.11.2016 I've added basic dTLS Support base

Zubair Hamed 150 Nov 18, 2022
FTP client package for Go

goftp A FTP client package for Go Install go get -u github.com/jlaffaye/ftp Documentation https://pkg.go.dev/github.com/jlaffaye/ftp?tab=doc Example

Julien Laffaye 1k Jan 7, 2023
Go PowerDNS 4.x API Client

PowerDNS 4.x API bindings for Golang This community project provides bindings for the currently latest version of PowerDNS Authoritative Server. Featu

Johannes Eiglsperger 67 Dec 12, 2022
A go implementation of the STUN client (RFC 3489 and RFC 5389)

go-stun go-stun is a STUN (RFC 3489, 5389) client implementation in golang (a.k.a. UDP hole punching). RFC 3489: STUN - Simple Traversal of User Datag

Cong Ding 546 Jan 5, 2023
Simple mDNS client/server library in Golang

mdns Simple mDNS client/server library in Golang. mDNS or Multicast DNS can be used to discover services on the local network without the use of an au

HashiCorp 932 Jan 4, 2023
A LWM2M Client and Server implementation (For Go/Golang)

Betwixt - A LWM2M Client and Server in Go Betwixt is a Lightweight M2M implementation written in Go OMA Lightweight M2M is a protocol from the Open Mo

Zubair Hamed 56 Dec 23, 2022
Go Beanstalkd Client Library

#gobeanstalk Go Beanstalkd client library. INSTALL go get github.com/iwanbk/gobeanstalk USAGE Producer import ( "github.com/iwanbk/gobeanstalk" "lo

Iwan Budi Kusnanto 63 Jun 15, 2022
statsd client for Go

go-statsd-client About A StatsD client (UDP) for Go. Docs Viewable online at godoc.org. Example Some examples: import ( "log" "github.com/cac

null 178 Dec 14, 2022
Golang client for NATS, the cloud native messaging system.

NATS - Go Client A Go client for the NATS messaging system. Installation # Go client go get github.com/nats-io/nats.go/ # Server go get github.com/na

NATS - The Cloud Native Messaging System 4.3k Jan 4, 2023
A STOMP Client package for go developers, supporting all STOMP specification levels.

stompngo - A STOMP 1.0, 1.1 and 1.2 Client Package Features Full support of STOMP protocols: Protocol Level 1.0 Protocol Level 1.1 Protocol Level 1.2

Guy M. Allard 139 Oct 19, 2022