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

    3.6.0 RC1 python perform_simple_code not working

    Scheduled Pinned Locked Moved
    Beta Firmware
    3
    6
    178
    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.
    • achrnundefined
      achrn
      last edited by achrn

      I've posted another message about trouble with command connections downloading OM, but I've discovered I've got a problem with even more basic DSF from python, so this one probably comes first!

      I'm trying to use CommandConnection perform_simple_code to set a global variable. This was working on 3.5.4, but isn't on 3.6.0 RC1, though the debug messages look like the system thinks it has worked.

      My python script:

      #!/usr/bin/env python3
      
      # imports
      import sys
      from dsf.connections import CommandConnection
      
      # create command connection used for communicating with dsf
      print("connect", flush=True)
      cmd_con = CommandConnection(debug=True)
      cmd_con.connect()
      
      # update value of global variable
      print ('update variable', flush=True)
      res = cmd_con.perform_simple_code('set global.filWeight = 99', async_exec=True)
      print ('result:', res, flush=True)
      
      cmd_con.close()
      
      # pack up
      sys.exit()
      

      running it:

      root@delta:~# ./foobar.py
      connect
      send: {"mode":"Command","version":12}
      recv: {"success":true}
      update variable
      send: {"command":"SimpleCode","Code":"set global.filWeight = 99","Channel":"SBC","ExecuteAsynchronously":true}
      recv: {"success":true,"result":""}
      result:
      root@delta:~#
      

      but global.filWeight doesn't change to 99 (it stays at 0, from config.g global filWeight = 0).
      I have nothing untoward showing up in journalctl -f or any log files (that I've found).

      Have I missed something fundamental about DSF python in 3.6?

      droftartsundefined chrishammundefined 2 Replies Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @achrn
        last edited by

        @achrn related to https://forum.duet3d.com/topic/37700/ again one for @chrishamm to have a look at.

        Ian

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        1 Reply Last reply Reply Quote 0
        • droftartsundefined droftarts referenced this topic
        • chrishammundefined
          chrishamm administrators @achrn
          last edited by

          @achrn There were some errors in the previous 3.5 dsf-python client which renders parts of it unusable with 3.6. Hence I suggest you upgrade to dsf-python 3.6-rc.1, I expect that will fix your problems.

          Duet software engineer

          achrnundefined 1 Reply Last reply Reply Quote 0
          • achrnundefined
            achrn @chrishamm
            last edited by

            @chrishamm said in 3.6.0 RC1 python perform_simple_code not working:

            @achrn There were some errors in the previous 3.5 dsf-python client which renders parts of it unusable with 3.6. Hence I suggest you upgrade to dsf-python 3.6-rc.1, I expect that will fix your problems.

            Should 3.6.0 be available by apt install?

            I've done apt update and apt upgrade but apt list gives me (inter alia)

            python3-dsf-python/unstable,unstable,now 3.5.0-1 all [installed]
            

            All the rest of the packages seem to have gone to 3.6.0 RC1:

            duetcontrolserver/unstable,now 3.6.0~rc.1 arm64 [installed,automatic]
            duetpimanagementplugin/unstable,now 3.6.0~rc.1 arm64 [installed]
            duetpluginservice/unstable,now 3.6.0~rc.1 arm64 [installed]
            duetruntime/unstable,now 3.6.0~rc.1 arm64 [installed,automatic]
            duetsd/unstable,now 1.1.0 all [installed,automatic]
            duetsoftwareframework/unstable,now 3.6.0~rc.1 arm64 [installed]
            duettools/unstable,now 3.6.0~rc.1 arm64 [installed,automatic]
            duetwebcontrol/unstable,now 3.6.0~rc.1 all [installed,automatic]
            duetwebserver/unstable,now 3.6.0~rc.1 arm64 [installed,automatic]
            
            achrnundefined 1 Reply Last reply Reply Quote 0
            • achrnundefined
              achrn @achrn
              last edited by

              @achrn said in 3.6.0 RC1 python perform_simple_code not working:

              @chrishamm said in 3.6.0 RC1 python perform_simple_code not working:

              @achrn There were some errors in the previous 3.5 dsf-python client which renders parts of it unusable with 3.6. Hence I suggest you upgrade to dsf-python 3.6-rc.1, I expect that will fix your problems.

              Should 3.6.0 be available by apt install?

              Further to that, https://pkg.duet3d.com/dists/unstable-3.6/armv7/binary-armhf/ seems only to contain 3.5 and the 'Packages' file likewise only lists a v3.5

              Package: python3-dsf-python
              Architecture: all
              Version: 3.5.0-1
              Priority: optional
              

              However, 3.6 RC1 version is on pypi: https://pypi.org/project/dsf-python/3.6.0rc1/

              I've used sudo pip3 install --break-system-packages dsf-python==3.6.0rc1 after which the test script up thread works and the variables gets set to 99. I'll try the other issue I had also.

              It would be good if 3.6.0RC1 could be added to the package repository - it seems to be the only 3.5 package in https://pkg.duet3d.com/dists/unstable-3.6/armv7/binary-armhf/ (unless there's a good reason why it shouldn't be included).

              chrishammundefined 1 Reply Last reply Reply Quote 0
              • chrishammundefined
                chrishamm administrators @achrn
                last edited by

                @achrn It should be available via the package feeds as well now.

                Duet software engineer

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post
                Unless otherwise noted, all forum content is licensed under CC-BY-SA