Send machine position into a http request ?
-
Hi all,
Extremely satisfied with my last project involving a duet 2 (my custom machine is working flawlessly for 2 two years), i've moved into a more sophisticated project.The goal of the project is to give medical student a "radiology simulator" ; moving a fake radiology device that will display them a picture corresponding to the position of the device they'll chose.
I need to move 7 axes with physical buttons (no problem with M581 command i guess)
but then i need to press another button that will triggers the following events :
- get the machine coordinates ( for example X5 Y-5 Z10 U12.5 etc.) --> M408 command ?
- open an URL containing those coordinates (send an http request containing those coordinates to a raspberry or computer connected by RJ45 or USB)
I've access to a Duet 3 Mainboard 6HC, Raspberry pi 4 and / or windows 10 computer if needed.
Thanks for your help
-
@boulet_frites the M408 command is deprecated now in favour of the object model. To retrieve the current coordinates, I suggest you use one (or more if necessary) the rr_model http call(s) to retrieve the parts of the model that you need. The rr_model http call works in the same way as the M409 command.
-
@boulet_frites It might be worth considering using DSF on SBC as I do not think it is normally possible to trigger a custom http post/get (your button 8 ) from the standard RRF firmware on a standalone control board (I may be wrong). If you use a board+DSF config you can create new customisations not possible on a standalone board. Have a look into DSF and the DSF API. This approach would require the pi and duet board to be co-located.
Another alternative possibility :
The final HTTP button could be connected to a rpi's gpio, which once toggled would cause the rpi to pull the co-ordinates from the duet board, and then trigger the action required.
If your looking for a low/no code way of testing this you can use node-red on the pi with my NodeDSF nodes to connect to the duet board over http to pull the information.I'm not sure how many physical buttons the rpi's gpio can support, but if it can do 8 then your 7 axes buttons could also be setup to send the M581 commands using the same software. Your control board with 8 buttons could then be "wireless" to the control board, only requiring power to the pi to work (assuming wifi connectivity).
A third way with this software would be to have all 8 buttons on the control board then send a M118 msg on button 8 toggle, which contains the co-ords info you need and watch for this msg on the pi, extract the contents and trigger your event.
-
Hi,
Thank you for your very interesting ideas; i'll try it ASAP.
I'm always astonished how much things this board can do !