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

    DuetWifi DWC Encryption using Rasberry Pi Zero W as Proxy Server

    Scheduled Pinned Locked Moved
    General Discussion
    7
    16
    2.4k
    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.
    • Jacotheronundefined
      Jacotheron
      last edited by

      Hi @resam thank you for your contribution. I will try your recommendation as soon as my Pi up and running again (busy getting everything in their cases and mounting) positions.

      The Basic Auth is also a good idea, though it is only between your browser and the Pi, so the RRF password is still the only protection for a direct connection to the Duet; that said any contributions are welcome.

      For the proxy, I simply followed a tutorial on getting such a proxy setup, so there is some extras that are not needed; so for this to work, we only need the proxy_pass from the original one I had and then the 2 extras you mentioned?

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

        Fantastic!!!

        Once you have this "really the way you like it", consider writing a WiKi page?

        Delta / Kossel printer fanatic

        T3P3Tonyundefined 1 Reply Last reply Reply Quote 1
        • wilrikerundefined
          wilriker @Jacotheron
          last edited by

          @jacotheron said in DuetWifi DWC Encryption using Rasberry Pi Zero W as Proxy Server:

          For the proxy, I simply followed a tutorial on getting such a proxy setup, so there is some extras that are not needed; so for this to work, we only need the proxy_pass from the original one I had and then the 2 extras you mentioned?

          You could even get by with only proxy_pass and client_max_body_size but I would recommend to keep the other settings as this enables the browser and nginx to be more efficient in some tasks.

          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

          1 Reply Last reply Reply Quote 0
          • Jacotheronundefined
            Jacotheron
            last edited by

            @wilriker That makes sense.

            @Danal I plan to make it a wiki page as a reference for other to also use.

            While I have a few more knowledgeable people here, I plan to power the Pi from the Duet's expansion port. The idea is that since the Pi and a Pi Cam (v1.3) use very little power, it should be a nice integrated place to have it - as soon as the Duet power up, the Pi also power up and ready to work.

            My current setup: I have a relay with a momentary bypass switch in parallel before the power supply. Relay is triggered on startup, as the PS_ON (active low). I have made a shutdown macro which I use to shut the printer off.

            I have read that the Pi does not always like to simply loose power, so I have been thinking about a way to ensure the Pi can safely shut down, when I want to switch the printer off: I use 2 IO pins on the Duet, which runs to 2 GPIO pins on the Pi for a very basic type of communication (since both are 3.3V logic, it should not be an issue). Wire 1 is the return from the Pi (to signal it is almost shutdown) and Wire 2 is input to the Pi to start shutdown. On startup, the Duet pulls wire 1 HIGH (or can be LOW) it is set as an Input, and writes wire 2 to HIGH (Output); the Pi writes the opposite to wire 1, and creates an interrupt on wire 2 for a rise or fall. When the Pi's interrupt triggers, it should start shutting down, but the important part is that wire 1 should remain what it is for as long as possible until the Pi is as close to being shut down as possible, then it released and this should then be detected by the Duet which have a slight extra second delay before releasing the PS_ON relay and be off.

            Is this a good idea or should I simply have a standard 10 second delay (with a single wire to signal shutdown); or am I just making it more complicated than it needs to be?

            The camera will mainly be used to stream to DWC, but may from time to time be used for stills and time-lapse videos, and when they record I will complete the video before shutting down anyways (and usually download it to a computer, to clear the space).

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

              Others may vary... I have never shut down a Pi in my life, other than by yanking power.

              I have never had to re-build a Pi flash as a result of this practice. And, if I did, it wouldn't take long.

              Delta / Kossel printer fanatic

              1 Reply Last reply Reply Quote 0
              • T3P3Tonyundefined
                T3P3Tony administrators @Danal
                last edited by

                @danal said in DuetWifi DWC Encryption using Rasberry Pi Zero W as Proxy Server:

                Fantastic!!!

                Once you have this "really the way you like it", consider writing a WiKi page?

                Yes my thoughts exactly - or a guide if you feel up to breaking down into detailed steps!

                www.duet3d.com

                1 Reply Last reply Reply Quote 0
                • dragonnundefined
                  dragonn @Jacotheron
                  last edited by

                  @jacotheron said in DuetWifi DWC Encryption using Rasberry Pi Zero W as Proxy Server:

                  I have read that the Pi does not always like to simply loose power, so I have been thinking about a way to ensure the Pi can safely shut down

                  In theory this is true. In practice i run some Pi which was so often hard power down and it still runs :D. Sometimes I wonder my self how it is possible. But they are some solutions which can improve hard power down reliability:

                  • use an industrial grade SD Card
                  • setups Pi file-system as read-only
                  1 Reply Last reply Reply Quote 0
                  • Jacotheronundefined
                    Jacotheron
                    last edited by

                    I have now written a guide for the Proxy part, the camera section will come slightly later, but it is really simple to install (only real requirement is to run it on a different port than the proxy - I had issues when they were on the same port).
                    https://www.instructables.com/id/DuetWifi-HTTPS-Proxy-and-Camera-Using-RaspberryPi-/

                    Any further advice, questions etc can be posted to the instructable or this thread. I will try to help anyone, but usually a Google Search can also help (in essence my guide is simply a compilation of information found on a whole lot of websites, added in a logical order for this specific task).

                    Danalundefined 1 Reply Last reply Reply Quote 0
                    • 3dmntbighkerundefined
                      3dmntbighker
                      last edited by 3dmntbighker

                      I just set mine up, and FYI if you don't have the WiFi password in double quotes it fails. I suggest including them everywhere anyone might copy/paste or they won't know what is going on without picking through the logs. I couldn't vi /etc/wpa_supplicant/wpa_supplicant.conf either because the Pi doesn't like the mappings on my keyboard. So there was no way to insert a double quote. I put the card back in my PC and added the double quotes and WiFi connects.

                      Of course so far I can't connect over SSH from my Mac or PC. I get as far as the password entry and Pi thinks I'm logged in, but I never get the prompt back. It's just hung there. So auth seems to be working according to the log but I never see the banner or a prompt that accepts typing. I have tried from Windows 10, Mac and Linux.

                      I'm very interested in the camera guide if you have a work in progress. My camera arrives tomorrow.

                      Scratch built CoreXY with Maestro
                      Heavily modified Ender 3 with Maestro
                      MPCNC work in progress with Duet WiFi

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

                        @jacotheron said in DuetWifi DWC Encryption using Rasberry Pi Zero W as Proxy Server:

                        I have now written a guide for the Proxy part, the camera section will come slightly later, but it is really simple to install (only real requirement is to run it on a different port than the proxy - I had issues when they were on the same port).
                        https://www.instructables.com/id/DuetWifi-HTTPS-Proxy-and-Camera-Using-RaspberryPi-/

                        Would you be willing to put this in the Duet Dozuki Wiki?

                        If not, would you be offended if I did?

                        Thanks,

                        Danal

                        Delta / Kossel printer fanatic

                        T3P3Tonyundefined 1 Reply Last reply Reply Quote 1
                        • Jacotheronundefined
                          Jacotheron
                          last edited by

                          @3dmntbighker Ok, I will change it so that it have the double quotes.

                          @Danal You are more than welcome to add it to the wiki. As mentioned, my work was simply compiling it and ordering it. You can also, if you see a need for it, change grammar and spelling - English is not my native language.

                          1 Reply Last reply Reply Quote 0
                          • T3P3Tonyundefined
                            T3P3Tony administrators @Danal
                            last edited by

                            @danal great if you did. can you link to @Jacotheron 's instructable if you do and focus the documentation on what to do, with the explanation of the background left in the instructable.

                            @Jacotheron thanks for writing this up, I plan on giving it a go as soon as possible. Do you think it is possible to put together a Pi zero image with everything configured (other than the obvious WIFI settings , printer name etc?

                            Torbjorn (of hang printer fame) has done his for the hangprinter development environment under Ubuntu

                            http://vitana.se/opr3d/tbear/2018#hangprinter_project_57

                            www.duet3d.com

                            1 Reply Last reply Reply Quote 0
                            • Jacotheronundefined
                              Jacotheron
                              last edited by

                              @T3P3Tony I am actually a beginner with regards to a Raspberry Pi, how would I go about creating that image?

                              T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
                              • T3P3Tonyundefined
                                T3P3Tony administrators @Jacotheron
                                last edited by

                                @jacotheron I am not up to speed with it either. I will look into it once i get a version working.

                                www.duet3d.com

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