Is there a msgpack library?


Any change if I can get a msgpack library?

Thank you.

Encode, decode, both?

How much space do you have? There are, for example Python libraries to handle MessagePack.

ArduinoJson, despite the name, is not tied to the Arduino framework and runs on macOS and Linux-based systems. I have found to be a good C++ library and is being expanded to include MessagePack support in v6. At this time it does not yet support the binary formats, but I understand that it is planned for the release of v6.

Thanks Jeff, C++ library for both encode and decod is what I am looking for. Sorry, I am new to OpenWrt, it does not look like I can run feeds install, how can I include ArduinoJson source build into OpenWrt?

$ ./scripts/feeds install ArduinoJson
WARNING: No feed for package 'ArduinoJson' found
j$ ./scripts/feeds install arduinojson
WARNING: No feed for package 'arduinojson' found

One of the convenient things about the ArduinoJson library is that it is a "header-only" library. As such, including it with your sources in your "custom" code's package should be sufficient (along with #include "ArduinoJson.h") is one reference on how to create your own package and build it within the OpenWrt build system. Packaging guidelines is also very helpful

Thanks Jeff, I followed the instruction to run the package build, it downloaded source tar ball, ran the cmake and build the source, but it got an error at the final install where the Package/libarduinojson/install was clearly defined (tab was fine), any ideas why?

make[4]: *** No rule to make target 'install'. Stop.

Where the Makefile defined install:

define Package/libarduinojson/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME){,convert}.{a, so.*} $(1)/usr/lib/

Hmmm, first thing is that ArduinoJson typically doesn't build a linkable library, but the needed code gets "directly" linked into your executable. Using it would generally involve defining the "main" for your executable and #include "ArduinoJson.h" (or .hpp, if you prefer its symbols to be in their own namespace) where needed by the code in the compilation unit(s). I think you want your OpenWrt package to be around your executable, not the ArduinoJson library itself.

I don't know that the OpenWrt build systems supports fetching of multiple sources. I have generally just used local sources and managed the source, Makefile, and the rest with a single git repo.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.