08-26-2021 10:41 AM
I need to run a python script that is stored on my raspberry pi.
In my LabVIEW code I am using the system exec vi and passing it the command python3 \home\pi\test.py.
however this isn't working. the standard error out put of the system exec vi out puts the following:
/bin/sh: python3: command not found
has anyone had any luck with getting a python script to run on a pi when called by Labview?
Thanks for looking,
Solved! Go to Solution.
08-26-2021 01:12 PM
I have not specifically tried to run Python code from LabVIEW code on the Raspberry Pi but I assume that you are having a pathing issue. Also, Python is not installed in the LabVIEW location so you might have issue running it from there even if you don't have a pathing issue.
My thought would be to run the code from the Raspberry Pi OS and send an ssh command from LabVIEW to run it. Now while you will be able to run the code like this I am not sure how well you will be able to change data between the Python code and LabVIEW code this way.
Here is an example of what I am doing to run an ssh command from LabVIEW.
In order to get this all to work you will need Chroot SSH trick and probably Run ‘sudo’ Command Without Entering a Password in Linux.
08-27-2021 04:19 AM
Thanks for the reply.
I'll have a look at the articles you linked and see if it gets me up and running.
I'll let you know how I get on!
08-31-2021 07:33 AM
sorry for the delayed reply.
I tried the ssh method you outlined and that it going thanks!
12-26-2021 04:01 AM
12-26-2021 07:28 AM
12-26-2021 07:54 AM
12-26-2021 10:07 AM
What was your issue? It sounds like you are saying your issue is with the Raspberry Pi and not LabVIEW LINX. You may want to start your own post if it is not released to this topic.
12-28-2021 03:38 AM
thanks for your solution, I follow you mentioned method has successfull
12-28-2021 03:40 AM