Bojan
Posts: 17
Joined: Sun Nov 08, 2015 6:55 am
Location: Slovenia
Contact: Website

Picam input?

Sun Feb 14, 2016 5:02 pm

I installed program called webcam.
I have to configure the conf file and I'm getting syntax error becous of input.

Code: Select all

pi@webcam:~/webcam $ webcam webcam.conf 
reading config file: webcam.conf
webcam.conf:24: syntax error
invalid input: composite1
Part of conf where are settings for camera

Code: Select all

       Here is an sample config file (the given values are the defaults):

       [grab]
       device = /dev/video0
       driver = libv4l
       text = "webcam %Y-%m-%d %H:%M:%S"
       infofile = filename
       fg_red = 255
       fg_green = 255
       fg_blue = 255
       width = 320
       height = 240
       delay = 3
       wait = 0
       input = composite1
       norm = pal
       rotate = 0
       top = 0
       left = 0
       bottom = -1
       right = -1
       quality = 75
       trigger = 0
       once = 0
What should I put in input = ?

Ps:
Before I start webcam program, I run this command (fond this on net):

Code: Select all

sudo modprobe | bcm2835-v4l2
Ps2:
I installed this program because I want to use rpi with Picam for webcam, transmitting a picture.jpg every minute on server of my webpage

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Picam input?

Mon Feb 15, 2016 6:10 pm

From where did you install the webcam program?
Link please!

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Picam input?

Mon Feb 15, 2016 6:25 pm

Bojan wrote: Before I start webcam program, I run this command (fond this on net):

Code: Select all

sudo modprobe | bcm2835-v4l2
That command is not right. It should be

Code: Select all

sudo modprobe bcm2835-v4l2
(without the | character)
DirkS wrote: From where did you install the webcam program?
webcam is available from the Raspbian repository, so I guess it would be from there with apt-get.

The config looks ok according to the man page http://manpages.debian.org/cgi-bin/man.cgi?query=webcam

Bojan
Posts: 17
Joined: Sun Nov 08, 2015 6:55 am
Location: Slovenia
Contact: Website

Re: Picam input?

Wed Feb 17, 2016 5:50 pm

Hi, yes I installed with apt-get

I try command without |
This is what I getting:

Code: Select all

pi@webcam:~ $ sudo modprobe bcm2835-v4l2
pi@webcam:~ $ webcam
reading config file: /home/pi/.webcamrc
/home/pi/.webcamrc:24: syntax error
invalid input: composite1

pi@webcam:~ $ webcam webcam.conf 
reading config file: webcam.conf
video4linux webcam v1.5 - (c) 1998-2002 Gerd Knorr
grabber config:
  size 320x240 [none]
  input (null), norm (null), jpeg quality 75
  rotate=0, top=0, left=0, bottom=240, right=320

#Here it ends, only is blinking that thing for writing

I made .webcamrc file in /home/pi/.webcamrc with same settings that webcam.conf but I got the same.

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Picam input?

Wed Feb 17, 2016 6:59 pm

I got it working on my system (without ftp).
I removed the norm line.
Setting 'input' to 0 or completely removing the line both worked.

I set 'local = 1' in the ftp section. This way the file get stored locally.

Bojan
Posts: 17
Joined: Sun Nov 08, 2015 6:55 am
Location: Slovenia
Contact: Website

Re: Picam input?

Fri Feb 19, 2016 5:49 pm

Lucky you :)
Here nothing is happening. What I'm doing wrong?

Code: Select all

pi@webcam:~ $ sudo modprobe bcm2835-v4l2
pi@webcam:~ $ webcam webcam.conf 
reading config file: webcam.conf
video4linux webcam v1.5 - (c) 1998-2002 Gerd Knorr
grabber config:
  size 320x240 [none]
  input (null), norm (null), jpeg quality 75
  rotate=0, top=0, left=0, bottom=240, right=320


Here is entire conf:

Code: Select all

[grab]
       device = /dev/video0
       driver = libv4l
       text = "webcam %Y-%m-%d %H:%M:%S"
       infofile = filename
       fg_red = 255
       fg_green = 255
       fg_blue = 255
       width = 320
       height = 240
       delay = 60
       wait = 0
       input = 0
       rotate = 0
       top = 0
       left = 0
       bottom = -1
       right = -1
       quality = 75
       trigger = 0
       once = 0

       [ftp]
       host = www.name_of_the_site .com
       user = my_username (same as I'm using with filezzila)
       pass = same password that I'm using with filezzila
       dir  = public_html/Webcam
       file = Cerje.jpeg
       tmp  = uploading.jpeg
       passive = 1
       debug = 0
       auto = 0
       local = 0
       ssh = 0

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Picam input?

Fri Feb 19, 2016 11:41 pm

Start with removing all the leading spaces in your config file.
I noticed that the program is not always happy with these

Bojan
Posts: 17
Joined: Sun Nov 08, 2015 6:55 am
Location: Slovenia
Contact: Website

Re: Picam input?

Sat Feb 20, 2016 1:20 pm

Thank you, something is happening. Now I got this:

Code: Select all

pi@webcam:~/webcam $ sudo modprobe bcm2835-v4l2
pi@webcam:~/webcam $ webcam webcam.conf 
reading config file: webcam.conf
ftp: lost connection
ftp: connected to www.tehnost.com
video4linux webcam v1.5 - (c) 1998-2002 Gerd Knorr
grabber config:
  size 320x240 [none]
  input 0, norm (null), jpeg quality 75
  rotate=0, top=0, left=0, bottom=240, right=320
ftp config [ftp]:
  my_username@www.tehnost.com:public_html/Webcam
  uploading.jpeg => Cerje.jpeg
open Cerje: No such file or directory
ftp: connected to www.tehnost.com
open Cerje: No such file or directory
ftp: connected to www.tehnost.com
open Cerje: No such file or directory
ftp: connected to www.tehnost.com


In .conf file I changed: infofile = Cerje (is this correct? I want name Cerje.jpg file to be uploaded)?

Bojan
Posts: 17
Joined: Sun Nov 08, 2015 6:55 am
Location: Slovenia
Contact: Website

Re: Picam input?

Sun Feb 21, 2016 10:59 am

I put an image Cerje.jpg to /home/pi/webcam folder, but I'm still getting the same: No such file or directory.
Then I try to:
- change in .conf at ftp: file = /home/pi/webcam/Cerje.jpg,... same error.
- tmp = Cerje.jpg ... same error.

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Picam input?

Sun Feb 21, 2016 11:36 am

'tmp' is for the temporary file that is created by the grabber.
'file' is the filename used for the file at the end destination.

I think the program doesn't grab images repeatedly and that causes the file not found error.
No idea why that happens.

TBH the docs for this program are absolute rubbish.
I would look for a different program.

Bojan
Posts: 17
Joined: Sun Nov 08, 2015 6:55 am
Location: Slovenia
Contact: Website

Re: Picam input?

Sun Feb 21, 2016 12:16 pm

Thank you.

edit:
Omg I found it :) After free weeks of searching and testing,...

His name is Camorama, it is in Synaptic :) it is a program with gui. It has settings for ftp and pictures:)
I don't know how I didn't found it earlier.
Thank you for all.


One last thing, I should put command modprobe bcm2835-v4l2 so it will run automaticly when system is started (after roobt for example)
to /etc/rc.local This means that I need to create a new file called rc.local and there put this?

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Picam input?

Sun Feb 21, 2016 1:34 pm

Just add a line with

Code: Select all

bcm2835-v4l2
to /etc/modules and it should get started automatically

Return to “General discussion”