You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Marco Casaroli <ma...@midokura.com.INVALID> on 2023/02/03 08:31:22 UTC

ZeroMQ

Hello,

I've been experimenting to build ZeroMQ work with NuttX and I wanted to
share my results so far.

TLDR: it works

Please, understand that I am very new to NuttX so please tell me with any
conceptual errors I might be facing!

https://github.com/casaroli/incubator-nuttx/tree/zeromq

I think we need to be able to use this library both from kernel code and
from applications, so I guessed this would fit along libxx and libdsp, etc.

So I basically copied many stuff from those directories into libs/libzmq

Still needs a lot of work, so next steps are to find a way to run the
tests, then to make platform.hpp defines use nuttx/config.h, add czmq
(higher level interface).

However, in the current state, I could get IPC through Unix Domain Sockets
and TCP. inproc also works fine.

I wrote some simple examples (not on the repo) and they work.

I want to know if anyone else is interested in helping with this (make
ZeroMQ/czmq, nng, etc. work).

Thank you.

Re: ZeroMQ

Posted by Janne Rosberg <ja...@offcode.fi.INVALID>.
I did the libzmq and libnng porting (WIP) year ago to nuttx apps.... Never finished it to Nuttx PR

It's available here for reference if someone is interested.
offcode-oy/nuttx-apps at wip/libzmq_and_nng (github.com)<https://github.com/offcode-oy/nuttx-apps/tree/wip/libzmq_and_nng>


--Janne



________________________________
From: Marco Casaroli <ma...@midokura.com.INVALID>
Sent: Monday, 6 February 2023 10.55
To: dev@nuttx.apache.org <de...@nuttx.apache.org>
Subject: Re: ZeroMQ

I am doing this.

Will share in a couple of weeks.

On Mon, 6 Feb 2023 at 09:41, Sebastien Lorquet <se...@lorquet.fr> wrote:

> Hi,
>
> this is very interesting, thanks for sharing this.
>
> Did anyone already integrate nng in NuttX ?
>
> Sebastien
>
> Le 04/02/2023 à 03:02, David S. Alessio a écrit :
> > All,
> >
> > ZeroMQ is/was quite popular, but its author redesigned it, created a
> much cleaner implementation called “nanomsg”,
> >       ref: https://nanomsg.org/documentation-zeromq.html <
> https://nanomsg.org/documentation-zeromq.html>
> >       ref: https://nanomsg.org/index.html <
> https://nanomsg.org/index.html>
> >
> > And then he rewrote it again:
> >       ref: https://nng.nanomsg.org/RATIONALE.html <
> https://nng.nanomsg.org/RATIONALE.html>
> > and called it nng:
> >       ref: https://nng.nanomsg.org <https://nng.nanomsg.org/>
> >
> > So, in short, if one is interested in ZeroMQ and NuttX, I’d suggest
> nanomsg would be a much more efficient replacement; and finally the best
> choice of the three IMHO would be nng for an embedded system (Cortex-M3/4
> class) system.
> >
> > Just my $0.025, I hope it’s helpful.
> >
> > Cheers,
> > -david
> >
> >
> >
> >> On Feb 3, 2023, at 2:24 AM, Xiang Xiao <xi...@gmail.com>
> wrote:
> >>
> >> On Fri, Feb 3, 2023 at 4:31 PM Marco Casaroli
> >> <marco.casaroli@midokura.com.invalid <mailto:
> marco.casaroli@midokura.com.invalid>> wrote:
> >>
> >>> Hello,
> >>>
> >>> I've been experimenting to build ZeroMQ work with NuttX and I wanted to
> >>> share my results so far.
> >>>
> >>> TLDR: it works
> >>>
> >>> Please, understand that I am very new to NuttX so please tell me with
> any
> >>> conceptual errors I might be facing!
> >>>
> >>> https://github.com/casaroli/incubator-nuttx/tree/zeromq
> >>>
> >>> I think we need to be able to use this library both from kernel code
> and
> >>> from applications, so I guessed this would fit along libxx and libdsp,
> etc.
> >>>
> >>>
> >> Kernel code needs to call some special API(e.g. kmm_malloc, psock_send
> and
> >> file_open), I amn't sure whether is it easy to adjust ZeroMQ for this
> type
> >> of change.
> >>
> >>
> >>> So I basically copied many stuff from those directories into
> libs/libzmq
> >>>
> >>> Still needs a lot of work, so next steps are to find a way to run the
> >>> tests, then to make platform.hpp defines use nuttx/config.h, add czmq
> >>> (higher level interface).
> >>>
> >>> However, in the current state, I could get IPC through Unix Domain
> Sockets
> >>> and TCP. inproc also works fine.
> >>>
> >>> I wrote some simple examples (not on the repo) and they work.
> >>>
> >>> I want to know if anyone else is interested in helping with this (make
> >>> ZeroMQ/czmq, nng, etc. work).
> >>>
> >>>
> >> Yes, it's definitely good to support more 3rd party general libraries.
> >>
> >>
> >>> Thank you.
> >
>

Re: ZeroMQ

Posted by Marco Casaroli <ma...@midokura.com.INVALID>.
I am doing this.

Will share in a couple of weeks.

On Mon, 6 Feb 2023 at 09:41, Sebastien Lorquet <se...@lorquet.fr> wrote:

> Hi,
>
> this is very interesting, thanks for sharing this.
>
> Did anyone already integrate nng in NuttX ?
>
> Sebastien
>
> Le 04/02/2023 à 03:02, David S. Alessio a écrit :
> > All,
> >
> > ZeroMQ is/was quite popular, but its author redesigned it, created a
> much cleaner implementation called “nanomsg”,
> >       ref: https://nanomsg.org/documentation-zeromq.html <
> https://nanomsg.org/documentation-zeromq.html>
> >       ref: https://nanomsg.org/index.html <
> https://nanomsg.org/index.html>
> >
> > And then he rewrote it again:
> >       ref: https://nng.nanomsg.org/RATIONALE.html <
> https://nng.nanomsg.org/RATIONALE.html>
> > and called it nng:
> >       ref: https://nng.nanomsg.org <https://nng.nanomsg.org/>
> >
> > So, in short, if one is interested in ZeroMQ and NuttX, I’d suggest
> nanomsg would be a much more efficient replacement; and finally the best
> choice of the three IMHO would be nng for an embedded system (Cortex-M3/4
> class) system.
> >
> > Just my $0.025, I hope it’s helpful.
> >
> > Cheers,
> > -david
> >
> >
> >
> >> On Feb 3, 2023, at 2:24 AM, Xiang Xiao <xi...@gmail.com>
> wrote:
> >>
> >> On Fri, Feb 3, 2023 at 4:31 PM Marco Casaroli
> >> <marco.casaroli@midokura.com.invalid <mailto:
> marco.casaroli@midokura.com.invalid>> wrote:
> >>
> >>> Hello,
> >>>
> >>> I've been experimenting to build ZeroMQ work with NuttX and I wanted to
> >>> share my results so far.
> >>>
> >>> TLDR: it works
> >>>
> >>> Please, understand that I am very new to NuttX so please tell me with
> any
> >>> conceptual errors I might be facing!
> >>>
> >>> https://github.com/casaroli/incubator-nuttx/tree/zeromq
> >>>
> >>> I think we need to be able to use this library both from kernel code
> and
> >>> from applications, so I guessed this would fit along libxx and libdsp,
> etc.
> >>>
> >>>
> >> Kernel code needs to call some special API(e.g. kmm_malloc, psock_send
> and
> >> file_open), I amn't sure whether is it easy to adjust ZeroMQ for this
> type
> >> of change.
> >>
> >>
> >>> So I basically copied many stuff from those directories into
> libs/libzmq
> >>>
> >>> Still needs a lot of work, so next steps are to find a way to run the
> >>> tests, then to make platform.hpp defines use nuttx/config.h, add czmq
> >>> (higher level interface).
> >>>
> >>> However, in the current state, I could get IPC through Unix Domain
> Sockets
> >>> and TCP. inproc also works fine.
> >>>
> >>> I wrote some simple examples (not on the repo) and they work.
> >>>
> >>> I want to know if anyone else is interested in helping with this (make
> >>> ZeroMQ/czmq, nng, etc. work).
> >>>
> >>>
> >> Yes, it's definitely good to support more 3rd party general libraries.
> >>
> >>
> >>> Thank you.
> >
>

Re: ZeroMQ

Posted by Sebastien Lorquet <se...@lorquet.fr>.
Hi,

this is very interesting, thanks for sharing this.

Did anyone already integrate nng in NuttX ?

Sebastien

Le 04/02/2023 à 03:02, David S. Alessio a écrit :
> All,
>
> ZeroMQ is/was quite popular, but its author redesigned it, created a much cleaner implementation called “nanomsg”,
> 	ref: https://nanomsg.org/documentation-zeromq.html <https://nanomsg.org/documentation-zeromq.html>
> 	ref: https://nanomsg.org/index.html <https://nanomsg.org/index.html>
>
> And then he rewrote it again:
> 	ref: https://nng.nanomsg.org/RATIONALE.html <https://nng.nanomsg.org/RATIONALE.html>
> and called it nng:
> 	ref: https://nng.nanomsg.org <https://nng.nanomsg.org/>
>
> So, in short, if one is interested in ZeroMQ and NuttX, I’d suggest nanomsg would be a much more efficient replacement; and finally the best choice of the three IMHO would be nng for an embedded system (Cortex-M3/4 class) system.
>
> Just my $0.025, I hope it’s helpful.
>
> Cheers,
> -david
>
>
>
>> On Feb 3, 2023, at 2:24 AM, Xiang Xiao <xi...@gmail.com> wrote:
>>
>> On Fri, Feb 3, 2023 at 4:31 PM Marco Casaroli
>> <marco.casaroli@midokura.com.invalid <ma...@midokura.com.invalid>> wrote:
>>
>>> Hello,
>>>
>>> I've been experimenting to build ZeroMQ work with NuttX and I wanted to
>>> share my results so far.
>>>
>>> TLDR: it works
>>>
>>> Please, understand that I am very new to NuttX so please tell me with any
>>> conceptual errors I might be facing!
>>>
>>> https://github.com/casaroli/incubator-nuttx/tree/zeromq
>>>
>>> I think we need to be able to use this library both from kernel code and
>>> from applications, so I guessed this would fit along libxx and libdsp, etc.
>>>
>>>
>> Kernel code needs to call some special API(e.g. kmm_malloc, psock_send and
>> file_open), I amn't sure whether is it easy to adjust ZeroMQ for this type
>> of change.
>>
>>
>>> So I basically copied many stuff from those directories into libs/libzmq
>>>
>>> Still needs a lot of work, so next steps are to find a way to run the
>>> tests, then to make platform.hpp defines use nuttx/config.h, add czmq
>>> (higher level interface).
>>>
>>> However, in the current state, I could get IPC through Unix Domain Sockets
>>> and TCP. inproc also works fine.
>>>
>>> I wrote some simple examples (not on the repo) and they work.
>>>
>>> I want to know if anyone else is interested in helping with this (make
>>> ZeroMQ/czmq, nng, etc. work).
>>>
>>>
>> Yes, it's definitely good to support more 3rd party general libraries.
>>
>>
>>> Thank you.
>

Re: ZeroMQ

Posted by "David S. Alessio" <da...@gmail.com>.
All,

ZeroMQ is/was quite popular, but its author redesigned it, created a much cleaner implementation called “nanomsg”,
	ref: https://nanomsg.org/documentation-zeromq.html <https://nanomsg.org/documentation-zeromq.html>
	ref: https://nanomsg.org/index.html <https://nanomsg.org/index.html>

And then he rewrote it again:
	ref: https://nng.nanomsg.org/RATIONALE.html <https://nng.nanomsg.org/RATIONALE.html>
and called it nng:
	ref: https://nng.nanomsg.org <https://nng.nanomsg.org/>

So, in short, if one is interested in ZeroMQ and NuttX, I’d suggest nanomsg would be a much more efficient replacement; and finally the best choice of the three IMHO would be nng for an embedded system (Cortex-M3/4 class) system.

Just my $0.025, I hope it’s helpful.

Cheers,
-david



> On Feb 3, 2023, at 2:24 AM, Xiang Xiao <xi...@gmail.com> wrote:
> 
> On Fri, Feb 3, 2023 at 4:31 PM Marco Casaroli
> <marco.casaroli@midokura.com.invalid <ma...@midokura.com.invalid>> wrote:
> 
>> Hello,
>> 
>> I've been experimenting to build ZeroMQ work with NuttX and I wanted to
>> share my results so far.
>> 
>> TLDR: it works
>> 
>> Please, understand that I am very new to NuttX so please tell me with any
>> conceptual errors I might be facing!
>> 
>> https://github.com/casaroli/incubator-nuttx/tree/zeromq
>> 
>> I think we need to be able to use this library both from kernel code and
>> from applications, so I guessed this would fit along libxx and libdsp, etc.
>> 
>> 
> Kernel code needs to call some special API(e.g. kmm_malloc, psock_send and
> file_open), I amn't sure whether is it easy to adjust ZeroMQ for this type
> of change.
> 
> 
>> So I basically copied many stuff from those directories into libs/libzmq
>> 
>> Still needs a lot of work, so next steps are to find a way to run the
>> tests, then to make platform.hpp defines use nuttx/config.h, add czmq
>> (higher level interface).
>> 
>> However, in the current state, I could get IPC through Unix Domain Sockets
>> and TCP. inproc also works fine.
>> 
>> I wrote some simple examples (not on the repo) and they work.
>> 
>> I want to know if anyone else is interested in helping with this (make
>> ZeroMQ/czmq, nng, etc. work).
>> 
>> 
> Yes, it's definitely good to support more 3rd party general libraries.
> 
> 
>> Thank you.


Re: ZeroMQ

Posted by Xiang Xiao <xi...@gmail.com>.
On Fri, Feb 3, 2023 at 4:31 PM Marco Casaroli
<ma...@midokura.com.invalid> wrote:

> Hello,
>
> I've been experimenting to build ZeroMQ work with NuttX and I wanted to
> share my results so far.
>
> TLDR: it works
>
> Please, understand that I am very new to NuttX so please tell me with any
> conceptual errors I might be facing!
>
> https://github.com/casaroli/incubator-nuttx/tree/zeromq
>
> I think we need to be able to use this library both from kernel code and
> from applications, so I guessed this would fit along libxx and libdsp, etc.
>
>
Kernel code needs to call some special API(e.g. kmm_malloc, psock_send and
file_open), I amn't sure whether is it easy to adjust ZeroMQ for this type
of change.


> So I basically copied many stuff from those directories into libs/libzmq
>
> Still needs a lot of work, so next steps are to find a way to run the
> tests, then to make platform.hpp defines use nuttx/config.h, add czmq
> (higher level interface).
>
> However, in the current state, I could get IPC through Unix Domain Sockets
> and TCP. inproc also works fine.
>
> I wrote some simple examples (not on the repo) and they work.
>
> I want to know if anyone else is interested in helping with this (make
> ZeroMQ/czmq, nng, etc. work).
>
>
Yes, it's definitely good to support more 3rd party general libraries.


> Thank you.
>