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

    Micropython support?

    Scheduled Pinned Locked Moved
    Firmware wishlist
    3
    4
    679
    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.
    • pixelpieperundefined
      pixelpieper
      last edited by pixelpieper

      Hi there,

      I am aware of plans to add conditionals and variables to the gcode interpreter, but, just to throw in an other idea:

      Instead of inventing a new turing complete language, what about adding micropython support instead? There is a rich library of existing code and it would lower the bar for newcommers to implement complex functions.

      Gcode could tightly interact with python code by adding the ability to call python functions via custom codes and there could be an API which allows python code to issue gcode to be executed. Additional APIs could allow for simple GPIO access (Polling?) and maybe even access to peripherals as SPI. One could even allow to override gcode, i.e. a custom complex python bed leveling procedure could replace the standard implementation of G29. Finally, if network access is enabled users could use python hooks to integrate a single printer into a large print farm, notifying a server about finished prints, missing filament, critical errors, ...

      Best,
      Christoph

      Voron V2.434 / Duet 3 Mini5+, Duet 3 Expansion Mini 2+, Duet 1LC V1.1 Toolboard
      Voron V0.250 / Duet 2 Maestro

      1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators
        last edited by

        We are already considering something similar for Duet 3. However, Python and similar garbage-collected languages are fundamentally incompatible with real-time systems operating with limited memory, so not possible on Duet 2.

        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

        pixelpieperundefined 1 Reply Last reply Reply Quote 0
        • fmaundefined
          fma
          last edited by

          I like Python, and use it at home and at work for more than 15 years, but I'm not sure it is the best solution, here.

          Maybe Lua would be a better option (http://www.eluaproject.net?)

          Frédéric

          1 Reply Last reply Reply Quote 0
          • pixelpieperundefined
            pixelpieper @dc42
            last edited by

            @dc42 I understand that there are limitations, but I would have assumed that it would be possible to run the interpreter as an rtos tasked with a fixedly preassigned memory budget, enforced by the mpu of the cortex m4. The micropython web page lists a minimum of 8kB of ram, I don’t know however how much pressure there is on the 128 kB available.

            Voron V2.434 / Duet 3 Mini5+, Duet 3 Expansion Mini 2+, Duet 1LC V1.1 Toolboard
            Voron V0.250 / Duet 2 Maestro

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