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

MotionWebcamServer plugin - Missing library

Scheduled Pinned Locked Moved
Beta Firmware
4
29
1.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.
  • undefined
    adammhaile @adammhaile
    last edited by 9 Mar 2022, 01:21

    @chrishamm
    So I found where that library lives:

    pi@rancor:~ $ ldconfig -p | grep libvchiq_arm
            libvchiq_arm.so (libc6,hard-float) => /opt/vc/lib/libvchiq_arm.so
    

    And I attempted to add that directory to my LD path for the dsf user:

    dsf@rancor:~ $ echo $LD_LIBRARY_PATH
    :/opt/vc/lib/
    

    But the plugin still fails with the same error - so seems to not care about LD_LIBRARY_PATH. Is there another way I can set the path for where to find libvchiq_arm for the plugin?

    1 Reply Last reply Reply Quote 0
    • undefined
      adammhaile @chrishamm
      last edited by 10 Mar 2022, 23:53

      @chrishamm Is the actual source code for this plugin somwhere?
      All I can find is the binaries on Github: https://github.com/Duet3D/DSF-Plugins/tree/dev/MotionWebcamServer/dsf/arm

      Would love to dig into it more but hard to without the source.

      undefined 1 Reply Last reply 11 Mar 2022, 10:29 Reply Quote 0
      • undefined
        chrishamm administrators @adammhaile
        last edited by 11 Mar 2022, 10:29

        @adammhaile Do you mean this? https://github.com/Motion-Project/motion It's linked in the MotionWebcamServer README file.

        Duet software engineer

        undefined 1 Reply Last reply 11 Mar 2022, 12:30 Reply Quote 0
        • undefined
          adammhaile @chrishamm
          last edited by 11 Mar 2022, 12:30

          @chrishamm Ah - sorry. I missed that it was really just as simple as you running a pre-existing thing.
          I'll look into it more from there - thanks!

          1 Reply Last reply Reply Quote 1
          • undefined
            luckyflyer
            last edited by luckyflyer 20 Mar 2022, 21:09

            @adammhaile @chrishamm Any follow up on this? I've installed the plugin on 3.4 final with the same results that you had.

            1 Reply Last reply Reply Quote 0
            • undefined
              adammhaile
              last edited by 21 Mar 2022, 11:36

              @luckyflyer Unfortunately, no - I have not been able to solve the problem.
              But glad it's not just me at least?
              Granted, I've also downloaded motion separately and was unable to get it to work... so it seems to be something wrong with the plugin per-se.
              I wonder if the DuetPi base image was updated recently and made incompatible with motion

              undefined 1 Reply Last reply 21 Mar 2022, 12:04 Reply Quote -1
              • undefined
                chrishamm administrators @adammhaile
                last edited by 21 Mar 2022, 12:04

                @adammhaile @luckyflyer Very odd, it looks like something changed because this definitely worked for me before on another image. The problem is indeed that motion cannot open /opt/vc/lib/libvchiq_arm.so. To fix this, you can edit /etc/apparmor.d/dsf.MotionWebcamServer and insert a new line below /usr/local/lib...:

                  /opt/vc/lib/** rm,
                

                Then reboot the Pi or run sudo apparmor_parser -r /etc/apparmor.d/dsf.MotionWebcamServer and you should be able to start the plugin from DWC.

                Duet software engineer

                1 Reply Last reply Reply Quote 1
                • undefined
                  luckyflyer
                  last edited by 21 Mar 2022, 14:22

                  @chrishamm I ssh into my pi and copy/paste

                  /etc/apparmor.d/dsf.MotionWebcamServer
                  

                  I get a permission denied message.

                  undefined 1 Reply Last reply 21 Mar 2022, 14:28 Reply Quote 0
                  • undefined
                    adammhaile @luckyflyer
                    last edited by 21 Mar 2022, 14:28

                    @luckyflyer you'll need to use sudo to edit the file.
                    sudo nano /etc/apparmor.d/dsf.MotionWebcamServer

                    Ctrl+O to save, Ctrl+X to exit once saved

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      luckyflyer
                      last edited by 21 Mar 2022, 14:52

                      @adammhaile Thanks, I tried sudo but without nano but of course that didn't work either.

                      undefined 1 Reply Last reply 21 Mar 2022, 14:55 Reply Quote 0
                      • undefined
                        adammhaile @luckyflyer
                        last edited by 21 Mar 2022, 14:55

                        @luckyflyer why are you trying it without nano?

                        As @chrishamm said:

                        @chrishamm said in MotionWebcamServer plugin - Missing library:

                        To fix this, you can edit /etc/apparmor.d/dsf.MotionWebcamServer and insert a new line below

                        This means you need to edit the file which is what nano does... you can't just "run" that file.

                        1 Reply Last reply Reply Quote 0
                        • undefined
                          luckyflyer
                          last edited by luckyflyer 21 Mar 2022, 17:00

                          I have the plugin running and have a grey screen that has a message in the top left corner "unable to open video device". I tried a different (known to work camera) with the same results. I ran lsusb and the ports see the camera. I'm using http://192.168.0.181:8081/0/stream Any ideas? Thanks
                          printer2.jpg

                          1 Reply Last reply Reply Quote 0
                          • undefined
                            luckyflyer
                            last edited by 22 Mar 2022, 07:04

                            Any ideas why the grey screen?

                            undefined 1 Reply Last reply 22 Mar 2022, 10:09 Reply Quote 0
                            • undefined
                              chrishamm administrators @luckyflyer
                              last edited by chrishamm 22 Mar 2022, 10:09

                              @luckyflyer Your error message says "Unable to open video device" so your webcam is probably not recognized by the Pi or you don't have access to it. Can you check if /dev/video0 exists? That's the default in the motion settings (see motion.conf in the System Files directory).

                              Please run sudo gpasswd -a dsf video and reboot your Pi. That should fix it.

                              Duet software engineer

                              undefined 1 Reply Last reply 22 Mar 2022, 10:25 Reply Quote 0
                              • undefined
                                MintyTrebor @chrishamm
                                last edited by MintyTrebor 22 Mar 2022, 10:25

                                @chrishamm I have just enabled this plugin on a brand new clean duet image install on a pi4 with v3.4. The permissions issues described above were present on the included version of the plugin, and the fix previously posted did indeed work to enable the plugin to start.

                                However the permissions issues seem to be deeper within the operations of the plugin.
                                By default the plugin cannot access /dev/video*, neither can it create a log entry in the default logging folder set in the config file (when enabled). I changed the log folder to the tmp directory and I was able to see in the logs that motion was complaining it cannot access the video* device, which results in the grey screen shown in @luckyflyer post.

                                To prove this is a permissions problem I changed the permissions of /dev/video0 in the terminal (chmod), and the plugin was able to start with video working correctly. I looked at

                                /etc/apparmor.d/dsf.MotionWebcamServer
                                

                                and I can see there is an entry to set the access permissions to /dev/video* in the file, but this does not seem to be working as expected.

                                --edit - I see you have updated your post since I started this one. I will try the proposed additional command....

                                -- Update 2 - Additional command worked. Also I found adding the following line to the Live Stream Configuration Parameters section in motion.conf, improved the output framerate significantly :

                                stream_maxrate 50
                                

                                NodeDSF - Native Node-Red integration with Duet boards.
                                BtnCmd - Customise DWC with user defined buttons/layouts/panels (DWC Plugin)
                                ReleaseMgr - Duet update info inside DWC.
                                Repo

                                undefined 1 Reply Last reply 22 Mar 2022, 12:12 Reply Quote 1
                                • undefined
                                  MintyTrebor @MintyTrebor
                                  last edited by 22 Mar 2022, 12:12

                                  If anyone is interested you can show the motion "control" web page inside DWC to allow you access / change some advanced video values (brightness, size etc) in a simple gui provided by motion:

                                  2c770e17-672d-4426-9d64-554dd5ecfbd6-image.png

                                  (you will need BtnCmd Plugin to do this)

                                  Set your motion config like below:
                                  a4769e3f-e9e6-4bae-85ce-5a11f4498ff0-image.png
                                  & restart the plugin

                                  In BtnCmd add a remote source panel:
                                  33d9b149-ef11-43b2-bd89-7f0cf6e18e52-image.png

                                  And set the URL to http://[pi ip]:8080/ eg:
                                  6fab52cb-1e50-4eb2-94c2-a710562a80b4-image.png

                                  Then resize to fit your screen and save the layout.

                                  NodeDSF - Native Node-Red integration with Duet boards.
                                  BtnCmd - Customise DWC with user defined buttons/layouts/panels (DWC Plugin)
                                  ReleaseMgr - Duet update info inside DWC.
                                  Repo

                                  undefined undefined 2 Replies Last reply 22 Mar 2022, 12:27 Reply Quote 2
                                  • undefined
                                    chrishamm administrators @MintyTrebor
                                    last edited by chrishamm 22 Mar 2022, 12:27

                                    @mintytrebor DWC lets you show the same content on the Jobs -> Webcam page if you check Embed webcam image in an iframe on the Settings -> General page and change the config + URL accordingly.

                                    PS: I'm rebuilding DuetPi to make the required changes from above obsolete. The next DSF version will fix it, too.

                                    Duet software engineer

                                    undefined 1 Reply Last reply 22 Mar 2022, 12:33 Reply Quote 1
                                    • undefined
                                      MintyTrebor @chrishamm
                                      last edited by 22 Mar 2022, 12:33

                                      @chrishamm said in MotionWebcamServer plugin - Missing library:

                                      PS: I'm rebuilding DuetPi to make the required changes from above obsolete. The next DSF version will fix it, too.

                                      Great. Thanks @chrishamm

                                      NodeDSF - Native Node-Red integration with Duet boards.
                                      BtnCmd - Customise DWC with user defined buttons/layouts/panels (DWC Plugin)
                                      ReleaseMgr - Duet update info inside DWC.
                                      Repo

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        luckyflyer
                                        last edited by luckyflyer 22 Mar 2022, 15:04

                                        @chrishamm, @MintyTrebor Thanks

                                        1 Reply Last reply Reply Quote 0
                                        • undefined
                                          luckyflyer
                                          last edited by 28 Mar 2022, 15:42

                                          @chrishamm @MintyTrebor I would like to increase the frame rate. Could you help a Linux dummy out and give me the exact command to enter to change the frame rate. Thanks

                                          undefined 1 Reply Last reply 28 Mar 2022, 15:44 Reply Quote 0
                                          • First post
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA