@dc42 said in Change name of 1LC or Sammy board in Firmware:
That is where you would need to change the name of the file that is installed when you command a firmware update or a CAN reset.
Awesome, thanks, I will try it!
@dc42 said in Change name of 1LC or Sammy board in Firmware:
That is where you would need to change the name of the file that is installed when you command a firmware update or a CAN reset.
Awesome, thanks, I will try it!
Hey,
I'm looking for a way for the 1LC (or sammy) to communicate a pre-defined code (name/number) to the main board when asked via gcode.
I was thinking of slightly modifying the bootloader so that it has this info permanently stored in the chip.
It would then inform me of its "code" by giving each 1LC/SAMMY a custom name and then querying that name via
M122 B11
This should return
Diagnostics for board 11: Duet TOOL1LC firmware version 3.3beta2+1 (2021-03-20 14:03:00) Bootloader ID: SAMC21 bootloader version 2.3 (2021-01-26b1)
Instead, my plan would be that it returns:
ID: Custom_code_1 version 1.1 (_date_)
My question is: Is that the best way to implement this?
Is there an easier way than creating a custom firmware, similar to updating the canbus address via gcode?
And in case that's the way to go, could someone please point me to where this info is encoded? I was looking through the Github repo for Sammy board to find where the info would be saved for this board, but couldn't find the location
@o_lampe It has to be well-timed (position & intensity), but I'm not continuously using the output device for longer than a couple of minutes if that makes a difference.
On/off is not ideal, as I cannot use the preparation scheme of exisitng slicers that would allow me to follow G1 Sx commands.
@oliof yes, exactly!
Is it really related to data rates of the CAN-bus or is it simply not yet implemented?
thanks for all your support.
my main use-case is to have the laser as a modular printhead and having a printer base that I can easily re-configure to fit either 1, 2 or more laser, or combine it with other extrusion modules.
There is also a heating and cooling system present. It's a low-power laser that is not used for cutting/engraving, but has a special applications.
Therefore, I was looking to have more than 1 laser pin, and moreover, having this pin on a toolboard.
Is there perhaps a way to re-map the mainboard pin?
eg: if pin(main) is high, set pin(toolboard) to high?
@jay_s_uk that's odd, do you know the reason?
Is there any way to circumvent this?
On the same topic:
Definingn the port with M452 ONLY allows to define the laser head on the mainboard.
The moment I move this pin to a 1LC, I get
Error: M452: Port must be on main board
Why is that? Can I only connect a laser PWM to the main board?
@jay_s_uk
Thanks for your input.
I see. Yes, I already thought that this would be the only option to move forward.
If anyone has a more elegant solution, I'd still behappy to hear it.
Hi everyone,
With the tool-changing capabilities of the Duet3D firmware, we're building a printer with multiple laser heads and extruders.
We already figured out that we can swap between fff mode and laser mode when switching between the tools, but I'm struggling to define more than 1 laser head.
According to the laser config doc:
this enables Laser mode, on out9, with max intensity being 255, and a PWM frequency of 200
M452 C"out9" R255 F200
then, during printing, this controls the laser based on E values in G1
M571 P"out9" F200 S255
I'm looking for a way to have multiple M452 commands and "tie" them to a tool definition, similar to the way I define my other tools
whenever I perform a tool-change, Duet should know which laser head to turn on when following G1 commands.
what am I not seeing? any pointers are greatly appreciated!
@dainon
Thanks for the write-up, that's an interesting solution.
Can you tell me how exactly a reverse proxy circumvents the CORS issue?
How exactly does the relaying part work?
At the moment, our website is hosted on a domain, in our case with an ingress tunnel from cloudflare.
The thing is.... I'm not even sure what is causing the CORS, as I AM connecting to the device from the same location (ie origin) after reset.
I'm trying to understand where the error stems from and how your implementation is different?
@chrishamm is there a way to completely disable CORS on the RPi, without gcode? Is it possible to change in the server code?
There used to be a way to hard-code it by editing UseCors in /opt/dsf/conf/http.json from false to true.
I also tried that to no avail.
Is there a different way to change the server headers?
On a related basis, where do I find the logs of these CORS events server-side?
Perhaps this can help debugging the issue further?
Thank you everyone for the feedback!
Best,
-h
@chrishamm
thanks chris for linking the docs, I must have missed them.
I can now disconnect and connect to previous sessions by storing the sessionkey.
However, as soon as I reset the printer (M112, M999) and I try to reconnect to the websocket again, I get a CORS error
The config.g, as well as the dsf-config.g both have M586 C"*" as the first line.
Funnily enough, if I'm fast enough, right after hitting reset, I disconnect and re-connect directly, then I can re-initiate the websocket, but not send any commands, as all GET requests result in a CORS error!
Is there a different way of disabling the CORS headers?
Or a different way of dealing with this kind of behaviour?
I spent the past 10 hours trying to circumvent this problem to no avail.
Hi,
I'm running into the same error with a custom web-based app to control my printer.
I initiate the connection through the websocket and it works.
Whenever I send reset (M112 + M999), the webapp cannot initiate the connection anymore, giving me a network error.
Is there a description somewhere on how the traffic to the websocket must be structured?
I checked the implementation on the Duet side: https://github.com/Duet3D/DuetWebControl/blob/e9c241a72a68c425d0983b4b819e480817f4871e/src/store/machine/connector/RestConnector.js
Do you need to store a sessionkey? when does it refresh? do you need to send it in the header?
could that be the reason you are getting a CORS message?
@chrishamm could you please shine some line on the required communication logic for the Duet websocket to reconnect after reset? How is this solved on the DWC?
(or does it not trigger CORS because it's the same host?)
I already set UseCorse to false in the config file and set M586 C"*" .
What am I missing?
Any help is appreciated.
Thanks @Falcounet
I somehow missed your message.
For now, I worked around it by querying a specific variable using the M409 command, which is not the most elegant way of doing it. I'll give your new solution a go right away.
Thanks for updating it!
Hi,
That's great to hear!
Thank you so much for maintaining this library and finding fixes so fast!
I'm running them as root, as I was running into this error previously:
Traceback (most recent call last):
File "/home/pi/subscribe_object_model.py", line 11, in <module>
from dsf.connections import CommandConnection
File "/home/pi/.local/lib/python3.7/site-packages/dsf/__init__.py", line 2, in <module>
import random_UA
ModuleNotFoundError: No module named 'random_UA'
I realized this issue was a privilege error that would disappear when using sudo.
However, I think I'm introducing the error myself, as I'm coding the script via Remote VS code
and the SSH FS extension
to access the file system, which introduces certain quirks with privileges.
Looking forward to receiving your fix
Thanks again!
I gave it a go, and got the send_simple_code.py to run.
However, upon trying to execute subscribe_object_model.py, I'm getting the following error:
Traceback (most recent call last):
File "/home/pi/subscribe_object_model.py", line 31, in <module>
subscribe()
File "/home/pi/subscribe_object_model.py", line 18, in subscribe
object_model = subscribe_connection.get_object_model()
File "/usr/local/lib/python3.7/dist-packages/dsf/connections/subscribe_connection.py", line 35, in get_object_model
object_model = self.receive(ObjectModel)
File "/usr/local/lib/python3.7/dist-packages/dsf/connections/base_connection.py", line 78, in receive
return cls.from_json(json.loads(json_string))
File "/usr/local/lib/python3.7/dist-packages/dsf/object_model/model_object.py", line 65, in from_json
return cls()._update_from_json(**preserve_builtin(data))
File "/usr/local/lib/python3.7/dist-packages/dsf/object_model/object_model.py", line 164, in _update_from_json
self._move = Move.from_json(kwargs.get('move'))
File "/usr/local/lib/python3.7/dist-packages/dsf/object_model/model_object.py", line 65, in from_json
return cls()._update_from_json(**preserve_builtin(data))
File "/usr/local/lib/python3.7/dist-packages/dsf/object_model/move/move.py", line 186, in _update_from_json
self._extruders = [Extruder.from_json(e) for e in kwargs.get('extruders', [])]
File "/usr/local/lib/python3.7/dist-packages/dsf/object_model/move/move.py", line 186, in <listcomp>
self._extruders = [Extruder.from_json(e) for e in kwargs.get('extruders', [])]
File "/usr/local/lib/python3.7/dist-packages/dsf/object_model/model_object.py", line 65, in from_json
return cls()._update_from_json(**preserve_builtin(data))
File "/usr/local/lib/python3.7/dist-packages/dsf/object_model/move/extruder.py", line 174, in _update_from_json
self._driver = DriverId(**preserve_builtin(driver)) if driver is not None else None
File "/usr/local/lib/python3.7/dist-packages/dsf/utils.py", line 48, in preserve_builtin
return {f"{k}_" if k in reserved_keys else k: v for k, v in data.items()}
AttributeError: 'str' object has no attribute 'items'
was that the error you referred to, @Falcounet , or is this a dfferent error, @Falcounet ?
Steps to reproduce:
pip3 install dsf-python
sudo /usr/bin/python3.7 /home/pi/subscribe_object_model.py
Thanks @chrishamm, appreciate your reply. Super useful, as always!
@Falcounet thanks, looking forward to hearing from you.
I'll give this a go in the next week and will reply back!
Hi community,
I'm looking to log data from a sensor that is connected to a duet board into a file and time-stamp it.
Upon processing that data, the program should adjust printing parameters mid-print.
My aim is to get everything done via dsf-python.
I found this example for how to subscribe to the objetc model: https://github.com/Duet3D/dsf-python/blob/main/examples/subscribe_object_model.py
Pointers into any direction are greatly appreciated.
Thank you!
This is the current firmware that's on the device:
Board: Duet 3 MB6HC (MB6HC)
DSF Version: 3.1.1
Firmware: RepRapFirmware for Duet 3 MB6HC 3.1.1 (2020-05-19b2)
I understand there are updates available, however we're aiming to keep this device at that firmware for compatibility with a deployed device
Any ideas?
Hi,
I'm using the Duet3 in an SBC config.
I'm trying to set the time/date, via the M905 command.
when querying the printer about the time/date straight afterwards, it still thinks it's in 2020.
Any ideas on how to solve this?
I see, thank you very much for the insights!
Hi,
I'm looking for a way to delete declared tools (and fans, heaters, thermistors,...).
Sceanrio: I have declared 2 tools, but want to replace them with new toolheads.
Solution:
Right now, i can only do this by resetting the machine. Is there a gcode that I'm missing to delete/undeclare tools, fans heaters, thermistors etc? or is a soft reset the only way to do so?