Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    dsf-python 3.3.1 released (successor of pydsfapi)

    Scheduled Pinned Locked Moved
    DSF Development
    2
    5
    436
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mfs12undefined
      mfs12
      last edited by mfs12

      Hallo,

      recently we decided to split the project DSF-APIs (https://github.com/Duet3D/DSF-APIs) into separate ones. Since this split the python part moved into dsf-python and can be found either at

      • https://github.com/Duet3D/dsf-python or
      • https://pypi.org/project/dsf-python

      Features:

      • split go and python repositories
      • official support of pip installer via the python package index

      Bugs:

      • fixed default socket file name
      • deleted flush function from intercept connection

      Official package can now be found at https://pypi.org/project/dsf-python/3.3.1/

      Help to make this project better and report bugs, ideas or wishes here.

      Visit me on github at https://github.com/mfs12/

      oozeBotundefined 1 Reply Last reply Reply Quote 1
      • oozeBotundefined
        oozeBot @mfs12
        last edited by

        @mfs12 We are testing this out (dsf-python) and need a gentle push to get started.. This is on a RPi 4b as the SBC. DSF-Python is installed.

        To test, we are using send_simple_code.py:

        #!/usr/bin/env python3
        
        """
        Example of a command connection to send arbitrary commands to the machine
        Make sure when running this script to have access to the DSF UNIX socket owned by the dsf user.
        """
        
        from dsf.connections import CommandConnection
        
        
        def send_simple_code():
            command_connection = CommandConnection(debug=True)
            command_connection.connect()
        
            try:
                # Perform a simple command and wait for its output
                res = command_connection.perform_simple_code("M115")
                print("M115 is telling us:", res)
            finally:
                command_connection.close()
        
        
        if __name__ == "__main__":
            send_simple_code()
        

        But receiving the following error:

            from dsf.connections import CommandConnection
        ModuleNotFoundError: No module named 'dsf.connections'; 'dsf' is not a package
        

        Any help would be appreciated. Once we can connect, I think we'll be in good shape. Thanks

        oozeBotundefined 1 Reply Last reply Reply Quote 0
        • oozeBotundefined
          oozeBot @oozeBot
          last edited by

          Replying once more as we got this example to work from within the dsf-python/example folder. That's good, as it proves it's working, but how can we get around the error when executing the script from another folder? That's the scenario tried from my previous post..

          mfs12undefined 1 Reply Last reply Reply Quote 0
          • mfs12undefined
            mfs12 @oozeBot
            last edited by mfs12

            @oozebot, you can install this package, and this is the recommended way except you plan to changes to dsf-python.

            You have two options

            system-wide:

            $ pip install dsf-python
            

            or for a single user:

            $ pip install --user dsf-python
            

            then you can import the module like any other as well.

            Visit me on github at https://github.com/mfs12/

            1 Reply Last reply Reply Quote 0
            • mfs12undefined mfs12 pinned this topic
            • mfs12undefined
              mfs12
              last edited by

              New version released. Check...

              https://forum.duet3d.com/topic/26102/dsf-python-3-3-2-released

              Visit me on github at https://github.com/mfs12/

              1 Reply Last reply Reply Quote 0
              • mfs12undefined mfs12 unpinned this topic
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA