Intercepting Messages from DSF/DCS with dsf-python
-
Probably one for @Falcounet or @chrishamm ?
How would I go about intercepting messages generated by DSF/DCS with the dsf-python bindings? I have looked at the DWC source on GitHub to try and figure out how it was doing it, but a lot of the coding is beyond me (hence why I am using python!) I just need a slight nudge in the right direction.
https://github.com/Duet3D/DuetWebControl6HC
Pi5 in SBC Mode
CNC Mode
Custom python app controlling the system
DWC running to provide status and monitoring but system will run if DWC is stopped (if there is contention between my app and DWC for intercepting the messages)I am trying to capture the messages from DSF/DCS like DWC's Console:
And things like syntax errors, echo strings from meta code, etc. Basically, I want to create my own "Console" within my app so I don't have to use DWC concurrently with my app.
I assume I would create a signal with a dsf-python function that gets raised when a message is sent from DSF/DCS, then have a function to parse the message when triggered?
Or connect via HTTP with:
GET /rr_connect
and the messages will stream through that as they occur until I:
GET /rr_disconnect ?If able to provide one, a simple code snippet will suffice to get my marbles rolling.
-
@davidjryan there is a perfect example in the dsf python-bindings:
examples -> custom_m_codes.py(Sry, don't have the reputation (!) to post links in this forum)