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

PanelDue Image Display

Scheduled Pinned Locked Moved
PanelDue
4
14
1.3k
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
    MartinNYHC
    last edited by 25 Aug 2020, 06:45

    I plan to use a tablet to control my printer but since I have a PanelDue lying around, I would like to convert the current printed GCODE to an image on the SBC and display it. So I'm wondering if it is possible to display an image on the PanelDue.

    Thanks, Martin

    1 Reply Last reply Reply Quote 0
    • undefined
      dc42 administrators
      last edited by 25 Aug 2020, 06:58

      In principle yes, but the current firmware does not support receiving an image. The image would need to be no bigger than about 64kb so that it could be stored in PanelDue RAM.

      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
        MartinNYHC
        last edited by 25 Aug 2020, 13:42

        Thanks. Let's see...perhaps I'll swap it against a small RPI display.

        Currently there are more important things to do. Just disassembled the whole printer, because I want to rebuild the frame with blind joints and next week I'll get all metal CNC parts to get rid of the printed stuff 😉

        1 Reply Last reply Reply Quote 0
        • undefined
          bot
          last edited by 25 Aug 2020, 14:58

          @dc42, have you seen the way Prusa encodes thumbnails for their mini printer? PrusaSlicer can generate a thumbnail and include it in the gcode, like so:

          ; thumbnail begin 220x124 3228
          ; iVBORw0KGgoAAAANSUhEUgAAANwAAAB8CAYAAAACRt5vAAAJPElEQVR4Ae2d2ZoTVRSF60FsWiFewP
          ; dxi4iI2iL3voIiIorzPADP5ouFTneHLkINZ9jD2uesi32TpM5ZWbX+pFKpU3vYbDbXD+vGjRsn+5p6
          ; XqKk57DQHFU3vcbxeljbSEOcxviHY0bVTc16+xLB68FaHAM2P/7/T25vNYpe4+R6sBKobaTWXFq6te
          ; BKrZ681pwrd5xBY1BPI6Xm1Tis8YZMC75aryLmo3T7oXTwlAk0QmthiqRmVMg04PP2WkKzdq6Tgcs1
          ; yNvIEoMkPyAiQSYJnofXGhmpfd1cZQOXYhaSkam6CJoueBpee+ajVHcRcEsiEI1cM1VCdySIrMDT8t
          ; o6I5Kaq4Abi7t58+bn6EYe6t5pHusuGScSNJ7gRcyHhm4CVwFcJFA8oWslH+7AtXBIeWhoiu5IcHiC
          ; t5YPHlJWCEp5Ds3I1OcIWz50El5750Mj1138LZCqZ+01kUDwhE7Ca8R8SOjOAi53MgRTSzRMbRMJAC
          ; /opLxGz0iNZl7albBtpOB7loTXUfJRun0XFy+XzkfYyqDz3GfWecwdJ3l5joQBFqZKjh8p6EiFsv8Q
          ; c80FqIQNHjqtjEiMmTv+YC1KYx5pzZGC3Sp06BkpnWewFiRthIbuSKFuGTjUfNTMO3iKqjFFS3OkQP
          ; cCHVpGajQP3qLmxC1pIWyELicfSLkevAXlmKptZKQQ9whcSgZQQJvTPSCJWjLVwshIIe4VOO+M1Goe
          ; NpvNddTaG2extCNSgAmdfT6kCh44iUWiBK5N4MYZIXACRlodLkQKLqGzz4cocOgnTcbaeHaSwC3lAB
          ; m8N85SIohLMUvD1Eih7Rm41H2PBt3k3wLeAnM1SGqOFNpegfPMh5Tm185SegmsmVdKc6TQ9ggcQkak
          ; NA+e4qTmqx0nUmh7Ag4lH5LzQSzPkZijZrxIoe0FOO18WOR66jVN9YcrNTVSaFsHThsM71wPVm/e4h
          ; Om1NRIoW0ZOK98WOa62ZsI5RgRKbQtAmf5Yeyd6+L+cFZvysLUSKFtDbgI+ZDcrsv+cAQOA7hIGZHS
          ; LHKrc2lR1qZGCm0LwEXLh6Tu4ouXp467vY7Fa0199tkmVHAj1te3j4rvzuyZD+lcd9muaqx5VwTOBj
          ; h02CxyLbI8R6OPloWhBM4PuEj5kNTcXX+4Q9174J4TOrV6/P6VUN9wmrkW+w239jiikfvHCZwNcJEz
          ; 4vYbLpV4NFOX9OyBe/GA0GnAdghctHzkZl8MuNzJEExNMWkM3IsH74YKdATYpoBL3TcosNW8Phu4Gm
          ; M8TU2dl8D5AJe7n7TzYZHrJvvD5c53CByhq69vRrCtAYeeD8lxBsnBrN6k9BxTwPH3XB1sucChZ0Rq
          ; vGb6w9WMS+BwgEPMh+T4TfaHyx1vDrjnhK4YthrgJPYpaq4HrTdoZaqE5iXg+P9cej0ewVYLnNT+Rc
          ; t1M/3hanSvAUfo0mDTAK5mXyPmmv3hEoF7dlGRILAETRO43P3u8a2WqiVUf7iU57WB++8+oZuDTRs4
          ; r3xI6g7RH27uManKBY7Q7a7+v+ICnFdGpDSzP1whcP/ev7b959NroSCRAe3oDDZv4CzzIVnsD1cJXE
          ; /QncOGA9yuoq3FDNEf7tBQhEPKMXB/n9ZfJ+2C9+gUlkevYMMAburESATo4E6aTJm59jgKcH+eXD2r
          ; SDAt1VfvHZ0VGnDW+ZDUHL4/nMS80sD98cnV7e+n9dvH8eB7eOto+/ACNETgvDIipRn2fzjp13sBty
          ; 900L689dZZoQLnmQ9J3XD94XLmltJsAdxlvXNW3oDtQNqBtYPsiwvYUIGTyodnrvePh+8PJ2GqB3D7
          ; +nVXH+kDeB768+Dv4IkAnBQwSLleXS2gIVBjjprxEIAb1y+j+vneea0B9fTu8fbpB8fb7y7q2zvH2y
          ; d3ToN/5zL8kYDTzodXrpvuD9cScD/de/usfvzwsn44re/v7uq4KeAQMyI1bnMrvkvmIXAYwKHmQ3K8
          ; bvrDEThs4NAzIrV90/3hUo/bCZwfcKn7CA260u2q7ku5NJG3kTnmEDgf4FDzoZnrbvrDLRlF4GyBQ/
          ; owts51V70F5vQRODvgIuZDUnfX/eH2ugmcDXDosFnkWqU/nJUptYaO+8MROFvgImQEuj+c9po1adj4
          ; DcdvOI9cd90fjr/h/H/DoWdk7XET4HLP5iCYuqSHwNn/LYCej5RcqwOXOyGKqWs6CBz/h7PKdVdXms
          ; y9jsD5XtoVISNS22X3hys1xNrUnPkIXH/XUmpkOmWc5vvDpcxD4DBXC1hlxHK8pP5wkm/ccuzU7Qhc
          ; H+vhEHLdRH+42vEIXH8rvmvHK52nuXualIxB4HBvIoSSEan5wvaHk9RN4Pq4a1fp/JK6Q96XUvpYnM
          ; BhA1eyz1FzDX3n5SlNGkYSOHzgUve/9IextOaw/eEkdRO4OMAtZQENtCndIbvnSM9F4GIBd5iRSCtV
          ; oPvD7SpCfzgC5wOcVT66AI7fcAQuJyNhvuGi/IZbepzA9f0bTjsfkrp5lpLA8SylYa75PxyB4/9whr
          ; keNAKsCZvEdgSOV5pYZ3o/P6+lJHC8ltIw11wtcFEEThe46PmQmse9P5zm2AQuJnAtZ48rvkdF4HSA
          ; s9h3njnMGc/kniZWRtaaSuD8gPPOh1Wu2R+OwLkC5/Fh7Jlr3pfyDegInCRwreWjVne3/eGWXkPgZI
          ; BL8TpSRiQ0sz/cxGMETha4Ja8j5ENSN7vnzKxEIHB1wM0FNXo+anV32x9ur3lJN4ErA24tH9EyIqlZ
          ; rQNq9G+4V9ARuCzglrxuMR9mwGkf61qYmfq7gsClASfhNWI+JHXzLGXiawjcMnCSXqNmREJz1f9wa5
          ; OimCqlmcBNA6fhdZR85OrmlSaZ2xG414HT9BoNNontBs3BPU2VmG8JOgI3D5vX/rLOZMn2za0WkJ5n
          ; aaxegfPwGjUfueO5r4eTGtdr7N6Aa3U/Wo27uuJb65Mm4rfn0hytA4fkdZR8TM3T3D1NtHWvzdcacM
          ; heW+ZMaj73u3bVzO2lOWXu6MBF8lojW1q5DnlfypLXW5o6rmjAlbxH5iNdB/Sdl0tfg6obFbgWvUbN
          ; NXsLOGn2Bq4nr5F0h+yeg2jm3E7P0awFXI3XEX1G1g3dH24fgKhr7SIEgF7bFnxDxsNPXXS9UTXTa5
          ; t6CT7Sg5eV9vIgAAAAAElFTkSuQmCC
          ; thumbnail end
          

          That equates to about 4 KB if I'm not mistaken, at 220x124 resolution.

          *not actually a robot

          1 Reply Last reply Reply Quote 0
          • undefined
            dc42 administrators
            last edited by 25 Aug 2020, 15:12

            @bot, that would be entirely doable.

            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
              bot
              last edited by 25 Aug 2020, 15:16

              Cool! The PrusaSlicer fork SuperSlicer has added the functionality to put the thumbnail on non-mini printer profiles. Perhaps a different resolution is possible, as well. We could check the PrusaSlicer/SuperSlicer source.

              If another resolution is possible, what would be ideal for the paneldue? I guess we should ensure the smallest paneldues can see the thumbnails. This could be included into the "RepRapFirmware" G-Code flavour that is seemingly soon to be added to PrusaSlicer.

              Perhaps DWC could grab these tumbnails, too.

              *not actually a robot

              1 Reply Last reply Reply Quote 0
              • undefined
                MartinNYHC
                last edited by 25 Aug 2020, 15:19

                Very nice. +1 😉

                1 Reply Last reply Reply Quote 0
                • undefined
                  dc42 administrators
                  last edited by 25 Aug 2020, 16:31

                  Do you have a link to the specification for the image encoding?

                  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
                    bot
                    last edited by bot 25 Aug 2020, 16:46

                    I do not think any public documentation of this exists, but here is the first most obvious reference to it that I can find in the source:

                    Prusa3D/PrusaSlicer/src/libslic3r/GCode.cpp#L981

                    	static void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb, const std::vector<Vec2d> &sizes, WriteToOutput output, ThrowIfCanceledCallback throw_if_canceled)
                    	{
                    	    // Write thumbnails using base64 encoding
                    	    if (thumbnail_cb != nullptr)
                    	    {
                    	        const size_t max_row_length = 78;
                    	        ThumbnailsList thumbnails;
                    	        thumbnail_cb(thumbnails, sizes, true, true, true, true);
                    	        for (const ThumbnailData& data : thumbnails)
                    	        {
                    	            if (data.is_valid())
                    	            {
                    	                size_t png_size = 0;
                    	                void* png_data = tdefl_write_image_to_png_file_in_memory_ex((const void*)data.pixels.data(), data.width, data.height, 4, &png_size, MZ_DEFAULT_LEVEL, 1);
                    	                if (png_data != nullptr)
                    	                {
                    	                    std::string encoded;
                    	                    encoded.resize(boost::beast::detail::base64::encoded_size(png_size));
                    	                    encoded.resize(boost::beast::detail::base64::encode((void*)&encoded[0], (const void*)png_data, png_size));
                    
                    	                    output((boost::format("\n;\n; thumbnail begin %dx%d %d\n") % data.width % data.height % encoded.size()).str().c_str());
                    
                    	                    unsigned int row_count = 0;
                    	                    while (encoded.size() > max_row_length)
                    	                    {
                    	                        output((boost::format("; %s\n") % encoded.substr(0, max_row_length)).str().c_str());
                    	                        encoded = encoded.substr(max_row_length);
                    	                        ++row_count;
                    	                    }
                    
                    	                    if (encoded.size() > 0)
                    	                    	output((boost::format("; %s\n") % encoded).str().c_str());
                    
                    	                    output("; thumbnail end\n;\n");
                    
                    	                    mz_free(png_data);
                    	                }
                    	            }
                    	            throw_if_canceled();
                    	        }
                    	    }
                    	}
                    

                    So the thumbnail seems to be encoded in 'base64' by the boost library. The start of the thumbnail says ; thumbnail begin followed by the pixel resolution and the encoded size. I suppose it's an encoding of a PNG file of some format.

                    *not actually a robot

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      bot
                      last edited by bot 26 Aug 2020, 00:05

                      @dc42 I found this website which can directly decode the image that I posted above, which was merely an example I found on the internet from someone's publicly posted gcode.

                      https://base64.guru/converter/decode/image/png

                      Encoded PNG with added information removed:

                      iVBORw0KGgoAAAANSUhEUgAAANwAAAB8CAYAAAACRt5vAAAJPElEQVR4Ae2d2ZoTVRSF60FsWiFewP
                      dxi4iI2iL3voIiIorzPADP5ouFTneHLkINZ9jD2uesi32TpM5ZWbX+pFKpU3vYbDbXD+vGjRsn+5p6
                      XqKk57DQHFU3vcbxeljbSEOcxviHY0bVTc16+xLB68FaHAM2P/7/T25vNYpe4+R6sBKobaTWXFq6te
                      BKrZ681pwrd5xBY1BPI6Xm1Tis8YZMC75aryLmo3T7oXTwlAk0QmthiqRmVMg04PP2WkKzdq6Tgcs1
                      yNvIEoMkPyAiQSYJnofXGhmpfd1cZQOXYhaSkam6CJoueBpee+ajVHcRcEsiEI1cM1VCdySIrMDT8t
                      o6I5Kaq4Abi7t58+bn6EYe6t5pHusuGScSNJ7gRcyHhm4CVwFcJFA8oWslH+7AtXBIeWhoiu5IcHiC
                      t5YPHlJWCEp5Ds3I1OcIWz50El5750Mj1138LZCqZ+01kUDwhE7Ca8R8SOjOAi53MgRTSzRMbRMJAC
                      /opLxGz0iNZl7albBtpOB7loTXUfJRun0XFy+XzkfYyqDz3GfWecwdJ3l5joQBFqZKjh8p6EiFsv8Q
                      c80FqIQNHjqtjEiMmTv+YC1KYx5pzZGC3Sp06BkpnWewFiRthIbuSKFuGTjUfNTMO3iKqjFFS3OkQP
                      cCHVpGajQP3qLmxC1pIWyELicfSLkevAXlmKptZKQQ9whcSgZQQJvTPSCJWjLVwshIIe4VOO+M1Goe
                      NpvNddTaG2extCNSgAmdfT6kCh44iUWiBK5N4MYZIXACRlodLkQKLqGzz4cocOgnTcbaeHaSwC3lAB
                      m8N85SIohLMUvD1Eih7Rm41H2PBt3k3wLeAnM1SGqOFNpegfPMh5Tm185SegmsmVdKc6TQ9ggcQkak
                      NA+e4qTmqx0nUmh7Ag4lH5LzQSzPkZijZrxIoe0FOO18WOR66jVN9YcrNTVSaFsHThsM71wPVm/e4h
                      Om1NRIoW0ZOK98WOa62ZsI5RgRKbQtAmf5Yeyd6+L+cFZvysLUSKFtDbgI+ZDcrsv+cAQOA7hIGZHS
                      LHKrc2lR1qZGCm0LwEXLh6Tu4ouXp467vY7Fa0199tkmVHAj1te3j4rvzuyZD+lcd9muaqx5VwTOBj
                      h02CxyLbI8R6OPloWhBM4PuEj5kNTcXX+4Q9174J4TOrV6/P6VUN9wmrkW+w239jiikfvHCZwNcJEz
                      4vYbLpV4NFOX9OyBe/GA0GnAdghctHzkZl8MuNzJEExNMWkM3IsH74YKdATYpoBL3TcosNW8Phu4Gm
                      M8TU2dl8D5AJe7n7TzYZHrJvvD5c53CByhq69vRrCtAYeeD8lxBsnBrN6k9BxTwPH3XB1sucChZ0Rq
                      vGb6w9WMS+BwgEPMh+T4TfaHyx1vDrjnhK4YthrgJPYpaq4HrTdoZaqE5iXg+P9cej0ewVYLnNT+Rc
                      t1M/3hanSvAUfo0mDTAK5mXyPmmv3hEoF7dlGRILAETRO43P3u8a2WqiVUf7iU57WB++8+oZuDTRs4
                      r3xI6g7RH27uManKBY7Q7a7+v+ICnFdGpDSzP1whcP/ev7b959NroSCRAe3oDDZv4CzzIVnsD1cJXE
                      /QncOGA9yuoq3FDNEf7tBQhEPKMXB/n9ZfJ+2C9+gUlkevYMMAburESATo4E6aTJm59jgKcH+eXD2r
                      SDAt1VfvHZ0VGnDW+ZDUHL4/nMS80sD98cnV7e+n9dvH8eB7eOto+/ACNETgvDIipRn2fzjp13sBty
                      900L689dZZoQLnmQ9J3XD94XLmltJsAdxlvXNW3oDtQNqBtYPsiwvYUIGTyodnrvePh+8PJ2GqB3D7
                      +nVXH+kDeB768+Dv4IkAnBQwSLleXS2gIVBjjprxEIAb1y+j+vneea0B9fTu8fbpB8fb7y7q2zvH2y
                      d3ToN/5zL8kYDTzodXrpvuD9cScD/de/usfvzwsn44re/v7uq4KeAQMyI1bnMrvkvmIXAYwKHmQ3K8
                      bvrDEThs4NAzIrV90/3hUo/bCZwfcKn7CA260u2q7ku5NJG3kTnmEDgf4FDzoZnrbvrDLRlF4GyBQ/
                      owts51V70F5vQRODvgIuZDUnfX/eH2ugmcDXDosFnkWqU/nJUptYaO+8MROFvgImQEuj+c9po1adj4
                      DcdvOI9cd90fjr/h/H/DoWdk7XET4HLP5iCYuqSHwNn/LYCej5RcqwOXOyGKqWs6CBz/h7PKdVdXms
                      y9jsD5XtoVISNS22X3hys1xNrUnPkIXH/XUmpkOmWc5vvDpcxD4DBXC1hlxHK8pP5wkm/ccuzU7Qhc
                      H+vhEHLdRH+42vEIXH8rvmvHK52nuXualIxB4HBvIoSSEan5wvaHk9RN4Pq4a1fp/JK6Q96XUvpYnM
                      BhA1eyz1FzDX3n5SlNGkYSOHzgUve/9IextOaw/eEkdRO4OMAtZQENtCndIbvnSM9F4GIBd5iRSCtV
                      oPvD7SpCfzgC5wOcVT66AI7fcAQuJyNhvuGi/IZbepzA9f0bTjsfkrp5lpLA8SylYa75PxyB4/9whr
                      keNAKsCZvEdgSOV5pYZ3o/P6+lJHC8ltIw11wtcFEEThe46PmQmse9P5zm2AQuJnAtZ48rvkdF4HSA
                      s9h3njnMGc/kniZWRtaaSuD8gPPOh1Wu2R+OwLkC5/Fh7Jlr3pfyDegInCRwreWjVne3/eGWXkPgZI
                      BL8TpSRiQ0sz/cxGMETha4Ja8j5ENSN7vnzKxEIHB1wM0FNXo+anV32x9ur3lJN4ErA24tH9EyIqlZ
                      rQNq9G+4V9ARuCzglrxuMR9mwGkf61qYmfq7gsClASfhNWI+JHXzLGXiawjcMnCSXqNmREJz1f9wa5
                      OimCqlmcBNA6fhdZR85OrmlSaZ2xG414HT9BoNNontBs3BPU2VmG8JOgI3D5vX/rLOZMn2za0WkJ5n
                      aaxegfPwGjUfueO5r4eTGtdr7N6Aa3U/Wo27uuJb65Mm4rfn0hytA4fkdZR8TM3T3D1NtHWvzdcacM
                      heW+ZMaj73u3bVzO2lOWXu6MBF8lojW1q5DnlfypLXW5o6rmjAlbxH5iNdB/Sdl0tfg6obFbgWvUbN
                      NXsLOGn2Bq4nr5F0h+yeg2jm3E7P0awFXI3XEX1G1g3dH24fgKhr7SIEgF7bFnxDxsNPXXS9UTXTa5
                      t6CT7Sg5eV9vIgAAAAAElFTkSuQmCC
                      

                      Produces this image:

                      download.png

                      Note that the background uses alpha transparency.

                      *not actually a robot

                      1 Reply Last reply Reply Quote 0
                      • wilrikerundefined
                        wilriker
                        last edited by 18 Sept 2020, 14:19

                        Support for the thumbnail included by PrusaSlicer is planned for the version PanelDueFirmware 3.3 (i.e. after the current 3.2 is finished).

                        Manuel
                        Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                        with probably always latest firmware/DWC (incl. betas or self-compiled)
                        My Tool Collection

                        undefined 1 Reply Last reply 17 Dec 2020, 23:10 Reply Quote 2
                        • undefined
                          bot @wilriker
                          last edited by 17 Dec 2020, 23:10

                          @wilriker FYI the newest versions of PrusaSlicer include the ability to embed a thumbnail of an arbitrary size. No modifications necessary to get a thumbnail encoded now.

                          *not actually a robot

                          1 Reply Last reply Reply Quote 0
                          • wilrikerundefined
                            wilriker
                            last edited by 8 Mar 2021, 15:28

                            I was looking into this for the past week and unfortunately I have to report failure to get it done. The problem is that we just have way to few RAM available on PanelDue. Maybe in future version of PanelDue with much more RAM this could be done for but for now it is technically impossible.

                            Manuel
                            Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                            with probably always latest firmware/DWC (incl. betas or self-compiled)
                            My Tool Collection

                            undefined 1 Reply Last reply 8 Mar 2021, 15:54 Reply Quote 0
                            • undefined
                              MartinNYHC @wilriker
                              last edited by 8 Mar 2021, 15:54

                              @wilriker Unfortunately that makes sense. Thanks for looking into it.

                              If we're just "together" 🙂 I would like to see the current pinting speed on PanelDue.

                              1 Reply Last reply Reply Quote 1
                              • mfs12undefined mfs12 referenced this topic 13 Dec 2021, 08:34
                              • First post
                                Last post
                              Unless otherwise noted, all forum content is licensed under CC-BY-SA