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

    Need help installing ustreamer

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

        not so sure about the 2 minutes, systemd isn't my forte.

        nor am I 100% sure about the usecase and proposed solution is the best match.

        but yeah, the command to edit the files as root is fine, it does the same as sudo nano /etc/.... just without loopholes and it respects the EDITOR env variable for those who have customized their profile.

        are you looking for a solution that will autostart when the camera is connected, or a solution that will autostart when the pi starts (with the camera always connected)?

        my day is coming to an end, but i think the last bit there might clear up some misconceptions?

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

          I normally will keep the camera always connected so the autostart with camera connected would work for me. But either would work ok.

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

            (the template thing might do both, idk, if I fidn a camera tomorrow i'll play with it a little in the evening)

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

              Sounds good thanks.

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

                I notice that line 2 uses a upper case I and line 5 uses a lower case i Don't know if this is anything or not, thought I would mention it.

                [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
                
                A Former User? 1 Reply Last reply Reply Quote 0
                • A Former User?
                  A Former User @luckyflyer
                  last edited by A Former User

                  thats intentional. %I gets escaped so it doesn't contain special characters, which is needed for the name (and i suspect gtj0 would have corrected it if I was mistaken:)

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

                    @bearer said in Need help installing ustre sure the camera is plugged in.
                    eamer
                    :

                    thats intentional. %I gets escaped so it doesn't contain special characters, which is needed for the name (and i suspect gtj0 would have corrected it if I was mistaken:)

                    Correct. It's just in the description anyway.

                    @luckyflyer start simple...

                    ### Move the rules file out of the way
                    $ sudo mv /etc/udev/rules.d/80-ustreamer.rules /root/
                    ### Reload systemd
                    $ sudo systemctl daemon-reload
                    ### Enable ustreamer@video0 to start on boot.
                    $ sudo systemctl enable ustreamer@video0
                    Created symlink /etc/systemd/system/multi-user.target.wants/ustreamer@video0.service → /etc/systemd/system/ustreamer@.service.
                    ### Make sure the camera is plugged in.
                    ### Reboot.
                    $ sudo systemctl reboot
                    ###  When the Pi is back up, check the status of the service...
                    $ sudo systemctl status ustreamer@video0
                    
                    A Former User? 1 Reply Last reply Reply Quote 0
                    • luckyflyerundefined
                      luckyflyer
                      last edited by luckyflyer

                      @gtj0 Thanks for your help and sorry to be such a pain.
                      I enter each command and this is what I get.

                      pi@duet3:~ $ sudo mv /etc/udev/rules.d/80-ustreamer.rules /root/
                      pi@duet3:~ $ sudo systemctl daemon-reload
                      pi@duet3:~ $ sudo systemctl enable ustreamer@video0
                      Failed to enable unit: Unit file ustreamer@video0.service does not exist.
                      

                      I have followed the previous steps exactly and several times using copy and paste. I'm using nano3.2 and do ctrl X Yes then enter to save and then reboot. I do this for both of the files. I'm at a loss to for why the service does not exist.

                      One thing I've noticed is when I go back into the editor the text that I previously entered

                      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"
                      

                      and

                      [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
                      

                      are still there, is this normal? I have the feeling that the files are not being saved. I'm wondering if I don't have permissions set correctly but get no error stating that I don't. Doing research to understand about permissions.

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

                        @luckyflyer Are you sure the ustreamer@.service file is located in /etc/systemd/system and that it's named exactly that?

                        Try ls -al /etc/systemd/system then cat /etc/systemd/system/ustreamer@.service

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

                          @gtj0
                          ls -al /etc/systemd/system

                          pi@duet3:~/ustreamer $ ls -al /etc/systemd/system
                          total 76
                          drwxr-xr-x 17 root root 4096 May 29 22:30 .
                          drwxr-xr-x  5 root root 4096 May 19 06:26 ..
                          -rw-r--r--  1 root root 1551 Apr  7 06:06 autologin@.service
                          drwxr-xr-x  2 root root 4096 May 19 07:56 basic.target.wants
                          drwxr-xr-x  2 root root 4096 May 19 06:36 bluetooth.target.wants
                          lrwxrwxrwx  1 root root   42 May 19 06:38 dbus-fi.w1.wpa_supplicant1.service -> /lib/systemd/system/wpa_supplicant.service
                          lrwxrwxrwx  1 root root   37 May 19 06:36 dbus-org.bluez.service -> /lib/systemd/system/bluetooth.service
                          lrwxrwxrwx  1 root root   40 May 19 06:37 dbus-org.freedesktop.Avahi.service -> /lib/systemd/system/avahi-daemon.service
                          lrwxrwxrwx  1 root root   45 May 19 06:26 dbus-org.freedesktop.timesync1.service -> /lib/systemd/system/systemd-timesyncd.service
                          lrwxrwxrwx  1 root root   34 May 19 06:38 dhcpcd5.service -> /lib/systemd/system/dhcpcd.service
                          lrwxrwxrwx  1 root root   35 May 19 07:58 display-manager.service -> /lib/systemd/system/lightdm.service
                          drwxr-xr-x  2 root root 4096 May 19 06:26 getty.target.wants
                          drwxr-xr-x  2 root root 4096 May 19 06:31 getty@tty1.service.d
                          drwxr-xr-x  2 root root 4096 May 19 07:58 graphical.target.wants
                          drwxr-xr-x  2 root root 4096 May 19 06:35 halt.target.wants
                          drwxr-xr-x  2 root root 4096 May 25 20:04 multi-user.target.wants
                          drwxr-xr-x  2 root root 4096 May 19 06:28 network-online.target.wants
                          drwxr-xr-x  2 root root 4096 May 19 06:35 poweroff.target.wants
                          drwxr-xr-x  2 root root 4096 May 19 06:38 rc-local.service.d
                          drwxr-xr-x  2 root root 4096 May 19 06:35 reboot.target.wants
                          drwxr-xr-x  2 root root 4096 May 19 06:36 remote-fs.target.wants
                          drwxr-xr-x  2 root root 4096 May 19 08:03 sockets.target.wants
                          lrwxrwxrwx  1 root root   31 May 19 06:36 sshd.service -> /lib/systemd/system/ssh.service
                          drwxr-xr-x  2 root root 4096 May 19 06:36 sysinit.target.wants
                          lrwxrwxrwx  1 root root   35 May 19 06:28 syslog.service -> /lib/systemd/system/rsyslog.service
                          drwxr-xr-x  2 root root 4096 May 19 06:29 timers.target.wants
                          -rw-r--r--  1 root root  217 May 30 12:24 ustreamer@.service:
                          pi@duet3:~/ustreamer $
                          

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

                          pi@duet3:~ $ cat /etc/systemd/system/ustreamer@.service
                          cat: /etc/systemd/system/ustreamer@.service: No such file or directory
                          

                          Looks like the first one is there, but not the second.
                          I think it's something with my editor but don't know how to check to see.

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

                            @luckyflyer maybe try making it executable?

                            sudo chmod +x /etc/systemd/system/ustreamer@.service

                            (long shot)

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

                              tried it,

                              pi@duet3:~ $ sudo chmod +x /etc/systemd/system/ustreamer@.service
                              chmod: cannot access '/etc/systemd/system/ustreamer@.service': No such file or directory
                              
                              1 Reply Last reply Reply Quote 0
                              • luckyflyerundefined
                                luckyflyer
                                last edited by

                                @gtj0 @bearer
                                Been reading up on the cat command, was wondering if that would be a good way to create and save the missing file?

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

                                  hmm, does the filename have a : at the end?

                                  sudo mv /etc/systemd/system/ustreamer@.service: /etc/systemd/system/ustreamer@.service
                                  sudo chmod +x /etc/systemd/system/ustreamer@.service
                                  
                                  1 Reply Last reply Reply Quote 0
                                  • luckyflyerundefined
                                    luckyflyer
                                    last edited by

                                    @gtj0 said,
                                    @luckyflyer Are you sure the ustreamer@.service file is located in /etc/systemd/system and that it's named exactly that?
                                    I noticed that in

                                    ls -al /etc/systemd/system
                                    

                                    that in line 29 it is

                                    ustreamer@.service:
                                    

                                    With a colon, instead of

                                    ustreamer@.service
                                    

                                    Is this a problem?

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

                                      They say great minds think alike................ maybe, I don't know lol.

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

                                        @luckyflyer said in Need help installing ustreamer:

                                        cat command, was wondering if that would be a good way to create

                                        well, you can use cat and heredoc to create files like so

                                        cat << EOF > /tmp/yourfilehere
                                        These contents will be written to the file.
                                                This line is indented.
                                        EOF
                                        

                                        but redirects and sudo gets messy so you'd need something like

                                        cat << EOF | sudo tee /tmp/yourfilehere
                                        These contents will be written to the file.
                                                This line is indented.
                                        EOF
                                        

                                        but you'll have to deal with escaping on the command line etc. i to use it from time to time, but its not always the best option.

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

                                          How would I get rid of the :

                                          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:

                                            How would I get rid of the :

                                            sudo mv renames it

                                            sudo mv /etc/systemd/system/ustreamer@.service: /etc/systemd/system/ustreamer@.service
                                            sudo chmod +x /etc/systemd/system/ustreamer@.service
                                            

                                            edit thats better.

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