It has some serious issues when using it async, which is why this fork exists.
Branches in use:
master
is the remote development branch; xHasKx/luamqttkeepalive
is where the developement happens in this repo. It has a PR open on the remote repo. After (if ever) it gets merged, this repo will be obsolete and be removed.main
is the default branch on this repo, from where we tag and releaseluamqttt
(note the extra 't'), see luarocks.
Installing this fork is best done from LuaRocks;
luarocks install luamqttt
Improvements in this fork:
- decoupled runloop from the client
- logging using lualogging
- safe async behaviour
- better and safer socket support
Releasing:
- update verion in "
const.lua
" - render docs
- create new rockspec
- commit and tag using
tX.Y.Z
(uset
instead ofv
)
Pure-lua MQTT v3.1.1 and v5.0 client
MQTT ( http://mqtt.org/ ) client library for Lua. MQTT is a popular network communication protocol working by "publish/subscribe" model.
This library is written in pure-lua to provide maximum portability.
- Full MQTT v3.1.1 client-side support
- Full MQTT v5.0 client-side support
- Support for Copas, OpenResty/Nginx, and an included lightweight ioloop.
From LuaRocks:
luarocks install luamqtt
See https://xhaskx.github.io/luamqtt/
https://github.com/xHasKx/luamqtt
Please file a GitHub issue if you found any bug.
And of course, any contribution are welcome!
To run tests in this git repo you need busted as well as some dependencies:
Prepare:
luarocks install busted
luarocks install luacov
luarocks install luasocket
luarocks install luasec
luarocks install copas
luarocks install lualogging
luarocks install ansicolors
Running the tests:
busted
There is a script to run all tests for all supported lua versions, using hererocks:
./tests/run-for-all-lua-versions.sh
Code coverage may be collected using luacov.
To collect code coverage stats - install luacov using luarocks and then execute:
# collect stats during tests
busted --coverage
# generate report into luacov.report.out file
luacov
Currently supported is:
- MQTT v3.1.1 protocol version.
- MQTT v5.0 protocol version.
Both protocols has full control packets support.
Standard MIT License, see LICENSE file for full text
- in file
./mqtt/const.lua
: change_VERSION
table field - in file
./openwrt/make-package-without-openwrt-sources.sh
: changeVersion: X.Y.Z-P
in $PKG_ROOT/control - in file
./openwrt/Makefile
: changePKG_VERSION:=X.Y.Z
and maybePKG_RELEASE:=1
- copy file
./luamqtt-scm-1.rockspec
to./rockspecs/luamqtt-X.Y.Z-1.rockspec
changelocal package_version = "scm"
,local package_version = "X.Y.Z"
- run
./tests/run-luacheck.sh
and check output for errors - run
./tests/run-markdownlint.sh
and check output for errors - run
./tests/run-for-all-lua-versions.sh
and check output for errors - run
./openwrt/make-package-without-openwrt-sources.sh
and check output for errors - run
git commit
,git tag vX.Y.Z
- run
git push
,git push --tags
- upload to LuaRocks;
luarocks upload ./rockspecs/luamqtt-X.Y.Z-1.rockspec --api-key=ABCDEFGH