I think it is just the same as with normal node-red. With that, when you press the inject in the browser, it sends a message to the node-red server, which does its bit, and the debug node sends it back to the browser. With the mcu edition it is basically the same, except that the node-red server (mcu version) is running in the device.
[Edit] Perhaps you meant how does the comms work between the browser and the device, in which case ignore me.
Could you please open an issue at the repository. Not much explanation necessary - just to ensure I remember it on the long run.
Yes. This is a "speciality" of Node-RED when it runs as a service. In short, it doesn't have access to the host environment. Thus despite you defined those variables, they are not available to Node-RED. The solution is straight forward ... and explained in the Readme. You have to do this for MODDABLE and for IDF_PATH.
Put an AND between your sentences. The inject node runs in the runtime - that runs on the MCU. The editor runs locally on your system. As with legacy Node-RED, the editor sends the trigger signal, which is then forwarded to the runtime ... on the MCU.
To sum it up: Node-RED MCU Edition provides the same user interaction features as legacy Node-RED.
Adding ESP-IDF tools to PATH...
ERROR: tool xtensa-esp32-elf has no installed versions. Please run '/home/pi/esp-idf/install.sh' to install it.
ERROR: tool xtensa-esp32s2-elf has no installed versions. Please run '/home/pi/esp-idf/install.sh' to install it.
ERROR: tool xtensa-esp32s3-elf has no installed versions. Please run '/home/pi/esp-idf/install.sh' to install it.
ERROR: tool riscv32-esp-elf has no installed versions. Please run '/home/pi/esp-idf/install.sh' to install it.
ERROR: tool esp32ulp-elf has no installed versions. Please run '/home/pi/esp-idf/install.sh' to install it.
ERROR: tool openocd-esp32 has no installed versions. Please run '/home/pi/esp-idf/install.sh' to install it.
So I runned that install.sh script, and then it was solved. I don't think it is mentioned in the documentation. Might be worth adding it...
Then my build for my wt32-eth01 seemed to have run successfully. But I don't see anything in my Debug Panel, although I have set the inject node to keep injecting messages:
Hmm now I am not sure if there is a way to determine whether the wt32-eth01 was succesfully programmed. Perhaps I am just doing something stupid wrong. Normally I use those devices wired (i.e. ethernet) but to test this quickly I left it connected to the USB/TTL converter. I just unconnected the IO0 pin to leave programming mode. I assume that should work because I have entered the wifi credentials. But not sure at the moment...
Hi @BartButenaers !
We had ... and we're expecting another one full of interesting exchange around Node-RED and the Node-RED MCU Edition. It's too bad you didn't get the clearance to stop by ... !
It is; step 8 in Installing. As you don't need this on the other platforms, I'm sure it easily can be overlooked...
The feedback from the MCU to the Node-RED editor is established (only) via the serial connection. Thus it's launched just after finishing the flashing process. If you have to detach the device (as I understood), this is going to cut the feedback line. For this case, there's a way to re-establish the link (after you've re-attached the device) without performing another build run: Press the down arrow of the Build button & select "Reconnect to xsbug...":
This should open xsbug and as well establish the link to the Node-RED editor...
Ok then! Let's try if it works in general - and afterwards let's make it talk to Node-RED:
I assume that you installed xsbug-log from the Moddable SDK.
Please access your Pi, cd into the Working Directory (that should be logged at the beginning of the build process) & then run ( as safety measure)
source $IDF_PATH/export.sh
followed by
mcconfig -d -l -m -p esp32/wt32_eth01 -t xsbug
Doing this, we take Node-RED out of the game and just perform the basic XS build / connect process; we run the flow on the MCU and - rather than opening xsbug - reroute the debug messages to the console window.
If that works, we'll continue to verify the feedback path to Node-RED.
That's the source path.
Please take care that you as well npm installed it as stated here in the second Note. It's called as a node script & thus installation in mandatory to use it...
If you then run (notice the missing -t flag)
mcconfig -d -l -m -p esp32/wt32_eth01
it should launch a compiler run.
With
mcconfig -d -l -m -p esp32/wt32_eth01 -t xsbug
you should at least get the # starting xsbug line as before.
All is good, if this is followed by a log message each time the inject node injects...
I have been following this thread with great interest. I just had my first success with a esp-c3-32s-2m. I had a simple inject node to a debug node. I could see my inject response on both the NR console debug window as well as the xsbug window.
Now do try and do something more fun with it.
edit: Ok, I am trying another flow. But I am now consistently getting termios.error: (5, 'Input/output error') during the load. Do I need to do something with the ESP between loads?
Hmm, this is getting embarrassing
I really thought that I had executed nicely all the steps required to get this stuff up and running. And over and over again it seems that I have somehow forgotten to run stuff...
Suddenly I remembered that last weekend I had detached my wire to put the wt32-eth01 in programming mode. So I added the wire again (between pins IO0 and GND), and then it started flashing:
I am hoping to find time to get started playing with this. Is the Wemos D1 Mini supported already? I couldn't find any direct info about using that board with Moddable.
You can build for all ESP32 (and...) boards, no matter what brand.
Those "supported" generate predefined settings, e.g. for the available infrastructure (e.g. buttons or LEDs), to make life a bit easier. It just saves you from finding this data in the documentation.
There should be nothing that stops you from being successful as well with another board...
I have installed the SDK and ESP8266 support with very few issues (on Ubuntu 22.04) and tested it with the Moddable hello world example. The ESP8266/nodemcu option seems to work ok so far with the D1 Mini.
I installed the plugin in node-red. When I start node-red I get a message in the log
9 Feb 07:48:13 - [info] *** node-red-mcu-plugin:
9 Feb 07:48:13 - [info] It looks as if a new platform option has been added.
9 Feb 07:48:13 - [info] Please raise an issue @ our GitHub repository, stating the following information:
9 Feb 07:48:13 - [info] > New platform: esp32/atoms3
9 Feb 07:48:13 - [info] > New platform: esp32/wt32_eth01
Do I need to worry about that?
I added a flow with inject and debug node and selected the flow for mcu build, set the build config to
Deployed an clicked MCU Build button. In the mcu console it built it and flashed it ok, finishing with
Writing at 0x003fc000... (100 %)
Wrote 128 bytes (75 compressed) at 0x003fc000 in 0.0 seconds (effective 254.1 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
In the node red log I see
Launching mcuProxy:
- Listening for MCU @ :::5004/IPv6
With anticipation I clicked the Inject button in the flow, but sadly, after everything looking so good, nothing happened.
I don't know what to do now.