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

No, and I have checked that it isn't behind any other windows. There was a a notification popup saying
MCU is initiazing
Flows are ready
but that is all.

Nothing indicating a problem in syslog.

Flows are ready is signaled by the flow (!) after it has launched successfully.
Thus your MCU is already up & running.
Sorry to ask: Have you checked your Debug panel for a message?

In case xsbug terminated, you may reconnect via the context menu (down-arrow-button) of the Build button...

That happens when the config parameters of the selected target platform conflict with the physically connected hardware.

FYI: Based on your comment I added two additional generic platform identifiers, esp & esp32. Thank you for triggering this change!

@BartButenaers

I propose you pull the latest update of the plugin from GitHub.
There's now a config option called Debug Target that allows to use xsbug-log in case of headless setups. You need to select console to enable xsbug-log; default is still xsbug.

1 Like

I am watching this a while and didnĀ“t wanna destroy your discussion. I ve some basic things I never got. Node Red on an ESP sounds cool stuff. - I thought first. But With a look at my ESP projects: sensors, switches ... etc. I am asking myself how to get such stuff work !? When working with C++ I can use a bunch of library's for all kind of modules. Do you need to recode all that in some kind (nodeJS) or make a big database of nodes for modules ? I don t know what s the typical use-case: Maybe some more smarter ppl than I am could tell me :slight_smile: Thx!
PS: If I am still exited about this project it needs a more easy step by tutorial variant than this ^^ for me to get it working :slight_smile:

The guys from Moddable already have supported two sensors for me, and the wt32-eth01 board. They are very helpfull, but of course we cannot expect them to support every sensor available. Rome was also not build in one day...

Same for me. I have planned to write one, but I first need to get it running myself...

1 Like

Yes, a necessary question though. :slight_smile:

I pulled the latest version from github and much progress has been made.

Almost everything is working like magic :slight_smile:
I added MQTT in and out nodes and the nodes show connected.
A debug node connected to the MQTT In displays correctly in a debug window.
The MQTT In, connected to the MQTT out, works and does publish correctly as can be seen in an MQTT client.
The only problem I can see at the moment is that If I click the Inject node everything stops. The MQTT pass through stops, which suggests that maybe the ESP device has crashed, or been stopped. If I reconnect to xsbug then it all starts up again.

[Edit] Further to this, if I set the inject to fire automatically every 5 seconds then that works perfectly. It is manually clicking the inject button that kills it.

:+1:

Could you please open an issue at the plugins repo & attach the flow file (sanitized).
I've seen this occasionally, yet only with heavy loaded flows.
An example that helps us to reproduce is very appreciated!

Done: Flow stops when clicking Inject node Ā· Issue #15 Ā· ralphwetzel/node-red-mcu-plugin Ā· GitHub

Now I have to work out what I can usefully do with new-found capability.

1 Like

Is it possible to access the analogue input on the mcu? I see it referenced the node-red-mcu docs, but it isn't clear to me how to access it.

There's a node in the sensor package that supports analog reading.
Be aware though that the Moddable team is still working on integrating this package for the plugin...

OK, I will leave that for the moment.
If I wanted to make one of my contrib nodes available what would be the procedure for doing that? Is it something I can do myself (it is a fairly simple node)?

1 Like

FYI, I have a repeating inject node sending the timestamp to a MQTT output node. I am not experiencing the failure when I manually activate the input node. But I am not using any passthrough. I have given the ESP32 my WiFi credentials on the build.

Sure... and you've bullseyed that piece of documentation, that's not written yet! :wink:

On the other hand - if it really is a simple node - just test what's happening, when you pull it into a flow & try to build. The plugin understands a package.json and walks the full dependency tree in its intent to integrate what's necessary. Depending on the result, I'll guide you through your options...

1 Like

I get

Starting build process...
Host system check: #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023
MCU Build system check: p1.1.2-post + #14cd68e @ m3.7.0-0-g74aa31c
HOME directory check: /home/colinl
Creating build environment for platform esp/nodemcu.
Working directory: /home/colinl/.node-red/mcu-plugin-cache/xbu2qex629n
$ESP_BASE identified: /home/colinl/esp
> cd /home/colinl/.node-red/mcu-plugin-cache/xbu2qex629n
Creating build script file...
> /bin/bash ./build.sh
# nodered2mcu flows
# xsc main.xsb
# xsc node-red-contrib-timeprop.xsb
# mcrez resources
# xsc flows.xsb
Total resource size: 0 bytes
# xsl modules
# cc mc.resources.c (slots in flash)
ReferenceError: module "file" not found
### ReferenceError: module "file" not found!
make: *** [/home/colinl/Projects/moddable/build/tmp/esp/nodemcu/debug/xbu2qex629n/makefile:808: /home/colinl/Projects/moddable/build/tmp/esp/nodemcu/debug/xbu2qex629n/mc.xs.c] Error 22

Though I don't have any file manipulation in my node. Or does that mean I need to install something to build it?

I am just starting to look at things but it seems that you need to put your contrib node here: ~/.node-red/node_modules/@ralphwetzel/node-red-mcu-plugin/node-red-mcu/nodes

Jus guessing though as that is where I found the other nodes.

Don't do!
Just install your mcu-only or dual-use node like any other node.

Those interested in an example of what's possible & how things play together may refer to the heartbeat node - currently available on GitHub only. Be aware that it has zero documentation yet...

ok, my apologies...

Any suggestions what to do about the module not found error?

1 Like

Sorry. I can't reproduce this.
Could you please check if the error persists when you build for a simulator target or an ESP32? No hardware necessary though...

FYI: I've experimented as well w/ your contrib-node. The flow builds without any change. But ... the MCU runtime doesn't like that you're sending null as a message & and throws an exception.