Could Node-RED generate code for MCUs?

I really enjoy Node-RED, even for for managing industrial systems.

Up to now, Node-RED runs on and targets computers and SBC. However, micro-controllers and MCUs are now very powerful, with large RAM and Flash memories. And industry requires real-time constraints.

One question: Could we imagine targeting micro-controllers? The idea would be to build a program with Node-RED on a computer or SBC and then generate code to run on a micro-controller after being cross-compiled. Obviously, only a sub-set of the nodes would be available.

The current Node-RED runtime doesn't do any sort of code generation. It acts as an interpreter for the flow JSON.

But it would certainly be possible to create an alternative runtime that did do code generation for any suitable platform. It would require a fully custom set of nodes that knew how to generate code.

This sort of thing has been on my "one-day" list of side projects for a long time.

3 Likes

Thank you for your answer. I guess you have multiple projects on your "one-day" list!

Microsoft MakeCode already supports JavaScript for selected micro-controller boards.

Once upon a time there was this half and half project - Not really code generation but trying to use MCU (espruino in this case) as part of a flow - https://groups.google.com/forum/#!topic/node-red/pJXwdl2UMQ8

There is also this code generator for Teensy audio library.

The Audio System Design Tool lets you easily draw a system to process 16 bit, 44.1 kHz streaming audio while your Arduino sketch also runs.

Export will generate code to copy into the Arduino editor, to implement your system.

1 Like

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