• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Send machine position into a http request ?

Scheduled Pinned Locked Moved
General Discussion
3
4
208
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    Boulet_Frites
    last edited by 22 Apr 2022, 10:04

    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 🙂

    undefined undefined 2 Replies Last reply 22 Apr 2022, 13:27 Reply Quote 0
    • undefined
      dc42 administrators @Boulet_Frites
      last edited by 22 Apr 2022, 13:27

      @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.

      Duet WiFi hardware designer and firmware engineer
      Please do not ask me for Duet support via PM or email, use the forum
      http://www.escher3d.com, https://miscsolutions.wordpress.com

      1 Reply Last reply Reply Quote 0
      • undefined
        MintyTrebor @Boulet_Frites
        last edited by MintyTrebor 22 Apr 2022, 13:50

        @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.

        NodeDSF - Native Node-Red integration with Duet boards.
        BtnCmd - Customise DWC with user defined buttons/layouts/panels (DWC Plugin)
        ReleaseMgr - Duet update info inside DWC.
        Repo

        1 Reply Last reply Reply Quote 0
        • undefined
          Boulet_Frites
          last edited by 22 Apr 2022, 15:25

          Hi,

          Thank you for your very interesting ideas; i'll try it ASAP.

          I'm always astonished how much things this board can do !

          1 Reply Last reply Reply Quote 0
          4 out of 4
          • First post
            4/4
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA