# Node-red-mcu-plugin v1.0: Integrating Node-RED MCU Edition into the Node-RED editor

**URL:** https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693
**Category:** Share Your Projects
**Created:** [25 December 2022 19:56 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693 "2022-12-25T19:56:53Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [25 December 2022 19:56 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/1 "2022-12-25T19:56:53Z")

</div>

About six months ago, @phoddie launched the discussion of an inspiring idea: What if ... one could use **Node-RED to program microcontrollers** (MCU)? His first thoughts kicked off a development of two components that made this idea become reality: [`node-red-mcu`](https://github.com/phoddie/node-red-mcu), a custom runtime, based on the XS Javascript framework created by Moddable Inc. & the [`node-red-mcu-plugin`](https://github.com/ralphwetzel/node-red-mcu-plugin) that integrates `node-red-mcu` into the Node-RED editor.  
After a lot of polishing over the last weeks, supported by a number of very patient members of the Node-RED community, I'm really really excited to announce that we've today released [v1.0 of this plugin](https://github.com/ralphwetzel/node-red-mcu-plugin).

The purpose of the plugin is twofold:

1. It makes it super easy to build a flow & to push it onto a connected MCU.
2. It ensures that you, operating the Node-RED editor, get the same user experience that you're accustomed to - despite your flow now runs on an external (but connected) device.

So let’s assume, you've created a flow that you intend to run on a MCU:

- Select the targeted flow(s) in the plugin's selector panel & deploy once - to confirm your selection.
- Choose from the dropdown list of supported devices the platform specifier you intend to build for.
- Define - only if necessary - some parameters to configure the build process, like dashboard support or your WiFi credentials.
- Then press the `Build` button. 🚀

Now it's happening a lot:

- At first, the plugin composes the data necessary to build the flow for the MCU: It collects flow & node configurations, pulls in - if necessary - code from contributed nodes, walks the dependency tree and resolves links & junctions, to finally put everything into a dedicated build environment.
- Then it triggers the build & push process, trying to take into consideration all the tiny little things that are platform dependent - to ensure building successfully on macOS, Windows & Linux!
- Once the code has been uploaded, after the MCU resets & launches, the plugin drives the interface of the editor, displaying the information data created by the the flow and transmitting operator inputs to the MCU. Debug messages, status information, inject button support; all those standard features are supported.

If you're curious to test it, just plug in the MCU Santa brought you (or the other one, that is laying around next to you) & create the flow that most (if not all) of you are familiar with:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/7/f78d8e094d4147ee0455003745ad459a33cf8da0.png)

Despite it looks quite nullish, you'll easily experience a lot of the functionality mentioned above in action! 🎉

So where's the limit of what you can achieve with `node-red-mcu` & the `node-red-mcu-plugin`? We haven't seen it so far:

- The Moddable team created the [Moddable Holiday Wreath](https://github.com/phoddie/node-red-mcu/discussions/61), operating an ESP32-S3 microcontroller, streaming audio, Neopixels, MQTT, and, of course, Node-RED MCU Edition.
- This is a screencopy of my CCS™ (Cellar Control System) flow, featuring a window actuator & a fan as well as a number of sensors (humidity, temperature) to ensure proper ventilation of the room - driven by a tiny `ESP32` that commands a `DS2482 I2C 1-Wire bridge`.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/1/019f22f08095b5a45b1a918f13c203e4c2048258.png)

Enjoy testing & operating with **Node-RED MCU Edition**.  
We're looking forward to get your comments, to listen to your feedback and to discuss additional feature requests! 😉

Have a great Christmas time! 🎅

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [25 December 2022 21:39 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/2 "2022-12-25T21:39:21Z")

</div>

Hi Ralph,  
Merry christmas for you too, and thanks for all the hard work you have done for this community!!

Noob question: what is the easiest way to get started with this on a Raspberry Pi? I haven't installed anything yet for Moddable...

Andy has been so kind to implement two new sensor types for me, so need to test it somehow. Some beginner level info is very welcome!

Thanks!!!  
Bart

---

<div class="post-metadata">

### Author: ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)
#### Post date: [25 December 2022 22:18 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/3 "2022-12-25T22:18:25Z")

</div>

This is amazing, but (as with a lot of things lately) it leaves me with several layers of confusion. Do I understand correctly: the plugin modifies the editor so it can talk directly to `node-red-mcu` which then requires the `Moddable SDK` to be installed and talking to a supported MCU? I assume it's easier to do than describe, but are those the right steps?

Also, thanks for referencing the "slick comment" I contributed to the NR documentation.

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [25 December 2022 23:48 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/4 "2022-12-25T23:48:40Z")

</div>

Let me try to explain it this way:

`Node-RED` operates on `Node.js` which is based on the `V8` Javascript engine.  
`Node-RED MCU Edition` (or `node-red-mcu`) operates on the `Moddable SDK` which implements `XS` as Javascript engine.

The `node-red-mcu-plugin` eliminates the effort to bring `node-red-mcu` & the flows (at that stage deeply merged) on the MCU & modifies the editor to exchange with the connected MCU when the flows are running.

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [26 December 2022 00:12 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/5 "2022-12-26T00:12:10Z")

</div>

Hi Burt!

> [@BartButenaers](#):
>
> Noob question: what is the easiest way to get started with this on a Raspberry Pi? I haven't installed anything yet for Moddable...

You'll have to invest a bit of time first to prepare your environment.  
There's yet a very good "[Getting Started](https://github.com/Moddable-OpenSource/moddable#getting-started)" guide provided by the Moddable team.  
In [short](https://github.com/Moddable-OpenSource/moddable#esp32-by-espressif):

- Install the [Moddable SDK](https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/Moddable%20SDK%20-%20Getting%20Started.md)
- Install the [ESP32 tools](https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/devices/esp32.md) (or another target platform kit)
- Install [node-red-mcu-plugin](https://github.com/ralphwetzel/node-red-mcu-plugin) - that will install `node-red-mcu` as well.
- Don't forget to [set the MODDABLE environment variable](https://github.com/ralphwetzel/node-red-mcu-plugin#define-moddable) in your `settings.js`.
- Restart `node-red`.

That ready, the world is yours... 👍

---

<div class="post-metadata">

### Author: ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)
#### Post date: [26 December 2022 04:51 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/6 "2022-12-26T04:51:55Z")

</div>

Thanks. That's exactly what I was looking for.

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [26 December 2022 06:19 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/7 "2022-12-26T06:19:55Z")

</div>

> [@ralphwetzel](#):
>
> That ready, the world is yours...

Thanks !!

I was wondering whether it is possible to use [this](https://hub.docker.com/r/meganetaaan/moddable-esp32) _ **docker container** _? Just to get people started quicker with Moddable, without having to go through the installation manuals. Of course it is only for ESP32, so ESP8266 lovers won't be helped with it... But perhaps not possibe, unless your sidebar could send commands to it. Although it seems well maintained, [this](https://github.com/meganetaaan/docker-moddable-esp32/issues/1) is the only usage information I could find on his Github repo.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [26 December 2022 06:51 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/8 "2022-12-26T06:51:26Z")

</div>

@BartButenaers see [moddable/esp8266.md at public · Moddable-OpenSource/moddable · GitHub](https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/devices/esp8266.md) for esp8266

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [26 December 2022 07:32 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/9 "2022-12-26T07:32:40Z")

</div>

Hey Dave,  
Yes I had seen that. But to be very honest I have very bad experiences with installation manuals that require compilation and builds. For some reason that always fails for me with very cryptic errors. _ **NOT** _ saying at all that this will be the case here! Perhaps it will go very smooth as soon as I start with it. But it seems that somebody has already gone through the entire installation process and created a Docker image for it. So I was thinking: if I could start that container, and send docker commands to it from the node-red-mcu plugin sidebar, that that might be a nice alternative. But perhaps not. I have no idea at the moment...

Just thinking out loud, because I have so much to do in so less free time that every shortcut is a great help for me. And I don't think I am the only one of this community in this kind of situation...

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [26 December 2022 07:53 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/10 "2022-12-26T07:53:10Z")

</div>

> [@BartButenaers](#):
>
> if I could start that container, and send docker commands to it from the node-red-mcu plugin sidebar, that that might be a nice alternative.

Whereas I see the (potential) benefits, I'm currently unsure if this is a valid option. There's e.g. access necessary to hardware ports on the host system & the window server. Additionally, the linked container has a size of 4.someting GB; you wouldn't want to update this once per day! 😉

This yet shall not sound like neglecting your - vaild (!) - comment. We just have to investigate an alternative way of how to manage the efforts to setup the build system.

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [26 December 2022 08:00 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/11 "2022-12-26T08:00:22Z")

</div>

Ok valid arguments...

To be clear: I don't expect you to implement this today, so I can use it tomorrow 😉  
Was just wondering if this could be an alternative way to go, to lower the threshold for people to start using this...

> [@ralphwetzel](#):
>
> the linked container has a size of 4.someting GB;

Ah hadn't seen that. That is indeed big. No arguments agains that.  
But of course I assume that installing each tool on it's own will end up in total to something similar?  
I am not a Docker specialist, but I assume the overlay layers contain the same kind of information as the individual tools on their own?  
But I can be completely mistaken...

> [@ralphwetzel](#):
>
> There's e.g. access necessary to hardware ports on the host system & the window server

Yes I hadn't been asking myself the same question. But I made the assumption that the Docker container developer had already found a solution for this. Otherwise his container would be useless I assume?

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [28 December 2022 08:04 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/12 "2022-12-28T08:04:47Z")

</div>

Morning @ralphwetzel,  
Trying to have something up and running, but not there yet:

1. It would be very useful if your package was published on npm and available via the Node-RED palette. Because quite a lot of command line work is required at the moment, which makes it very hard to test this if you have very limited free time (like me...). Thanks!!

2. This is probably a super stupid question, but I see your sidebar but can't find any of the mcu related nodes:

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [28 December 2022 09:28 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/13 "2022-12-28T09:28:42Z")

</div>

> [@BartButenaers](#):
>
> It would be very useful if your package was published on npm and available via the Node-RED palette.

Will be. Just a matter of time constraint... 😉

> [@BartButenaers](#):
>
> Do you have any idea what I am doing wrong?

Nothing.  
`node-red-mcu` supports the core nodes & some based on other (contributed) nodes & some special ones.

- To work with the core nodes, just pull them in from the left hand node palette - as usual.
- To work with those based on other (contributed) nodes, you'll have to install those.
- The special ones have to be installed separately like any other additional package. You'll find them in the directory where the plugin was installed, subdirectory `node-red-mcu` (e.g. `.node-red/node_modules/@ralphwetzel/node-red-mcu-plugin/node-red-mcu`); search for directories that have a `package.json`. Once installed, they will show up in the palette.

The `node-red-mcu` [page](https://github.com/phoddie/node-red-mcu#nodes) has more details...

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [28 December 2022 13:19 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/14 "2022-12-28T13:19:50Z")

</div>

> [@ralphwetzel](#):
>
> Will be. Just a matter of time constraint... 😉

As an expert in time constraints I can just say: fair enough 😉

> [@ralphwetzel](#):
>
> `node-red-mcu` supports the core nodes & some based on other (contributed) nodes & some special ones.

Ah yes, it are not mcu derivates of the core nodes. But you can drag simple the core nodes in the flow. Had seen that in Peter's youtube video. Completely forgotten...

After installing the sensor node like this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/9/19d14a333b6309dcdf8fadcac652860cf0b71672.png)

The generic sensor node indeed appears in my palette:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/0/70ae155627abb085d60294596f0997cc1cc3d909.png)

If you guys would ever find some time, it would be good to allow this to be done simply via the palette. Otherwise I am afraid that quite some folks will quit during the setup procedure, which would be a pity for this wonderful contribution...

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [28 December 2022 13:19 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/15 "2022-12-28T13:19:52Z")

</div>

> [@ralphwetzel](#):
>
> `node-red-mcu` supports the core nodes & some based on other (contributed) nodes & some special ones.

Quick question. If you are using an instance of node-red for both normal flows and MCU flows - how does that work? Aren't the MCU flows still active in node-red itself as well?

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [28 December 2022 17:32 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/16 "2022-12-28T17:32:30Z")

</div>

> [@TotallyInformation](#):
>
> Aren't the MCU flows still active in node-red itself as well?

As soon as you nominate a flow to be an MCU flow (via the flow selector panel), all nodes of this flow are substituted for the runtime with ones dedicated to support the MCU features. Thus the flow (and all of its nodes) is put in a kind of a standby mode until the MCU connects & sends data...

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [9 January 2023 20:35 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/17 "2023-01-09T20:35:24Z")

</div>

@BartButenaers

> [@BartButenaers](#):
>
> It would be very useful if your package was published on npm and available via the Node-RED palette. Because quite a lot of command line work is required at the moment, which makes it very hard to test this if you have very limited free time (like me...). Thanks!!

Good news - as promised: `node-red-mcu-plugin` is now available via [npm](https://www.npmjs.com/package/@ralphwetzel/node-red-mcu-plugin) as well as via the Node-RED integrated palette:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/7/57cb8f7ef1d208c2e0c609877493fa6457f44325.png)

And as we speak of news:  
We are going to showcase Node-RED MCU Edition @ [FOSDEM23](https://fosdem.org/2023/), Feb 4&5, ULB Brussels / Belgium - even with a dedicated stand. We're looking forward to meet all / most / many / some of you there!

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [9 January 2023 20:47 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/18 "2023-01-09T20:47:11Z")

</div>

@ralphwetzel - Note: there is also an Events category on here so feel free to link to your Fosdem sessions

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [9 January 2023 20:49 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/19 "2023-01-09T20:49:32Z")

</div>

👍 I wasn't aware of this!  
Thank you for your proposal! We'll do...

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [9 January 2023 21:38 UTC](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693/20 "2023-01-09T21:38:18Z")

</div>

@ralphwetzel  
Thanks a lot! Again a step closer to an easy installation procedure.

Nice to see that this stuff is going to be showcased! Unfortunately I won't be visiting FOSDEM23, because my wife now already thinks my Node-RED hobby is getting way out of hands. Even without me starting to visit expositions 😉

[Next page](https://discourse.nodered.org/t/node-red-mcu-plugin-v1-0-integrating-node-red-mcu-edition-into-the-node-red-editor/72693.md?page=2)
