Skip to content

Tieske/luamqtt

 
 

Repository files navigation

This is a fork of LuaMQTT

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/luamqtt
  • keepalive 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 release luamqttt (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 (use t instead of v)

luamqtt

Pure-lua MQTT v3.1.1 and v5.0 client

luamqtt logo

License tests Coverage Status Mentioned in Awesome MQTT forthebadge

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.

Features

  • 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.

Documentation

See https://xhaskx.github.io/luamqtt/

Forum

See flespi forum thread

Source Code

https://github.com/xHasKx/luamqtt

Bugs & contributing

Please file a GitHub issue if you found any bug.

And of course, any contribution are welcome!

Tests

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

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

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

MQTT version

Currently supported is:

Both protocols has full control packets support.

LICENSE

Standard MIT License, see LICENSE file for full text

Version bump checklist

  • in file ./mqtt/const.lua: change _VERSION table field
  • in file ./openwrt/make-package-without-openwrt-sources.sh: change Version: X.Y.Z-P in $PKG_ROOT/control
  • in file ./openwrt/Makefile: change PKG_VERSION:=X.Y.Z and maybe PKG_RELEASE:=1
  • copy file ./luamqtt-scm-1.rockspec to ./rockspecs/luamqtt-X.Y.Z-1.rockspec change local 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

About

luamqtt - Pure-lua MQTT v3.1.1 and v5.0 client

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Lua 98.3%
  • Shell 1.3%
  • Makefile 0.4%