Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get started / Unable to find devce #2

Open
ajl236 opened this issue May 8, 2019 · 6 comments
Open

Cannot get started / Unable to find devce #2

ajl236 opened this issue May 8, 2019 · 6 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers
Projects

Comments

@ajl236
Copy link

ajl236 commented May 8, 2019

Thanks this looks like a nice project for my Logitech C920 but I cannot get started.

pi@raspberrypi:~/RaspiVWS $ ./Raspi_VLC_Webcam_Stream.sh -V 0 8090
returns
Error [1]: Device /dev/video0 required but could not be found. Aborting.

however this command works OK
cvlc v4l2:///dev/video0:chroma=h264 :input-slave=alsa://hw:1,0 --sout '#transcode{acodec=mpga,ab=128,channels=2,samplerate=44100,threads=4,audio-sync=1}:standard{access=http,mux=ts,mime=video/ts,dst=:8090}'

@London-Lass
Copy link

It's because the test chosen in the script doesn't find the device

pi@raspberrypi:~/camera/RaspiVWS $ ls -ld /dev/video0
crw-rw----+ 1 root video 81, 3 May  7 23:59 /dev/video0
pi@raspberrypi:~/camera/RaspiVWS $ [[ -f /dev/video0 ]] && echo "It is a file"
pi@raspberrypi:~/camera/RaspiVWS $ [[ -e /dev/video0 ]] && echo "It exists"
It exists

From the bash man page ...


       -a file
              True if file exists.
       -b file
              True if file exists and is a block special file.
       -c file
              True if file exists and is a character special file.
       -d file
              True if file exists and is a directory.
       -e file
              True if file exists.
       -f file
              True if file exists and is a regular file.
       -g file
              True if file exists and is set-group-id.
       -h file
              True if file exists and is a symbolic link.
       -k file
              True if file exists and its ``sticky'' bit is set.
       -p file
              True if file exists and is a named pipe (FIFO).
       -r file
              True if file exists and is readable.
       -s file
              True if file exists and has a size greater than zero.
       -t fd  True if file descriptor fd is open and refers to a terminal.
       -u file
              True if file exists and its set-user-id bit is set.
       -w file
              True if file exists and is writable.
       -x file
              True if file exists and is executable.
       -G file
              True if file exists and is owned by the effective group id.
       -L file
              True if file exists and is a symbolic link.
       -N file
              True if file exists and has been modified since it was last read.
       -O file
              True if file exists and is owned by the effective user id.
       -S file
              True if file exists and is a socket.

This works ...

pi@raspberrypi:~/camera/RaspiVWS $ [[ -c /dev/video0 ]] && echo "characer special file"
characer special file

Referring to code at bottom of script ...

if [ -e "${WEBCAM_DEVICE}" ] ; then
        VLC_C920_STREAM "${VIDEO_DEVICE_NB}" "${HTTP_PORT}" "${MOVIES_FOLDER}"
else

@ajl236
Copy link
Author

ajl236 commented May 10, 2019

Thanks @London-Lass changing -f to -e on line 416 helped

@LoneWanderer-GH
Copy link
Owner

Hi,
Thanks for the analysis @London-Lass . I'll put that into release, as soon as I have some time to check in my environment.
(That's surprising this test behaves differently on my raspi/distrib.)

@LoneWanderer-GH LoneWanderer-GH self-assigned this Sep 19, 2019
@LoneWanderer-GH LoneWanderer-GH added the bug Something isn't working label Sep 19, 2019
@LoneWanderer-GH LoneWanderer-GH added this to To do in RaspiVWS via automation Sep 19, 2019
@fmjensen
Copy link

I can confirm this.
I too see the excact same error and changing -f to -e makes the check work as intended.

But more problems surface after this fix. v4l2-ctl --all does not contain the LED controls so the script complains on this.
These things maybe linked to the fact that lsb_release -a reveals Raspbian GNU/Linux 10 (buster) is the current os level.

Anyway - thankyou for the work you put into this @LoneWanderer-GH I hope that you find a wee bit of sparetime to test/fix your project on Buster :-)

My setup:

  • RPi Model B+ V1.2
  • WiPi USB wifi dongle
  • and a C920 ;-)

@LoneWanderer-GH LoneWanderer-GH added the good first issue Good for newcomers label Jun 24, 2020
@LoneWanderer-GH LoneWanderer-GH changed the title Cannot get started Cannot get started / Unable to find devce Jul 28, 2020
@edmanning555
Copy link

I'm having this issue also. When I edit line 416 of the script as suggested, it returns "Error [99]: I require ssmtp but it's not installed. Aborting." (regardless of if SSMTP is installed).

Project owner said a fix would be published in July last year, but seeing as the only commits in 2020 were adding Patreon details (lol) that this repo should be considered abandoned?

@LoneWanderer-GH
Copy link
Owner

LoneWanderer-GH commented Feb 20, 2021

@edmanning555 : I've had other things at hand lately, and as you mentioned somewhat, this project is not something that feeds me whatsoever (not a penny, and that was not the point anyway).

Long story short : if you have the time that I don't have right now for this, feel free to open a branch for this issue, and submit a merge request.

Any contributions are welcomed, this is an open project.

(Concerning the ssmtp, it was a planned feature for sending an email whenever a streaming started.)

I'll provide some hints : the fix revolves around the following lines

MAIL_CMD=ssmtp

checkCommandExists ${MAIL_CMD} ${ERROR_MAIL}

if [ ${_arg_use_ssmtp} != "off" ] ; then

echo -e "Starting VLC stream and record\nDate: $(date)\nVIDEO_DEVICE_NB: ${VIDEO_DEVICE_NB}\nDuration: ${GLOBAL_RECORD_TIMEOUT}\nVLC_PARAM_INFINITE_LOOP: ${VLC_PARAM_INFINITE_LOOP}\nFile duration: ${EACH_MOVIE_DURATION_SEC}" | ${MAIL_CMD} -vvv [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
RaspiVWS
  
To do
Development

No branches or pull requests

5 participants