Has anybody successfully ported ZeroMQ, nanomessage or nanomessage-ng to MicroPython?
The idea is to use it for efficient RPC communication via network, with a node running MicroPython (e.g., controlling certain sensors or actuators).
I have prepared a version based on MessagePack+ZeroMQ, that may be used with standard Python running on embedded Linux systems - https://gitlab.com/WZab/python-versatil ... ck-zmq/src . Currently it allows access from C++, Lua, Octave (probably also Matlab?) and of course Python.
When porting it to MicroPython, I have finally managed to get the reasonable subset of MessagePack working - viewtopic.php?f=15&t=10827 , but up to now I was not able to get the ZeroMQ, nanomessage or pynng running on the MicroPython. Unfortunately, the MessagePack that I could use does not support incremental feeding of the unpacker (which I used in the very first implementation - https://ftp.funet.fi/pub/archive/alt.sources/2722.gz ).
Thence, only the JSON-based version, using EOL as a separator is available (which results in seriously increased network occupancy). It is available at https://gitlab.com/WZab/python-versatil ... on-eol/src .
As soon as the a good portable and MicroPython-compatible library for encapsulation of messages is available, we may implement the RPC for communication with µP-based nodes.
ZeroMQ, nanomsg or nng ported to MicroPython (or any good message encapsulation library)?
Re: ZeroMQ, nanomsg or nng ported to MicroPython (or any good message encapsulation library)?
At the moment I have given up the idea of porting 0MQ, nanonmsg or nng. Instead I have used a simplistic encapsulation of the MessagePack-encapsulated messages: each message is prepended by its 4-byte big-endian length.
The implementation has been tested on NUCLEO F767-ZI. It is available in https://gitlab.com/WZab/python-versatil ... sgpack-tcp
The implementation has been tested on NUCLEO F767-ZI. It is available in https://gitlab.com/WZab/python-versatil ... sgpack-tcp
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: ZeroMQ, nanomsg or nng ported to MicroPython (or any good message encapsulation library)?
I have a subset of ZeroMQ ported (and msgpack from https://github.com/msgpack/msgpack-pyth ... er/msgpack but that is not exactly microcontroller material), would work for any port which has a working C++-14 compiler and which can build libzmq. It's not particularily hard, but ZeroMQ isn't exactly minimal either. Why did you give up on it specifically?