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

    Need help installing ustreamer

    Scheduled Pinned Locked Moved
    General Discussion
    8
    135
    10.8k
    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.
    • A Former User?
      A Former User
      last edited by

      @luckyflyer said in Need help installing ustreamer:

      sudo systemctl start ustreamer@.service

      this seems to be a so called template service, so it needs the name in the invocation; sudo systemctl start ustreamer@video0.service

      which probably means Description=UStreamer for video0 should be changed to Description=UStreamer for %I but doesn't affect the issue at hand I believe.

      1 Reply Last reply Reply Quote 0
      • gtj0undefined
        gtj0
        last edited by

        @luckyflyer Yeah sorry about that. I should have given more compete instructions. @bearer is correct about being a template service and has the correct command line to manually start and stop the service.

        I don't see (or don't remember) whether the camera you're using is a USB cam or a MIPI cam directly attached to the Pi's camera connector. If it's a USB camera, then here are updated service and rules files that will automatically stop the service when the device disconnects..

        /etc/udev/rules.d/80-ustreamer.rules:

        ACTION=="add", KERNEL=="video0", SUBSYSTEM=="video4linux", TAG+="systemd", ENV{SYSTEMD_WANTS}+="ustreamer@%k.service"
        ACTION=="remove", KERNEL=="video0", SUBSYSTEM=="video4linux", RUN+="/bin/systemctl --no-block stop ustreamer@%k.service"
        

        /etc/systemd/system/ustreamer@.service:

        [Unit]
        Description=UStreamer for %I
        
        [Service]
        Type=simple
        ExecStart=/usr/local/bin/ustreamer --exit-on-parent-death -r 640x480 --static /tmp/ -d /dev/%i --host=0.0.0.0 --port=8080
        
        [Install]
        WantedBy=multi-user.target
        

        As a reminder... "0.0.0.0" is a special IP address that tells server software to listen for connections on all ip addresses on the system. It can never be used to actually connect to anything.

        A Former User? 1 Reply Last reply Reply Quote 0
        • luckyflyerundefined
          luckyflyer
          last edited by luckyflyer

          @gtj0,
          Yes usb cam, I will try this in about an hour. Thanks to you and @bearer .

          1 Reply Last reply Reply Quote 0
          • A Former User?
            A Former User @gtj0
            last edited by A Former User

            @gtj0 thanks for sharing this, gonna have to try with with my auto--bossac-recovery plan.

            re: 0.0.0.0 that had me questioning a few things (in the sense OP said he could connect to it)

            1 Reply Last reply Reply Quote 0
            • luckyflyerundefined
              luckyflyer
              last edited by

              What mipi camera do you guys recommend for print monitoring? I've been looking at the arducam v2 https://www.amazon.com/Arducam-Raspberry-Official-Megapixel-Acrylic/dp/B083FNFPF2/ref=sr_1_3?dchild=1&keywords=arducam+v2&qid=1590854384&sr=8-3

              Or is there something better out there.

              Dougal1957undefined 1 Reply Last reply Reply Quote 0
              • Dougal1957undefined
                Dougal1957 @luckyflyer
                last edited by

                @luckyflyer said in Need help installing ustreamer:

                What mipi camera do you guys recommend for print monitoring? I've been looking at the arducam v2 https://www.amazon.com/Arducam-Raspberry-Official-Megapixel-Acrylic/dp/B083FNFPF2/ref=sr_1_3?dchild=1&keywords=arducam+v2&qid=1590854384&sr=8-3

                Or is there something better out there.

                Have you seen this one High Res PI Camera with interchangeable lens

                luckyflyerundefined 1 Reply Last reply Reply Quote 0
                • luckyflyerundefined
                  luckyflyer @Dougal1957
                  last edited by

                  @Dougal1957
                  Nice looking cam , I would like to buy from a US vendor if possible, is it available here anywhere?

                  gtj0undefined Dougal1957undefined 2 Replies Last reply Reply Quote 0
                  • gtj0undefined
                    gtj0
                    last edited by

                    The downside of RPi cameras is the distance limit and the flat ribbon cable. You get a lot more choices if you use a USB camera.

                    I use this one
                    https://www.amazon.com/gp/product/B07HVT2XZL/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
                    because it has LED illumination, is easy to mount, move, and use for other things if needed.

                    1 Reply Last reply Reply Quote 0
                    • gtj0undefined
                      gtj0 @luckyflyer
                      last edited by

                      @luckyflyer You can get RPi cameras with interchangeable lenses on Amazon. Here's one...
                      https://www.amazon.com/Arducam-Camera-Raspberry-Interchangeable-LS-2717CS/dp/B012ETE75I/

                      1 Reply Last reply Reply Quote 0
                      • Dougal1957undefined
                        Dougal1957 @luckyflyer
                        last edited by Dougal1957

                        @luckyflyer said in Need help installing ustreamer:

                        @Dougal1957
                        Nice looking cam , I would like to buy from a US vendor if possible, is it available here anywhere?

                        I would have thought it would be as it is an official Raspberry device https://www.raspberrypi.org/products/raspberry-pi-high-quality-camera/

                        and 2 meter long cables are available for cheap as well https://shop.pimoroni.com/products/raspberry-pi-camera-cable?variant=10312200583 don't know what effect they would have mind

                        1 Reply Last reply Reply Quote 0
                        • luckyflyerundefined
                          luckyflyer
                          last edited by

                          @gtj0 But don't the mipi cams offer greater programmability and flexibility than usb cams?
                          A picture of the back of my printer, a 30 cm cable would be perfect, up to the top and out.!P1030087.JPG

                          Dougal1957undefined 1 Reply Last reply Reply Quote 0
                          • Dougal1957undefined
                            Dougal1957 @luckyflyer
                            last edited by

                            @luckyflyer I don't really know as I don't have one yet but am considering one with possible a wide angle lens on it not a cheap combination mind

                            1 Reply Last reply Reply Quote 0
                            • mdevaevundefined
                              mdevaev
                              last edited by mdevaev

                              Sup. The ustreamer developer here. I am glad that you use my software, but just in case I want to warn those who want to use RPi CSI cameras: it doesn't work with ustreamer. The reason is that these cameras use their own specific non-v4l2 driver. It is possible to configure them as v4l2, but this requires research and I have not yet addressed this issue. So if you don't want any problems, use regular USB cameras.

                              Quick answers to old questions:

                              • 0.0.0.0 is a special address that means "listen all ipv4 interfaces". If you choose this option, you can connect to the streamer via the ip address of your network card or localhost (127.0.0.1).
                              • You can't listen to port 80 unless you are root or have the CAP_NET_BIND_SERVICE capability (blah-blah-blah the network magic). If you want to run ustreamer via systemd on port 80 under non-root user, you need to add a parameter AmbientCapabilities=CAP_NET_BIND_SERVICE to the Service section
                              • Use the HW encoder: almost all cameras support it.
                              • If you're afraid that someone will see your video, use password authorization. It's better than nothing.

                              PS: I was just passing by, so if you need any help, go to discord, the link is in the ustreamer repository on github.

                              Dougal1957undefined 1 Reply Last reply Reply Quote 0
                              • Dougal1957undefined
                                Dougal1957 @mdevaev
                                last edited by

                                @mdevaev Thank you very much for that info just saved me a ton of cash

                                1 Reply Last reply Reply Quote 0
                                • luckyflyerundefined
                                  luckyflyer
                                  last edited by

                                  Wow, good to know.

                                  1 Reply Last reply Reply Quote 0
                                  • luckyflyerundefined
                                    luckyflyer
                                    last edited by luckyflyer

                                    Still having trouble getting ustreamer to auto start as a service. I have entered @gtj0 revised entries which are,

                                    sudoedit /etc/udev/rules.d/80-ustreamer.rules:

                                    ACTION=="add", KERNEL=="video0", SUBSYSTEM=="video4linux", TAG+="systemd", ENV{SYSTEMD_WANTS}+="ustreamer@%k.service"
                                    ACTION=="remove", KERNEL=="video0", SUBSYSTEM=="video4linux", RUN+="/bin/systemctl --no-block stop ustreamer@%k.service"
                                    

                                    sudoedit /etc/systemd/system/ustreamer@.service:

                                    [Unit]
                                    Description=UStreamer for %I
                                    [Service]
                                    Type=simple
                                    ExecStart=/usr/local/bin/ustreamer --exit-on-parent-death -r 640x480 --static /tmp/ -d /dev/%i --host=0.0.0.0 --port=8080
                                    [Install]
                                    WantedBy=multi-user.target
                                    

                                    Then rebooted, but no image on pc which is http://192.168.0.181:8080 or on Duet pi
                                    http://0.0.0.0:8080

                                    I then tried to manually start the service with,

                                    sudo systemctl start ustreamer@video0.service

                                    and get,

                                    pi@duet3:~ $ sudo systemctl start ustreamer@video0.service
                                    Failed to start ustreamer@video0.service: Unit ustreamer@video0.service not found.
                                    pi@duet3:~ $
                                    

                                    @bearer mentioned this,
                                    *) edit: this assumes the default EDITOR environment variable is set to nano, but if you've changed it you probably know how to use the editor:)
                                    I wondered about this but Raspbian buster comes with nano as the default editor and since I haven't changed editors this shouldn't be an issue.

                                    A Former User? 1 Reply Last reply Reply Quote 0
                                    • A Former User?
                                      A Former User @luckyflyer
                                      last edited by A Former User

                                      @luckyflyer said in Need help installing ustreamer:

                                      @bearer mentioned this,
                                      *) edit: this assumes the default EDITOR environment variable is set to nano, but if you've changed it you probably know how to use the editor:)
                                      I wondered about this but Raspbian buster comes with nano as the default editor and since I haven't changed editors this shouldn't be an issue.

                                      only relevant when using sudoedit (probably other times as well, but in this context, only for sudoedit) and the instructions for getting out of nano wouldn't work for other editors - but then again, if someone have changed the default I'd wager they know how to use it.

                                      1 Reply Last reply Reply Quote 0
                                      • luckyflyerundefined
                                        luckyflyer
                                        last edited by luckyflyer

                                        Hmm, that is what I'm using,
                                        sudoedit /etc/udev/rules.d/80-ustreamer.rules:
                                        sudoedit /etc/systemd/system/ustreamer@.service:
                                        should I use something else?

                                        A Former User? 1 Reply Last reply Reply Quote 0
                                        • A Former User?
                                          A Former User @luckyflyer
                                          last edited by

                                          @luckyflyer said in Need help installing ustreamer:

                                          Hmm, that is what I'm using, should I use something else?

                                          oh dear; that is the one question you do not ask the internett and live to talk about..

                                          jokes aside, no and yes. occasional editing of small files on debian and derivatives nano is fine. but nano isn't always available when you wander outside the comfort zone, and there are fanatics who will tell you that you won't get into (insert happy after life place) if you use anything but their favourite editor etc.

                                          1 Reply Last reply Reply Quote 0
                                          • luckyflyerundefined
                                            luckyflyer
                                            last edited by

                                            Lol can I buy you a plane ticket to the desert southwest, my guess is you you would have this sorted in about 2 minutes.
                                            So
                                            sudoedit /etc/udev/rules.d/80-ustreamer.rules:
                                            sudoedit /etc/systemd/system/ustreamer@.service:
                                            should work ok for me?

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