@Ant1 We realized that after putting the U axis under tension using M17 U, there is an interference between the BL Touch's ground and the U motor phases... So we are now investigating this issue. So I think that the issue doesn't come from the firmware, so I guess we can close this topic and we will test our setup on our side... Thank you very much for your help !!
Best posts made by Ant1
-
RE: BL Touch doesn't deploy after moving U axis
Latest posts made by Ant1
-
Raspberry PI camera issue with AppArmor
Hello !
I am writing a plugin that uses a raspberry PI camera to calibrate print heads. I encounter an issue where the camera won't start when constructing the camera object:
from picamera2 import PiCamera2 cam = Picamera2() Returns the following error: [0:32:17.478523088] [4325] INFO Camera camera.cpp:990 Pipeline handler in use by another process Camera __init__ sequence did not complete.
I am pretty sure that this issue is due to the apparmor configuration because if I run the exact same script from another folder on the raspberry PI, I don't get any errors...
Do you have any experience using a Raspberry PI camera from the plugins ?
Thanks for your help !
-
RE: /usr/bin/env: ‘python3’: Permission denied
@achrn
Thank you a lot ! This was indeed the problem, I didn't havelaunchProcesses
. I removed it at some point because I didn't think it was necessary to run the python script, but since it depends on an external library, that might cause the issueThank you !
-
RE: /usr/bin/env: ‘python3’: Permission denied
@chrishamm
Yes I have already done that. Myplugin.json
contains the following:"sbcPackageDependencies": ["libzbar0", "python3-picamera2"], "sbcPythonDependencies": ["opencv-python", "pyzbar", "Pillow", "numpy", "dsf-python>=3.5.0.2rc2"],
-
RE: /usr/bin/env: ‘python3’: Permission denied
I have tried to change the line ending with
dos2unix
but it still gives me the same error...If I change the first line to
#!/usr/bin/python3
, as you suggested, I get the following error:from pyzbar.pyzbar import decode, ZBarSymbol ... ImportError: Unable to find zbar shared library
Which is weird, because I have installed this library and all its dependencies, and I can get the import to work in a python3 interpreter, with no errors:
Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pyzbar >>>
So it seems to me that something is not quite right with the DSF environment or PATH... Any ideas ?
-
/usr/bin/env: ‘python3’: Permission denied
Hello ! I wrote a python plugin for my duet and I get the following error when I start the plugin from the web interface:
/usr/bin/env: ‘python3’: Permission denied
I have installed the same plugin on another duet board, and it starts without errors, but on this one it somehow doens't work... I have compared the python, dsf-python, duetsoftwareframework versions on both machines and they have the same packages.
Is there something that could be mis-configured on the raspberry PI ?
Thank you for your help !
Antoine Brunner
-
RE: File2 is not a valid CodeChannel
@chrishamm @stuartofmt I also find a bit dangerous / weird to use
exec(...)
to compare the versions, as it can very easily lead to code injection, even though it is probably not the intent of people writing plugins.
Edit: the allowed characters are limited (for example, no parentheses), so this is probably not possible. -
RE: File2 is not a valid CodeChannel
Looking at the installation code from the Duet Software Framework repository, I feel like that this line might be wrong, with the comparison inverted:
comparison = 'version("' + installedVersion + '")' + mCompare + 'version("' + mVersion + '")' # version numbers are strings
Could this come from here ?
-
RE: File2 is not a valid CodeChannel
Ahaaa, I managed to see wher the issue comes from !
It seems like File2 was added in DSF 3.5, and I have a mismatch between the DSF version and the python bindings.
To try and fix that, I added the following requirement in the
plugin.json
file:"sbcPythonDependencies": [..., "dsf-python>=3.5.0.2rc2"],
But the plugin still fails, so I have the impression that the
dsf-python
package is not installed with the correct version. -
File2 is not a valid CodeChannel
Hello !
I wrote a plugin to automatically calibrate print heads using custom M-codes. When I launch the script that intercepts the M-codes manually, everything works as expected. Then, I wrapped my code in a plugin, with the exact same code. This time, however, the code fails, with the following exception:
Traceback (most recent call last): File "/opt/dsf/plugins/AutoCalib/dsf/calib.py", line 243, in <module> if any(not h for h in printer.homed()[:3]): ^^^^^^^^^^^^^^^ File "/opt/dsf/plugins/AutoCalib/dsf/printer.py", line 36, in homed om = self.get_object_model() ^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/dsf/plugins/AutoCalib/dsf/printer.py", line 19, in get_object_model return self.connection.get_object_model() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/dsf/connections/base_command_connection.py", line 76, in get_object_model res = self.perform_command(commands.object_model.get_object_model(), ObjectModel) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/dsf/connections/base_connection.py", line 63, in perform_command response.result = cls.from_json(response.result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/dsf/object_model/model_object.py", line 87, in from_json return cls()._update_from_json(**preserve_builtin(data)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/dsf/object_model/object_model.py", line 165, in _update_from_json super(ObjectModel, self)._update_from_json(**kwargs) File "/usr/local/lib/python3.11/dist-packages/dsf/object_model/model_object.py", line 76, in _update_from_json setattr(self, attr_name, attr.update_from_json(json_value)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/dsf/object_model/model_collection.py", line 57, in update_from_json self.append(self._item_constructor().update_from_json(item_to_add)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/dsf/object_model/model_object.py", line 93, in update_from_json return self._update_from_json(**preserve_builtin(data)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/dsf/object_model/model_object.py", line 69, in _update_from_json setattr(self, json_key_snake, json_value) File "/usr/local/lib/python3.11/dist-packages/dsf/object_model/inputs/input_channel.py", line 132, in name self._name = CodeChannel(value) ^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/enum.py", line 717, in __call__ return cls.__new__(cls, value) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/enum.py", line 1133, in __new__ raise ve_exc ValueError: 'File2' is not a valid CodeChannel
So it seems that I cannot get the object model from the code when it is wrapped in the plugin, even though I set the correct permissions (
"objectModelReadWrite"
)...Do you have any ideas as of why this happens ?
Thank you very much for your help !
Antoine Brunner
-
RE: BL Touch doesn't deploy after moving U axis
@Ant1 We realized that after putting the U axis under tension using M17 U, there is an interference between the BL Touch's ground and the U motor phases... So we are now investigating this issue. So I think that the issue doesn't come from the firmware, so I guess we can close this topic and we will test our setup on our side... Thank you very much for your help !!