shirou / mqttcli Goto Github PK
View Code? Open in Web Editor NEWMQTT client
License: Eclipse Public License 1.0
MQTT client
License: Eclipse Public License 1.0
string and int should be accepted at config/port.
Is this actually working for anyone? I get nothing but errors (and incomplete ones at that). I can't get this working on Windows 10 or Ubuntu 18.04.
# cat settings.json
{
"host": "edited.iot.us-west-2.amazonaws.com",
"port": 8883,
"clientId": "fc06fa7a7d04438a9b98e9244cfad3a0",
"caCert": "aws-root-ca.pem",
"clientCert": "certificate.pem.crt",
"privateKey": "private.pem.key"
}
# ./mqttcli sub --conf settings.json -t "dev/monitoring/30AEA40DB9E0"
ERRO[0000] Network Error : dial tcp 127.0.0.1:1883: connect: connection refused
# export MQTT_HOST="edited.iot.us-west-2.amazonaws.com"
# export MQTT_PORT="8883"
# ./mqttcli sub --conf settings.json -t "dev/monitoring/30AEA40DB9E0"
ERRO[0000] Network Error : %!s(<nil>)
Trying to use mqttcli with AWS IoT but getting an x509 error. I'm using a config file.
➜ crt mqttcli pub -t "mqttclient/mqttClient" -m "My Message" -d
Config file:
{
"host": "*****di4yltozu.iot.us-west-2.amazonaws.com",
"port": 8883,
"clientId": "mqttclient",
"thingName": "mqttClient",
"caCert": "/Users/RalfR/crt/VeriSign-Class 3-Public-Primary-Certification-Authority-G5.crt",
"clientCert": "/Users/RalfR/crt/5e9a177637-certificate.pem.crt",
"privateKey": "/Users/RalfR/crt/5e9a177637-private.pem.key"
}
However, I do get an x509 error:
➜ crt mqttcli pub -t "mqttclient/mqttClient" -m "My Message" -d
INFO[0000] Broker URI: ssl://*****di4yltozu.iot.us-west-2.amazonaws.com:8883
INFO[0000] connecting...
ERRO[0000] Network Error : x509: certificate signed by unknown authority
➜ crt
Any idea?
pi@octopi:~ $ go get github.com/shirou/mqttcli
# golang.org/x/sys/unix
gocode/src/golang.org/x/sys/unix/asm_linux_arm.s:8 5a: No such file or directory: textflag.h
This is on the latest Octorprint (built on Raspbian, built on Debian) on a Raspberry Pi.
I don't know Go, but maybe this is something to do with ARM?
https://drone.io/github.com/shirou/mqttcli/files leads to a 404
versioning
clientid is required when cleanSession
I would like to publish a message with \r carriage return character inside. Below is what I did.
mqtt-cli mqtt.test.com topic "mqtt_msg 1\r"
However, the carriage return character is not sent. Instead, the ASCII "\r" characters are sent. How can I put the \r carriage return inside the mqtt message?
Commit ab28b9f introduced a bug with config file handling: When no host is specified the default is set to localhost
and the configuration file is ignored:
$ mqttcli sub -d -t 'tele/outdoor/SENSOR'
INFO[0000] Broker URI: tcp://localhost:1883
INFO[0000] Topic: tele/outdoor/SENSOR
INFO[0000] connecting...
$ mqttcli sub --conf .mqttcli.conf -d -t 'tele/outdoor/SENSOR'
INFO[0000] Broker URI: tcp://localhost:1883
INFO[0000] Topic: tele/outdoor/SENSOR
INFO[0000] connecting...
$ mqttcli sub --host="" --conf .mqttcli.cfg -d -t 'tele/outdoor/SENSOR'
INFO[0000] Broker URI: tcp://<my configured server>:1883
INFO[0000] Topic: tele/outdoor/SENSOR
INFO[0000] connecting...
Only setting the host explicitly to ""
ensures the configuration file is applied.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.