GL-MT300N-V2 MQTT integration

Hello people of this great forum!

I am trying to create a software package with MQTT support. At this point I have my basic offline routine compiled and working. Now I want to send data to my MQTT broker. To do this I identified three options based on what I could find online:

  1. Integrate a MQTT C library in my package. From what I could find libmosquitto seems to be the best option.
  2. Use a CLI package like the Mosquitto-client.
  3. Use the GL.iNet MQTT bridge ‘gl-mqtt’.

Option 1 is my preferred approach but upon adding the libmosquitto-nossl package to the sdk like this:

./scripts/feeds update -f
./scripts/feeds install libmosquitto-nossl

I get the following error:

ERROR: please fix feeds/telephony/net/freeswitch/Makefile - see logs/feeds/telephony/net/freeswitch/dump.txt for details

If I ignore this error and continue this process I end up with this:


CMake Error at /src/sdk/1806/ramips/staging_dir/host/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):

  Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)

Call Stack (most recent call first):

  /src/sdk/1806/ramips/staging_dir/host/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)

  /src/sdk/1806/ramips/staging_dir/host/share/cmake-3.11/Modules/FindZLIB.cmake:112 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)

  CMakeLists.txt:1002 (find_package)

-- Configuring incomplete, errors occurred!

See also "/src/sdk/1806/ramips/build_dir/target-mipsel_24kc_musl/libwebsockets-openssl/libwebsockets-2.4.1/CMakeFiles/CMakeOutput.log".

See also "/src/sdk/1806/ramips/build_dir/target-mipsel_24kc_musl/libwebsockets-openssl/libwebsockets-2.4.1/CMakeFiles/CMakeError.log".

make[2]: *** [/src/sdk/1806/ramips/build_dir/target-mipsel_24kc_musl/libwebsockets-openssl/libwebsockets-2.4.1/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 1

Makefile:103: recipe for target '/src/sdk/1806/ramips/build_dir/target-mipsel_24kc_musl/libwebsockets-openssl/libwebsockets-2.4.1/.configured_68b329da9893e34099c7d8ad5cb9c940' failed

Am I overcomplicating things here and should I simply invoke CLI commands from my code or is the solution right under my nose?

Can you just install the package from the software repo?

Hi @alzhao, thanks for your reply.

Yes, I can but then it won’t be available at compilation to include in my code with #include <mosquitto.h>. I’ll probably install the mosquitto client and call that from my code.

As a followup on my previous post: The mosquitto client works fine but it can’t be run as a deamon in the background. This is a problem because my application requires it to stay connected with the broker without having to handshake every time it needs publish a message.

Thus I decided to return to my ‘libmosquitto-ssl’ integration. I did a deeper dive into the Gl.iNet SDK for the ramips-1806 and found that it is not just zlib that is missing but a whole lot of packages that it reports on. It just so happens that zlib is the only critical one for my application.

Can someone here help me integrate these dependencies in my development environment?

WARNING: Makefile 'package/linux/Makefile' has a dependency on 'r8169-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'e100-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'bnx2-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'ar3k-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'mwifiex-sdio-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb2', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'edgeport-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb3', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'prism54-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'rtl8192su-firmware', which does not exist
Ignoring feed 'base' - index missing
WARNING: No feed for package 'uci' found
WARNING: No feed for package 'curl' found
WARNING: No feed for package 'libubus' found
WARNING: No feed for package 'libubox' found
WARNING: No feed for package 'libiwinfo' found
Installing package 'sqlite3' from packages
WARNING: No feed for package 'zlib' found
WARNING: No feed for package 'libncurses' found
WARNING: No feed for package 'libreadline' found
Installing package 'mqtt' from gli_pub
Installing package 'openssl' from gli_pub
WARNING: No feed for package 'zlib' found
Installing package 'cryptodev-linux' from packages
Installing package 'fcgi' from packages
WARNING: No feed for source package 'libtool' found
WARNING: No feed for source package 'gettext' found
WARNING: No feed for source package 'libiconv' found
WARNING: No feed for package 'uclibcxx' found
Collecting package info: done
WARNING: Makefile 'package/feeds/packages/fcgi/Makefile' has a dependency on 'uclibcxx', which does not exist
WARNING: Makefile 'package/feeds/packages/fcgi/Makefile' has a build dependency on 'libtool', which does not exist
WARNING: Makefile 'package/feeds/packages/fcgi/Makefile' has a build dependency on 'gettext', which does not exist
WARNING: Makefile 'package/feeds/packages/fcgi/Makefile' has a build dependency on 'libiconv', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'r8169-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'e100-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'bnx2-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'ar3k-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'mwifiex-sdio-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb2', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'edgeport-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb3', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'prism54-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'rtl8192su-firmware', which does not exist
WARNING: Makefile 'package/feeds/gli_pub/openssl/Makefile' has a dependency on 'zlib', which does not exist
WARNING: Makefile 'package/feeds/packages/sqlite3/Makefile' has a dependency on 'zlib', which does not exist
WARNING: Makefile 'package/feeds/packages/sqlite3/Makefile' has a dependency on 'libncurses', which does not exist
WARNING: Makefile 'package/feeds/packages/sqlite3/Makefile' has a dependency on 'libreadline', which does not exist