Python M6 Remap Not Callable in LinuxCNC 2.9.4– Function Not Recognized

  • Abdelrahmankandil
  • Abdelrahmankandil's Avatar Topic Author
  • Away
  • New Member
  • New Member
More
26 Jun 2025 18:46 - 26 Jun 2025 18:47 #330903 by Abdelrahmankandil
Hello everyone,I’m facing a persistent issue with implementing a Python-based M6 remap in LinuxCNC 2.9.4 running on Debian Bookworm. No matter what I try, LinuxCNC always reports that my remap function is “not a Python callable function,” even though I have followed all the official documentation and community advice.Details:
  • Configuration:
    • In my INI file, I have:
    • [RS274NGC]


      PARAMETER_FILE = linuxcnc.var
      RS274NGC_STARTUP_CODE = G21 G40 G90 G94 G97 G64 P0.025
      REMAP = M6   python=my_m6_remap_function modalgroup=6

      [PYTHON]
      PATH_PREPEND=/path/to/my/python/scripts                            
      PATH_APPEND=/path/to/my/python/scripts  
      TOPLEVEL=/path/to/my/python/script/m6_tool_change.py

      The Python file is in the correct directory, and the function name matches exactly. The function signature is:
      •     def my_m6_remap_function(self, **words):
                # minimal test code
                print("Hello from  REMAP")
                return INTERP_OK



        I have tried different function names, ensured the function is top-level (not inside a class or another function), and removed any __init__.py, .pyc, or __pycache__ files.File encoding is correct (UTF-8/ASCII), and permissions are set properly.Result:I always get the following error:
            'my_m6_remap_function' is not a Python callable function - ...:REMAP = M6   python=my_m6_remap_function modalgroup=6
        I have tested this on multiple machines, with fresh configs (including a clean Axis config), and even on a different PC – always the same result.Remapping using ngc (subroutine) works perfectly.
        I can import linuxcnc in Python 3 without issues.
        I have tried examples from stdglue.py and the forums – same error.Environment:Debian BookwormLinuxCNC 2.9.4 (from official repositories)Python 3 bindings are present and workingNotes:I suspect this is either a bug in LinuxCNC 2.9.4 on Bookworm or a missing package/feature in the current build.
        Downgrading to an older distro or using Python 2 is not a practical option for me.I need Python remap for integration with a custom PyQt5 GUI and an Automatic Tool Changer (ATC).Has anyone else encountered this issue or found a practical solution?Is there a way to enable Python remap support in this environment, or any workaround besides using ngc?
        Any help or suggestions would be greatly appreciated!
Last edit: 26 Jun 2025 18:47 by Abdelrahmankandil.

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

More
26 Jun 2025 19:03 #330904 by Aciera
Difficult to troubleshoot. Please attach your zipped config folder so we can see how things are setup.

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

  • Abdelrahmankandil
  • Abdelrahmankandil's Avatar Topic Author
  • Away
  • New Member
  • New Member
More
26 Jun 2025 19:06 #330905 by Abdelrahmankandil
You mean the ini file or what ?

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

More
27 Jun 2025 04:45 - 27 Jun 2025 04:46 #330917 by Aciera
The whole folder that contains the ini file, the remap and everything else.
Right click on the folder and choose 'compress'.
Last edit: 27 Jun 2025 04:46 by Aciera.

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

Time to create page: 0.061 seconds
Powered by Kunena Forum