Python Component - $PATH

More
05 Jul 2023 16:50 #274839 by zz912
Hello,

what is $PATH ???

make it executable (chmod +x), and place it on your $PATH

linuxcnc.org/docs/2.9/html/hal/halmodule.html

I am trying to make a python component according to the instructions. It's not working, any idea why?
jarda@CNC:~/linuxcnc/linuxcnc-2.9/configs/sim/gmoccapy/python$ ls
passthrough  remap.py  stdglue.py  toplevel.py
jarda@CNC:~/linuxcnc/linuxcnc-2.9/configs/sim/gmoccapy/python$ halrun
halcmd: loadusr passthrough
<stdin>:1: execv(passthrough): No such file or directory
halcmd:

Please Log in or Create an account to join the conversation.

More
05 Jul 2023 17:22 - 05 Jul 2023 17:30 #274840 by JPL
Replied by JPL on topic Python Component - $PATH

echo $PATH

Have a look here too:

opensource.com/article/17/6/set-path-linux
Last edit: 05 Jul 2023 17:30 by JPL.
The following user(s) said Thank You: zz912

Please Log in or Create an account to join the conversation.

More
05 Jul 2023 17:39 #274841 by zz912
Replied by zz912 on topic Python Component - $PATH
Thank you, it works for me now.

Please Log in or Create an account to join the conversation.

More
05 Jul 2023 17:50 #274842 by MaHa
Replied by MaHa on topic Python Component - $PATH
I use the more comfortable way, keep the component within /home/user/...  environment. Also good for backup of the configuration. In storage folder of component open terminal here, then:

sudo halcompile --install --userspace yourcomponent.py
The following user(s) said Thank You: zz912

Please Log in or Create an account to join the conversation.

More
07 Jul 2023 17:32 #274943 by zz912
Replied by zz912 on topic Python Component - $PATH
To MaHa:

I tried your way, but it did not work.
jarda@CNC:~/Plocha$ halcompile --install --userspace passthrough.py
jarda@CNC:~/Plocha$ halrun
halcmd: loadusr passthrough
halcmd: Traceback (most recent call last):
  File "/home/jarda/linuxcnc/linuxcnc-2.9/bin/passthrough", line 2, in <module>
    h = hal.component("passthrough")
        ^^^
NameError: name 'hal' is not defined

I cannot use "sudo", because I have RIP instalation.

Please Log in or Create an account to join the conversation.

More
07 Jul 2023 23:39 #274979 by MaHa
Replied by MaHa on topic Python Component - $PATH
All info about is here and this worked for me:
linuxcnc.org/docs/stable/html/man/man1/halcompile.1.html

without root it might be difficult, but i don't know, as i have installed from .iso.
The following user(s) said Thank You: zz912

Please Log in or Create an account to join the conversation.

More
07 Jul 2023 23:52 #274981 by tommylight
Replied by tommylight on topic Python Component - $PATH
Did you set the RIP environment before running those commands?
Just a stab in the dark as i have not used RIP for over 5 years or more.
The following user(s) said Thank You: zz912

Please Log in or Create an account to join the conversation.

More
08 Jul 2023 04:45 - 08 Jul 2023 05:09 #274990 by zz912
Replied by zz912 on topic Python Component - $PATH
If I didn't use rip-environment, halrun wouldn't work.

I also didn't write that I use Debian Bookworm.
Last edit: 08 Jul 2023 05:09 by zz912.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
23 Jul 2023 16:41 #276086 by zz912
Replied by zz912 on topic Python Component - $PATH
I tested it in:
Debian GNU/Linux 10 (buster)  LCNC 2.8
Debian GNU/Linux 10 (buster)  LCNC 2.9

same error as here:
forum.linuxcnc.org/38-general-linuxcnc-q...omponent-path#274943
zdenek@CNC:~/linuxcnc/linuxcnc-2.9$ halcompile --install --userspace passthrough.py
zdenek@CNC:~/linuxcnc/linuxcnc-2.9$ halrun
halcmd: loadusr passthrough
halcmd: Traceback (most recent call last):
  File "/home/zdenek/linuxcnc/linuxcnc-2.9/bin/passthrough", line 2, in <module>
    h = hal.component("passthrough")
NameError: name 'hal' is not defined
Note: Using POSIX realtime
zdenek@CNC:~/linuxcnc/linuxcnc-2.9$ sudo halcompile --install --userspace passthrough.py
[sudo] heslo pro zdenek: 
sudo: halcompile: příkaz nenalezen
zdenek@CNC:~/linuxcnc/linuxcnc-2.8.4$ source scripts/rip-environment
zdenek@CNC:~/linuxcnc/linuxcnc-2.8.4$ halcompile --install --userspace passthrough.py
zdenek@CNC:~/linuxcnc/linuxcnc-2.8.4$ halrun
halcmd: loadusr passthrough
halcmd: Traceback (most recent call last):
  File "/home/zdenek/linuxcnc/linuxcnc-2.8.4/bin/passthrough", line 2, in <module>
    h = hal.component("passthrough")
NameError: name 'hal' is not defined

 

Please Log in or Create an account to join the conversation.

More
23 Jul 2023 21:00 #276110 by cmorley
Replied by cmorley on topic Python Component - $PATH
can you post the file for passthrough?
The following user(s) said Thank You: zz912

Please Log in or Create an account to join the conversation.

Time to create page: 0.087 seconds
Powered by Kunena Forum