Use exec node in Node-RED while running Windows 10? - node.js

I have been trying to run the exec node in Node-RED, hoping that it would use the command prompt native to Windows 10. I would provide a command that would run a python script I have. If the command went through, my windows button would be clicked. Node-RED says "Successfully Deployed" when I run my single exec node, but the windows button does not pop up. I am concluding that Node-RED does not know how to access the Windows command prompt, which is very frustrating. Is there a way to run python scripts from Node-RED while running Windows?
In case it is relevant, I am using Node-RED to communicate with the bluetooth low energy protocols of the Lightblue Bean Arduino board. I am sure that there is not a python library for communicating with bluetooth low energy for Windows. For Mac and Linux, sure, it's implemented by Adafruit. But they say they do not have anything for Windows.
Many thanks.

I asked someone and they told me you cannot have a standalone exec node- you need to use an inject node to get everything going. I checked off "Inject once at start?" and my script ran just dandy.

Related

Buildozer, WSL adb not finding device, adb in Powershell works

I have a python program using PySimpleGUI. It works on Windows, a pure Linux machine and it also works on the WSL. I'd like to use it on my phone(Pixel 7 pro). Buildozer makes the apk file but during the process 'buildozer android deploy run logcat' it runs the adb devices cmd and finds nothing. The adb devices from a PowerShell works fine. It probably has something to do with the virtual machine WSL provides. I've queried google and read pages of information and suggestions and nothing so far works.
Please let me know if I can provide anymore info that will help solve this.
I've tried running the adb in the build environment manually, outside build script of buildozer, with the same results, no devices found.
I'd like to move on the next step of trying or troubleshooting the app on my phone.
Thanks in advance, Craig

Yarn Project Not Working After Mac OS Ventura Installation

I have updated my mac's OS and when I try to run the same commands that I did prior to the update (see file, it was simply just yarn), I get a vomit of errors on my terminal and I get a system prompt that states: The "make" command requires the command line developer tools. Would you like to install the tools now? After I click Install it takes about 20 minutes and it says installation finished, only to have the same behavior when I run the same command in my terminal.
Any one else a developer using Ventura running into weird problems running their code base?
Will be happy to share my output logs if somebody cares to help.
Did exactly what system prompts said, only to give me the same behavior when trying to run my code locally. It is in a feedback loop and am un sure how to approach it at this point.

How to debug remote Python script in VS Code

I am doing Python development in Raspberry Pi. I have installed VS Code in my laptop and have installed the ssh extension. Using this I can easily connect to Raspberry Pi. While I am connected I can see that VS Code has also loaded the Python interpreter of Raspberry Pi. I can run my Python script from within the vs code but when I tried to debug the code, nothing happens.
Is it possible to remotely debug the Python script from laptop to Raspberry Pi? How can I enable this?
I have resolved this issue. If anyone wants to do remote development and debugging, follow below steps:
Install remote ssh extension in VS code
Once installed, you will find a green icon on the bottom left corner in vs code which allows us to connect to the remote machine.
Connect to the remote machine using the standard ssh command. Alternatively, you can use ssh-keygen to generate a public-private key if you don't want to use the password at every prompt.
Once you are connected to remote machine, you can open the file explorer and create any python file. When you will save this, it will get saved in your remote machine. This way you are using your machine to remotely develop code on another remote machine.
Good thing about vs code is that it selects the remote machine's python interpreter so all the packages which you have installed on your remote machine will work with IntelliSense.
In order to debug the code, we will use debugpy. Install this on both machine (remote & local)
On your remote machine, run below command:
python3 -m debugpy --listen 1.2.3.4:5678 --wait-for-client app.py
here 1.2.3.4 is the IP of remote machine. This will start a remote debugger which will wait for a clients connection.
On your local machine, in VS code open Run & Debug, add a configuration of Python: Remote Attach. Make sure that launch.json has the host as the IP of your remote machine and port as 5678.
Now start debugging as normal and you will notice the code will break at first breakpoint and from here you can proceed normally as we used to do in local debugging process.
TBH, this is best feature VS code has because most of the software allows you to do remote development which is nothing but just a normal SSH but remote debugging gives you more control. I was doing some python project on Raspberry Pi and obviously cannot install VS code or pycharm on it. But with this feature now I can easily develop the code using Pi's python interpreter and debug it as well.
If anyone is having any issues, let me know. Happy to help.

Screen tool on Galileo

I have compiled and installed screen tool on Galileo running on Yocto.
http://www.gnu.org/software/screen/
When I run the tool everything is OK, I can create many sessions. However when I close the terminal all my sessions are closed (when I do "screen -ls" from other terminal there are no sockets). This is not happening in any other Linux distribution.
Regards,
Yevgeniy
Are you running screen from inside a ssh connection? There was a bug in earlier releases of the devkit where on disconnect systemd killed all processes started by the daemon, which isn't what you want. This has been fixed so upgrading your image should be sufficient.
If you can't get the upgrade, the fix is to add "KillMode=process" to the end of /lib/systemd/system/ssh#.service.

Attach/Detach to a remote instance of Eclipse

When using Eclipse over X-Windows on a remote shell (X port forwarding), is there a way to simply detach my X connection and come back to the process later. For a little more clarity, I'm on a Windows machine and have to reboot. I'd like to keep Eclipse running and come back where I left off. Eclipse is running on my Windows machine through an X-Server connected to a Linux box.
I'm thinking something like tmux could do the trick. However, I do a Ctrl-Z to stop Eclipse and it won't close the Eclipse Window. If I restart the X-Server in Windows, Eclipse fails when I try fg 1. Any other options?
Xpra did everything that I needed, but it was not clear exactly how it worked. I was able to get it working by opening two PuTTY sessions in windows, one server and one client. Also, the Google Code is out-dated. Instead, install from http://xpra.devloop.org.uk/dists/xpra-0.0.7.9.tar.bz2. I'm not sure how it's different, but it worked for me. The README tells how to build the package. It is necessary to apt-get a bunch of other stuff. But, here are the missing pieces on how to get it work as I describe above:
Setup server:
cd ~/download/xpra/xpra-0.0.7.9
export PYTHONPATH=$PWD/install/lib/python:$PYTHONPATH
./install/bin/xpra start :10
export DISPLAY=:10
xterm&
Setup client:
cd ~/download/xpra/xpra-0.0.7.9
export PYTHONPATH=$PWD/install/lib/python:$PYTHONPATH
./install/bin/xpra attach :10
Notes:
The Windows xpra installer is not needed for this configuration. I don't know what it's supposed to do.
Be sure to run Xming on Windows.
Be sure to enable X port forwarding on the client PuTTY window.
Launch whatever you want from the xterm window. (ie Eclipse)
You can close the server window once xterm is up.
Hit ctrl-c in the client window to detach from the session.
Do all the client commands again to re-attach..even after restarting PuTTY, the Xming, or Windows itself.
I have zero experience with it, but xpra sounds like exactly what you're looking for.

Resources