POSIX OS Interprocess Communication #15895
Replies: 2 comments 9 replies
-
Have you considered using sockets? It's cross-platform (unlike MCU-specific mailboxes etc) so would work for any port supporting the |
Beta Was this translation helpful? Give feedback.
-
FWIW sockets are quite efficient if the port/board you're using already has networking so has LWIP enabled anyway - this then also has great software support in that you can choose any number of robust communication / RPC libraries to run on top of them etc. Going back to your original suggestion of IPC APIs though, yeah I think exposing them in micropython would be a great idea! Yes it would make sense for the zephyr port to provide a python wrapper over its IPC APIs, same goes for esp32 and if any other "multi-process RTOS" with IPC becomes officially supported that would be good too. Ideally anyone interested in implementing this should attempt to design a Maybe this (C)python package could be used as a guide for designing what a python API for these functions could look like: https://github.com/osvenskan/posix_ipc Then it's "simply" a matter of writing the C code to create that module and some hopefully simple wrapper functions to expose the underlying C functions to python. Lastly, you'll need to define/document a build process for these ports to show users how to compile a separate C process into the micropython firmware on these platforms, I'm not sure how easy that would be? Maybe not to hard using the user-C-modules build pattern. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear experts,
it would be great, if microPython could communicate with other (maybe native) applications on FreeRTOS, Zephyr or RT-Thread. Both offer IPC mechanisms to let threads communicate by mailboxes, semaphores and pipes. (for example https://www.rt-thread.io/document/site/programming-manual/ipc2/ipc2/)
On Zephyr or RT-Thread are so many existing applications, written in C, what could interact with a microphython application by such an IPC mechanism. The big Python do have IPC, the POSIX variant on Linux.
Or is there an other way, how a microPython application can communicate resource efficient with an other app on Zephyr or RT/Thread? Someone could write something into a filesystem, and the other thread read it back, but that sounds very inefficient. Pins can raise an interrupt, but not transmit message data. Using assembly to write into a specific register? This may crash the RTOS.
What do you think?
Michael
Beta Was this translation helpful? Give feedback.
All reactions