3.6.0 RC1 python perform_simple_code not working
-
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?
-
@achrn related to https://forum.duet3d.com/topic/37700/ again one for @chrishamm to have a look at.
Ian
-
undefined droftarts referenced this topic
-
@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.
-
@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
andapt upgrade
butapt 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]