-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when running plugin #1
Comments
Thank you for testing this plugin! The error you hit is due to the fact that MODDABLE currently is not defined on your system. Thank you for catching this! I will add a guard to compensate for this situation. |
Thank you for the advice |
@mtoko |
I have pulled the latest update and the error is not returned but a message I have tested the Moddable installation and can copy a flow from the editor and paste into flows.js and this works. Does this indicate that the Moddable setup is correct? |
I'm sure your Moddable setup is correct as you've already worked with it successfully. To sort this out, I would like to ask you to add a logging statement @ line 30 of your installed Original code: node-red-mcu-plugin/mcu_plugin.js Lines 28 to 33 in da30448
With modification:
After restart of node-red, you'll find the environment variables it knows about printed out to your console (prior to the error message you already know). Does this comprise MODDABLE ? |
I have added the console.log and this is the output |
Thank you for providing this data. As I anticipated, this extract shows that your Node-RED doesn't know the $MODDABLE environment variable.
The solution is stated as well:
If you confirm this proposal solves the issue, I'll add a dedicated comment to the error message. |
I have added the environment variable to the settings.js at the top of the file before the module.exports process.env.MODDABLE='$MODDABLE', /*****************************************************************************>
When starting Node Red the error message is displayed but the console.log indicates MODDABLE { The MCU sidebar is available and a new build configuration can be added. I have used esp32 but the @ box is empty and there is no result when the Build button is selected |
I'm pretty sure, you have to provide the full path to the moddable directory rather than a reference to another env.variable. That said, I propose you add the following line to your settings.js:
After you hit that error, the code should have bailed out. I'll verify that once again. |
That's looks like another issue with the env. I've pushed another change that checks now if it is defined & adds it to the runtime's environment if not. |
Thank you cd /tmp/node-red-mcu-plugin2IvF05 Error: '/home/darryl/Projects/moddable/modules/base/structuredClone/manifest.json': manifest not found!I have then done a git pull of the latest Moddable and the manifest error has gone. The error is now cd /tmp/node-red-mcu-pluginxVumbk |
It is ... but Node-RED doesn't have access to it - as explained before. Your latest error seems to be related to ESP-IDF. There's a commit that bumped the required version to 4.4.2. Have you updated this as well? |
I have checked the ESP-IDF version is 4.4.2 and the error message states Expected ESP IDF v4.4.2, found |
Are you able to create a successful build when targeting a simulated device? |
OK. Thanks for trying. This comes from node-red-mcu ... yet doesn't help further. Looking at the Moddable source, it says: This brings us back to the fact, that it cannot find IDF: I suspect - again - an issue with the PATH definition. Checking PATH on my (Mac) system, there's a bunch of entries related to ESP:
None of this is existing in the PATH info you provided earlier. |
Perhaps it's easier than expected. Could you please add
to your [**] There might be the chance, that the EDP-IDF directory is at a different location, e.g. when you're working w/ xs-dev. Thus please make sure to provide the correct path for your system. |
Firstly, apologies. I have added to the settings file and then restarted Node Red. This is the settings file and the bashrc file. If I build with the Simulator I get this error
And if I build with ESP32 Node MCU, I get this error. I have checked and idf.py is in /home/darryl/esp32/esp-idf/tools
|
No need to apologize at all. I'm grateful of your support to sort out this issue. |
@mtoko I've just pushed some major changes into the repo. This addresses especially your issue that demands additional steps to prepare the environment. Could you please test these latest changes & give me a feedback? Thanks in advance! |
I have completed some testing Prerequisites On the first machine the Node Red Projects feature was enabled and the MCU side bar does not appear. On the second machine the Node Red Projects feature is not enabled and the MCU side bar appears. I have tested with two configurations, one with the simulator and one with a ESP32/nodemcu These are the build configurations and the errors |
@mtoko -- I was finally able to provide a fix for this issue. Please be aware that you might need to update your toolchain. The documentation explains the details. Looking forward hearing from your progress... |
Hello, thank you for the great tool! In my case, installed in Ubuntu. (I tried Ubuntu based Linux mint first, then try on original Ubuntu, but results are the same.) however, it looks build commands are generated properly in the plugin window.
in your additional explanation on the document:
There is one more thing, I also tried on Mac BigSur and it works fine! |
@mshioji -- |
It looks like |
Hi @ralphwetzel, Thank you for your quick action, I tried your update and get a lot of information on console window. when I look at /usr/bin/python, there is 3.10.6 installed but I don't care this since I using pyenv for Python environment. do you think this is the reason? here is the complete log from the console window:
|
To make sure "which Python is used" is only an issue, after this, build process works fine!! In fact, it would be better to use the Python environment which installed in ESP-IDF installation process on Moddable, Thanks to your great work and support. |
|
Thank you for the analysis. So that's how it works internally. |
Yes, in my side It's fine you can close this issue. |
Sorry for posting here again. -- here's complete log:
|
Please try to update your |
Yes, I've re-install Moddable SDK as well with current version. I re-installed all the relevant software this morning, but the situation is the same.
|
Whereas I think it doesn't matter for this issue: You don't need to
|
@mshioji : Thank you for this report!
I have the impression, that the cause for the issue is an attempt implemented in the Moddable SDK to address this topic - that went a bit too far: According to the
Your installation yet is validated by
This needs - from my perspective - an action of the Moddable team. |
That's what I thought at first too, but without this step it showed an error like this.
and, Thanks for your analysis of build stop. |
Guessing here: |
Oops, that was the reason. Yes, I was trying node-red-mcu and sensor node without plugin first on this machine. |
Thank you for all the work on this plug in
I have installed as instructed in the standard Node Red directory (~/.node-red) and the plugin can be seen in the node_modules directory in a folder @ralphwetzel.
When starting Node Red the following error appears in the console and the plug in is not displayed in the Node Red Editor
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined at new NodeError (node:internal/errors:372:5) at validateString (node:internal/validators:120:11) at Object.join (node:path:1172:7) at module.exports (/home/darryl/.node-red/node_modules/@ralphwetzel/node-red-mcu-plugin/mcu_plugin.js:349:34) at loadPlugin (/usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js:419:27) at /usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js:458:31 at Array.forEach (<anonymous>) at loadNodeSetList (/usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js:455:11) at /usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js:143:16 { code: 'ERR_INVALID_ARG_TYPE'
The text was updated successfully, but these errors were encountered: