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

    issues installing on PI 3 B+

    Scheduled Pinned Locked Moved
    Third-party software
    4
    58
    2.6k
    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.
    • sankafolaundefined
      sankafola @jay_s_uk
      last edited by

      @jay_s_uk @stuartofmt

      yes its running on standalone not sbc

      1 Reply Last reply Reply Quote 0
      • sankafolaundefined
        sankafola @stuartofmt
        last edited by

        @stuartofmt

        let me do point by point

        Can you confirm that, from a browser (not on the pi), that this url results in the display of video ?
        http://10.0.1.110/stream

        yes

        What streaming software are you using? Does it generate any error messages ?

        answer :motion ver 4.3.2

        Are any images being created like: /home/pi/DuetLapse/raspberrypi/10-0-1-126/<>/Camera1_00000001.jpeg

        answer :yes 1 image

        Image 2023-12-21 at 9.39 AM.jpg

        answer : on the duetlapse also says 1 image

        if so - what happens when you try to open one ?

        answer : it open no issues an image of the camera from the room am in it

        Assuming you are streaming video OK ...

        it is ok

        ffmpeg -y -i http://10.0.1.110/stream -vframes 1 ~/test.jpeg

        it takes a pic and save it under home 1 pic yes

        ou should get errors the same as above. Do you ? If yes - try reinstalling ffmpeg. Its possible there are some library dependency conflicts.

        answer : yes i get the same as above while running it looks like something with the config of the ffmpeg maybe it need only to be disabled

        question : is the 10.0.1.110:8082 suppose to show an image when it takes one? i mean the first page is it suppose to show the live pic ?

        why is it only taking one pic only while printing it suppose to take 1 every 20 sec no ?

        see below

        Image 2023-12-21 at 9.46 AM.jpg

        45 layres and only 1 pic

        stuartofmtundefined 1 Reply Last reply Reply Quote 0
        • stuartofmtundefined
          stuartofmt @sankafola
          last edited by

          @sankafola

          i mean the first page is it suppose to show the live pic ?

          No - it displays the last still image it has capture. In this case - it has not captured any images.

          Do you have motion set to stream ? I.e. when viewing in a browser does http://10.0.1.110/stream show live video (as opposed to a single static image)?

          What is happening is ffmpeg is not able to capture from the motion feed. So either a problem with ffmpeg or motion or both 😞

          Assuming that the motion feed is video. What happens when you run ffmpeg -y -i http://10.0.1.110/stream -vframes 1 ~/tes[x].jpeg (changing [x] to get different images).

          Note that the command above is subtly different to the one used in DuetLapse - which may not be supported by the ffmpeg version on your machine (although its supposed to be). But one step at a time ...

          sankafolaundefined 1 Reply Last reply Reply Quote 0
          • sankafolaundefined
            sankafola @stuartofmt
            last edited by sankafola

            @stuartofmt

            hi here is the answers

            Do you have motion set to stream ? I.e. when viewing in a browser does http://10.0.1.110/stream show live video (as opposed to a single static image)?

            answer : yes live video

            Assuming that the motion feed is video. What happens when you run ffmpeg -y -i http://10.0.1.110/stream -vframes 1 ~/tes[x].jpeg (changing [x] to get different images).

            answer :it take a pic and i can open that pic and i change the name to anotherone in the link and redo it and it save another pic

            Note that the command above is subtly different to the one used in DuetLapse - which may not be supported by the ffmpeg version on your machine (although its supposed to be). But one step at a time ...

            answer : yes it works the same as you gave me it save a picture every time i do it

            my config now is

            -basedir /home/pi/DuetLapse
            -duet 10.0.1.126
            -port 8082
            -seconds 30
            -detect none
            -weburl1 http://10.0.1.110/stream
            -verbose
            -camera1 stream

            maybe that camera1 stream is wrong ?

            it seem the motion is saving video files see below the motion log

            2023-12-21-145229_1021x470_scrot.png

            and maybe the format of the streaming need to be changed to mjpeg so the Duetlapse can see it but what i need to do to make this happen in motion ? But that is the job of ffmpeg no??

            another note i find opne image always under 10-0-1-126 which is camera1_0-000001.jpg if i delete it it takes another pic with the same name but only one pic same name is this normal ? what is the output looks like a clip with still images or images to be a clip in another program ?

            2023-12-22-083905_810x419_scrot.png

            stuartofmtundefined 1 Reply Last reply Reply Quote 0
            • stuartofmtundefined
              stuartofmt @sankafola
              last edited by

              @sankafola

              There should be sequentially named images in the "capture" folder. The fact that there is only one is a symptom of the problem.

              Try this version. Its a long shot but I have removed a portion of the ffmpeg command so that it is the same as the one I had you manually test. If that does not change anything, then I think the issue is with motion.
              Ideally - you want motion to be configured to output jpeg or mjpeg. I do not know what it streams by default. Also - I would disable the motion detection (just to take a variable out of play).
              I used motion a long time ago but the version at that time used way too much CPU - so I developed videostream. That has the disadvantage of using opencv which can be tricky to get installed. Bottom line, I cannot help you directly with motion.

              DuetLapse3.py

              sankafolaundefined 1 Reply Last reply Reply Quote 0
              • sankafolaundefined
                sankafola @stuartofmt
                last edited by sankafola

                @stuartofmt

                so let us do videostream then but you know there is a part fails what i need to to ?? do you have a solution for that ? if less cpu then we do that but tell me what i need to do exact i will do it

                i used the last ver you gave me it does the exact same thing one image same name the only difference in this one when the print cancel or stoped it does not force the duetlapse to stop it keep running idle

                stuartofmtundefined 1 Reply Last reply Reply Quote 0
                • stuartofmtundefined
                  stuartofmt @sankafola
                  last edited by

                  @sankafola said in issues installing on PI 3 B+:

                  @stuartofmt

                  so let us do videostream then but you know there is a part fails what i need to to ?? do you have a solution for that ? if less cpu then we do that but tell me what i need to do exact i will do it

                  If you are using a pi camera (ribon cable) then videostream can be used without opencv (which I mentioned can be reluctant to install). To use a USB camera requires opencv.

                  The version on github tries to import opencv. The version below has a small change and should not try to install opencv. To use this version you MUST use the -pires and -pistream options. This will use the pi libcamera libraries. I've not used it this way for quite a while so do not know if the libraries have changed much.

                  videostream.py

                  i used the last ver you gave me it does the exact same thing one image same name the only difference in this one when the print cancel or stoped it does not force the duetlapse to stop it keep running idle.

                  The difference is incidental - the change I made was just to the ffmeg call.

                  If videostream does not work, I have one other trick up my sleeve.

                  sankafolaundefined 1 Reply Last reply Reply Quote 0
                  • sankafolaundefined
                    sankafola @stuartofmt
                    last edited by sankafola

                    @stuartofmt

                    i made a dir called videostream and i put the file you sent videostream.py there and i ran python3 ./videostream.py -port8081 & -pires -pistream
                    and i got this error no module named imutils

                    what i do ?

                    2023-12-22-104146_922x445_scrot.png

                    i installed imutils but now am getting another error for cv2

                    2023-12-22-120744_649x449_scrot.png

                    stuartofmtundefined 1 Reply Last reply Reply Quote 0
                    • stuartofmtundefined
                      stuartofmt @sankafola
                      last edited by

                      @sankafola

                      You tried to run videostream without -pires etc. so it tried to use opencv (cv2 is its internal name).

                      stuartofmtundefined 1 Reply Last reply Reply Quote 0
                      • stuartofmtundefined
                        stuartofmt @stuartofmt
                        last edited by

                        Also best to run without & at end when you are testing.

                        stuartofmtundefined sankafolaundefined 2 Replies Last reply Reply Quote 0
                        • stuartofmtundefined
                          stuartofmt @stuartofmt
                          last edited by

                          Also - please read the instructions especially on -pires settings and how to determine them.

                          1 Reply Last reply Reply Quote 0
                          • sankafolaundefined
                            sankafola @stuartofmt
                            last edited by sankafola

                            @stuartofmt

                            i did try with and without the & and with the option -pires and -pistream and it gives the same results 2023-12-22-125858_640x441_scrot.png its asking for cv2 see below

                            i will try to install the opencv i see now the notes you refered to it i will give it a try

                            a lot of errors see the log file down and as soon as i open the address 10.0.1.110:8081/stream i get this msg repeating " empty frame detected

                            pi@raspberrypi:~ $ python3 videostream.py -port 8081 &
                            [1] 2213
                            pi@raspberrypi:~ $ python3: can't open file '/home/pi/videostream.py': [Errno 2] No such file or directory
                            ^C
                            [1]+ Exit 2 python3 videostream.py -port 8081
                            pi@raspberrypi:~ $ cd videostream
                            pi@raspberrypi:~/videostream $ python3 videostream.py -port 8081 &
                            [1] 2221
                            pi@raspberrypi:~/videostream $ Version: 2.1.1

                            Scanning for available Cameras
                            [ WARN:0@0.777] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video1): can't open camera by index
                            [ERROR:0@0.792] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@0.792] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video2): can't open camera by index
                            [ERROR:0@0.796] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@0.796] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video3): can't open camera by index
                            [ERROR:0@0.799] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@0.800] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video4): can't open camera by index
                            [ERROR:0@0.803] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@0.803] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video5): can't open camera by index
                            [ERROR:0@0.807] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@0.807] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video6): can't open camera by index
                            [ERROR:0@0.811] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@0.811] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video7): can't open camera by index
                            [ERROR:0@0.816] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@0.817] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video8): can't open camera by index
                            [ERROR:0@0.821] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@0.821] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video9): can't open camera by index
                            [ERROR:0@0.825] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@0.825] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video10): can't open camera by index
                            [ERROR:0@0.829] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@0.829] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video11): can't open camera by index
                            [ERROR:0@0.833] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@0.833] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video12): can't open camera by index
                            [ERROR:0@0.836] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@0.837] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video13): can't open camera by index
                            [ERROR:0@0.840] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@10.862] global cap_v4l.cpp:1134 tryIoctl VIDEOIO(V4L2:/dev/video14): select() timeout.
                            [ WARN:0@20.888] global cap_v4l.cpp:1134 tryIoctl VIDEOIO(V4L2:/dev/video15): select() timeout.
                            [ WARN:0@20.892] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video16): can't open camera by index
                            [ERROR:0@20.900] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@20.901] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video17): can't open camera by index
                            [ERROR:0@20.910] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@20.910] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video18): can't open camera by index
                            [ERROR:0@20.919] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
                            [ WARN:0@20.919] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video19): can't open camera by index
                            [ERROR:0@20.927] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range

                            No camera was specified but one camera was found and will be used

                            Opening camera with identifier: 0
                            Scanning for available sizes and formats - be patient
                            The following resolutions are available from the camera: 2592x1944(BGR3) 2592x1944(MJPG) 2592x1944(JPEG) 2592x1944(H264) 2048x1080(BGR3) 2048x1080(MJPG) 2048x1080(JPEG) 2048x1080(H264) 1920x1800(BGR3) 1920x1800(MJPG) 1920x1800(JPEG) 1920x1800(H264) 1640x1232(BGR3) 1640x1232(MJPG) 1640x1232(JPEG) 1640x1232(H264) 1280x720(BGR3) 1280x720(MJPG) 1280x720(JPEG) 1280x720(H264) 800x600(BGR3) 800x600(MJPG) 800x600(JPEG) 800x600(H264) 720x480(BGR3) 720x480(MJPG) 720x480(JPEG) 720x480(H264) 640x480(BGR3) 640x480(MJPG) 640x480(JPEG) 640x480(H264) 320x240(BGR3) 320x240(MJPG) 320x240(JPEG) 320x240(H264)
                            The requested size was not available
                            Using a smaller size: 2592x1944
                            The requested format: MJPG is available
                            [ WARN:0@23.454] global cap_v4l.cpp:2183 setProperty VIDEOIO(V4L2:/dev/video0): Bad buffer size 0, buffer size must be from 1 to 10
                            [ WARN:0@34.068] global cap_v4l.cpp:1134 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.

                            The video stream can be access from:
                            http://10.0.1.110:8081/stream

                            If on the same computer as the camera - you can also try the following:
                            localhost:8081/stream
                            127.0.0.1:8081/stream

                            when i open the http://10.0.1.110:8081/stream i get this msg

                            2023-12-22-154848_665x446_scrot.png

                            i disconnected the ribbon camera and tried a USB camera now no more empty frame msg but other msg see below and only one image just like motion do ( am now with opencv and videostream )

                            2023-12-22-161409_663x753_scrot.png 2023-12-22-161330_652x446_scrot.png

                            stuartofmtundefined 1 Reply Last reply Reply Quote 0
                            • stuartofmtundefined
                              stuartofmt @sankafola
                              last edited by

                              @sankafola

                              Please read the documentation carefully. -pires requires something other than blank input

                              -pistream can usually be omitted

                              The documentation is here:

                              https://github.com/stuartofmt/videostream/blob/master/videostream on Raspberry.md

                              Try something LIKE

                              python3 ./videostream.py -port 8082 -camera 0 -rotate 180 -debug -pires "--width 800 --height 600"

                              tou can also try

                              libcamerify python3 ./videostream.py -port 8082 -camera 0 -rotate 180 -debug -pires "--width 800 --height 600"

                              sankafolaundefined 1 Reply Last reply Reply Quote 0
                              • sankafolaundefined
                                sankafola @stuartofmt
                                last edited by sankafola

                                @stuartofmt

                                am using USB camera now

                                2023-12-22-162809_1102x752_scrot.png

                                and when i use this one

                                python3 ./videostream.py -port 8081 -camera 0 -rotate 180 -debug -pires "--width 800 --height 600"

                                i get this

                                2023-12-22-170300_656x830_scrot.png

                                stuartofmtundefined 1 Reply Last reply Reply Quote 0
                                • stuartofmtundefined
                                  stuartofmt @sankafola
                                  last edited by

                                  @sankafola

                                  As I said a while back - I don’t have access to my test septup. This is too hard trying to do it remotely. I’ll pick it back up in the new year and we can try again. Happy New Year !

                                  sankafolaundefined 1 Reply Last reply Reply Quote 0
                                  • sankafolaundefined
                                    sankafola @stuartofmt
                                    last edited by

                                    @stuartofmt

                                    ok thanks , happy new year to you too

                                    stuartofmtundefined 1 Reply Last reply Reply Quote 0
                                    • stuartofmtundefined
                                      stuartofmt @sankafola
                                      last edited by

                                      @sankafola

                                      As a follow up. Go through the procedure described here

                                      https://github.com/stuartofmt/Pi-Notes/blob/master/Resolution Testing.md

                                      As an observation; getting camera setting that work is largely trial and error. Different combinations of computer, operating system, streaming software, camera type ( usb vs pi) , camera libraries etc

                                      Finding working combination requires an approach that is methodical (one thing at a time), consistent (use only the appropriate commands for the type of camera). Jumping from one approach to the other creates false trails. Even for a camera that is working, not all the resolutions ( for example) that it reports as supported will necessarily work.

                                      sankafolaundefined 1 Reply Last reply Reply Quote 0
                                      • sankafolaundefined
                                        sankafola @stuartofmt
                                        last edited by

                                        @stuartofmt

                                        is it easier to install the duetlapse on videostream on window 10 ? or a mac ?

                                        stuartofmtundefined 1 Reply Last reply Reply Quote 0
                                        • stuartofmtundefined
                                          stuartofmt @sankafola
                                          last edited by

                                          @sankafola

                                          I’ve never tried it on the Mac.
                                          Otherwise try it and see. Same potential issues with opencv. It worked fine in the past

                                          sankafolaundefined 2 Replies Last reply Reply Quote 0
                                          • sankafolaundefined
                                            sankafola @stuartofmt
                                            last edited by

                                            @stuartofmt

                                            Merry Christmas

                                            i tried on pc and same exact issues so am back to PI and the ribbon cam will keep trying until you have time

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