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

    How To write a plugin for DWC

    Scheduled Pinned Locked Moved
    Plugins for DWC and DSF
    3
    12
    1.1k
    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.
    • resamundefined
      resam
      last edited by

      Here is my plugin for a filament weight load cell: https://github.com/Kriechi/duet-plugin-filament-load-cell
      It has a DWC plugin as well as a small Python plugin for DSF running on the SBC.

      1 Reply Last reply Reply Quote 0
      • jrentschler01undefined
        jrentschler01
        last edited by

        Thank you guys, I already got the envirement setup and it looks doable.

        Jürgen

        1 Reply Last reply Reply Quote 0
        • jrentschler01undefined
          jrentschler01
          last edited by

          I'm able to build and run the DWC but I'm not able to connect to the Board I always get:

          Failed to connect to 192.168.1.2:8080
          Network error

          Is there a password needed? Is the port 8080 correct?
          5778a4ad-c2d1-4d2d-95eb-c5b699bbbac6-image.png

          The onboard DWC with 192.168.1.2 works normal.
          I added also the M586 C"*" to my config.

          Jürgen

          MintyTreborundefined 1 Reply Last reply Reply Quote 0
          • MintyTreborundefined
            MintyTrebor @jrentschler01
            last edited by

            @jrentschler01 I don't think you need to specify the port. Just the IP. Its always worked for me that way.

            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

            jrentschler01undefined 1 Reply Last reply Reply Quote 0
            • jrentschler01undefined
              jrentschler01 @MintyTrebor
              last edited by

              @mintytrebor Omg so simple sure it works. I don't know why I didn't try this. Thank you

              Jürgen

              1 Reply Last reply Reply Quote 0
              • jrentschler01undefined
                jrentschler01
                last edited by

                @MintyTrebor I looked also in your plugin and I see you use some dependencies they are not installed in DWC but where did you tell webpack to pack them into your plugin?

                I see you have plugin.json in your /dist folder with a webpack config but I'm not sure where to put this in the DWC that it will be used for the build process?

                and did you install your libraries that you use normally with npm into DWC to deveolpe and build it?

                Jürgen

                MintyTreborundefined 1 Reply Last reply Reply Quote 0
                • MintyTreborundefined
                  MintyTrebor @jrentschler01
                  last edited by

                  @jrentschler01 install plugins using the cmd line :

                  npm install <package name>
                  

                  in the main folder you unpacked the dwc source.zip.

                  Include the package name in the plugin.json like mine.

                  The packages will auto include in the build/serve process, you can then just reference them in your plugin code as normal - eg

                  import <function> from '<packagename>';
                  

                  The package.json tells dwc to install the additional libraries from internet when the plugin is installed by a normal user. (This is why I tell users to ensure they have an internet connection when installing the plugin in my wiki)

                  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

                  jrentschler01undefined 1 Reply Last reply Reply Quote 0
                  • jrentschler01undefined
                    jrentschler01 @MintyTrebor
                    last edited by

                    @mintytrebor said in How To write a plugin for DWC:

                    (This is why I tell users to ensure they have an internet connection when installing the plugin in my wiki)

                    Ahh okay, that is what I missed! Now I got it how it works. But do you see a way that we can tell webpack to bundle this packages into the plugin files? So that it works without an internet connetion?

                    But this is not critical now for me just would be a nice to have 😉

                    And Thanks for your fast response!

                    Jürgen

                    MintyTreborundefined 1 Reply Last reply Reply Quote 0
                    • MintyTreborundefined
                      MintyTrebor @jrentschler01
                      last edited by MintyTrebor

                      @jrentschler01 said in How To write a plugin for DWC:

                      But do you see a way that we can tell webpack to bundle this packages into the plugin files? So that it works without an internet connetion?

                      Don't know. I just know that this is the way it works for me😊 .

                      It is possible it may already include the library in the build, and just uses the package.json for tracking. Easiest way is to try installing the plugin when you have disabled the internet.

                      There may be an alternative, but I doubt it, as you would effectively be distributing someone else's code/library which probably breaks all sorts of licenses, plus it would be difficult for the author of the library to track downloads etc.

                      Update : Also worth remembering that the libraries you include may themselves use other libraries, so you could be dealing with nested dependencies - it's probably best just sticking to the normal processes.

                      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

                      jrentschler01undefined 1 Reply Last reply Reply Quote 0
                      • jrentschler01undefined
                        jrentschler01 @MintyTrebor
                        last edited by

                        @mintytrebor yes you right, lts just stick with the normal way. And nowdays everthing is connected to the internet even my refrigerator (which a sbit concerning by the way) so it should be fine for the duet, too 😉

                        Jürgen

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