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

    Duet Buddy - a proof of concept remote monitor

    Scheduled Pinned Locked Moved
    General Discussion
    19
    85
    8.0k
    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.
    • hayseed_byteundefined
      hayseed_byte @zapta
      last edited by

      Very cool project!

      Is there a way to do something similar but display the status of multiple printers on a computer monitor? Maybe with the use of a raspberry pi? I have nine printers that I'd like to monitor from another room but I don't want to buy nine of those. 😄

      https://wildbot.me/wildbot
      Gcode Definitions for VSCode extension: https://github.com/hayseedbyte/rrf-gcode-definitions

      Phaedruxundefined 1 Reply Last reply Reply Quote 0
      • Phaedruxundefined
        Phaedrux Moderator @hayseed_byte
        last edited by

        @hayseed_byte Perhaps something like this?
        https://github.com/DanalEstes/MultiDuetWebMonitor

        Z-Bot CoreXY Build | Thingiverse Profile

        hayseed_byteundefined 1 Reply Last reply Reply Quote 1
        • hayseed_byteundefined
          hayseed_byte @Phaedrux
          last edited by

          @Phaedrux That's perfect. Thanks! Don't know how I haven't come across that.

          https://wildbot.me/wildbot
          Gcode Definitions for VSCode extension: https://github.com/hayseedbyte/rrf-gcode-definitions

          1 Reply Last reply Reply Quote 0
          • Danalundefined
            Danal
            last edited by

            I've never tried it, but that should run just fine in a Pi browser. Let me know if it does not.

            PM here, or danal (dot) estes (at) gmail (dot) com

            Delta / Kossel printer fanatic

            1 Reply Last reply Reply Quote 0
            • richardmckennaundefined
              richardmckenna
              last edited by

              @zapta any chance you could move the duet buddy code to its own repo? It would make it easier to fork without pulling all your other misc stuff as well 🙂

              1 Reply Last reply Reply Quote 0
              • richardmckennaundefined
                richardmckenna
                last edited by

                I did something!

                IMG_20200214_075451.jpg

                I added a battery level indicator and the printer name. Strangely the M5Stack API only returns the battery level in increments of 25, not sure if there is a way to get round this by skipping the M5Stack API method and going straight to requesting it from the I2C. Will have to look into it more, but from what I can discern from the basic docs and the Chinese datasheet for the IP5306 it only returns 1 of 4 values depending on the voltage range.

                This is the current method in the API:

                // Return percentage * 100
                int8_t POWER::getBatteryLevel() {
                  uint8_t data;
                  if (M5.I2C.readByte(IP5306_ADDR, IP5306_REG_READ3, &data) == true) {
                    switch (data & 0xF0) {
                      case 0x00:
                        return 100;
                      case 0x80:
                        return 75;
                      case 0xC0:
                        return 50;
                      case 0xE0:
                        return 25;
                      default:
                        return 0;
                    }
                  }
                  return -1;
                }
                

                I also don't quite know what is happening with the switch statement and data & 0xF0but that's just my lack of C++ knowledge and IC programming. So if someone can educate me that would be great 😉

                I'm going to try adding the charging status as well for when it is plugged in and maybe tweak the layout a bit, then if someone can test it, I'll create a pull request to Zapta's original 🙂

                zaptaundefined 1 Reply Last reply Reply Quote 0
                • zaptaundefined
                  zapta @richardmckenna
                  last edited by zapta

                  @richardmckenna, very nice!

                  The IP5306 seems to have only 25% increments for the LEDs and possibly the IP5306_I2C has the same resolution but with I2C interface instead of LEDs. Hard to find information about the IP5306_I2C.

                  M5Stack Schematic
                  http://community.m5stack.com/assets/uploads/files/1515402963959-97994060-2969-49dc-ad9c-7b3887d95a17-image.png

                  IP5306 (non I2C) Datasheet
                  https://datasheet.lcsc.com/szlcsc/1809201029_INJOINIC-IP5306_C181692.pdf

                  The expression (data & 0xF0) returns the 8 bit value of 'data' with the four right bits forces to '0'.

                  BTW, the two temperature fields in your picture seems to have extra characters. Is it intentional?

                  richardmckennaundefined 1 Reply Last reply Reply Quote 0
                  • richardmckennaundefined
                    richardmckenna @zapta
                    last edited by

                    @zapta said in Duet Buddy - a proof of concept remote monitor:

                    @richardmckenna, very nice!

                    The IP5306 seems to have only 25% increments for the LEDs and possibly the IP5306_I2C has the same resolution but with I2C interface instead of LEDs. Hard to find information about the IP5306_I2C.

                    Yeah that is all I could find. Oh well 25% increments are better than nothing. I’ve added a charging status now as well so when it is plugged in it shows “Charging” and when full “Charged”.

                    BTW, the two temperature fields in your picture seems to have extra characters. Is it intentional?

                    That was me trying to find the degrees symbol only to discover it doesn’t exist in the included font. It seems to be standard ASCII with only some of the extended ASCII characters. I’ve given up on that and removed them.

                    zaptaundefined 1 Reply Last reply Reply Quote 0
                    • zaptaundefined
                      zapta @richardmckenna
                      last edited by

                      @richardmckenna, how did you implement the 'Kossel Max' title? Is it hard coded in your arduino code? One option is to add a title field to the config file on the SD card.

                      Or, anybody knows if it's possible to query the printer name from the printer using a HTTP request?

                      richardmckennaundefined 2 Replies Last reply Reply Quote 0
                      • richardmckennaundefined
                        richardmckenna @zapta
                        last edited by

                        @zapta I added an extra field to the json file and parsed it like the others. Didn’t even think about pulling from the duet, I will explore that possibility.

                        The reason behind me wanting the name displayed was that I’m thinking about the best way of adding multiple machines to it. So having an array of machine objects defined in the json. Then you can navigate between the different machines with the left and right buttons.

                        zaptaundefined 1 Reply Last reply Reply Quote 0
                        • richardmckennaundefined
                          richardmckenna @zapta
                          last edited by

                          @zapta The printer name is available through /rr_status?type=2 so should be easy enough to do an initial call to that to get the name and other info about the printer.

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

                            In the forthcoming RRF 3.01-RC2 it's also available via M409 K"network.name".

                            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

                            zaptaundefined 1 Reply Last reply Reply Quote 1
                            • zaptaundefined
                              zapta @richardmckenna
                              last edited by

                              @richardmckenna, if type=2 has also the other relevant information we can just switch to it instead of type=3.

                              Does it require changes in the duet response json parser?

                              richardmckennaundefined 1 Reply Last reply Reply Quote 0
                              • zaptaundefined
                                zapta @dc42
                                last edited by

                                @dc42 said in Duet Buddy - a proof of concept remote monitor:

                                In the forthcoming RRF 3.01-RC2 it's also available via M409 K"network.name".

                                Thanks for the info. This require posting gcode to the duet, right? What is a reasonable and simple way of doing it?

                                Once we figure this out it will be useful for other functionality such as pressure-advance up/down buttons for interactive experimentation.

                                1 Reply Last reply Reply Quote 0
                                • richardmckennaundefined
                                  richardmckenna @zapta
                                  last edited by

                                  @zapta type 1,2 and 3 all seem to share some information but unfortunately not all the bits we are are looking at.

                                  status-type-1.json
                                  status-type-2.json
                                  status-type-3.json

                                  So I think it would need a single call to 2, to get the name and repeated calls to 3 as it currently does.

                                  the duet parser will need tweaking as it only looks for:

                                  char state_char;
                                  float progress_percents;
                                  float z_height;
                                  float temp1;
                                  float temp2;
                                  

                                  But that's straight forward. And if the JSON config file is changed just to have the IP, the rest of the URL can be provided by the code depending on which call it is doing.

                                  I will continue to have a play with it, see what I can do.

                                  You can see my updated battery code in my fork here https://github.com/richard-mckenna/misc/tree/master/duet3d_buddy/arduino

                                  Would you be able to separate Duet Buddy into it's own git repo?

                                  1 Reply Last reply Reply Quote 0
                                  • zaptaundefined
                                    zapta
                                    last edited by

                                    Hi Richard, I create a separate duet_buddy repository here https://github.com/zapta/duet_buddy

                                    If you will send me your github id I can add you as a contributor.

                                    richardmckennaundefined 1 Reply Last reply Reply Quote 1
                                    • richardmckennaundefined
                                      richardmckenna @zapta
                                      last edited by

                                      @zapta excellent thanks. GitHub id is just "richard-mckenna".

                                      zaptaundefined 1 Reply Last reply Reply Quote 0
                                      • zaptaundefined
                                        zapta @richardmckenna
                                        last edited by zapta

                                        @richardmckenna, sent you an invite via github.

                                        Please feel free to touch anything, including the project page and documentation files.

                                        1 Reply Last reply Reply Quote 1
                                        • DK90undefined
                                          DK90
                                          last edited by

                                          This post is deleted!
                                          1 Reply Last reply Reply Quote 0
                                          • PastThePointundefined
                                            PastThePoint
                                            last edited by

                                            I know I am late to the party, but did this ever get figured out for the Duet 3's? Mine just keeps saying "Bad response from duet"??

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