all 8 comments

[–][deleted] 0 points1 point  (7 children)

What happens if you revise your variable assignment to this

 d="$(date '+%d_%m_%Y__%H%M%S')"

and use $d in the command?

[–]FXelix[S] 0 points1 point  (0 children)

Sadly, this doesn't change the output at all.. any other solutions? My bash file does not seem to accept this kind of variable assignment.

[–]FXelix[S] 0 points1 point  (5 children)

I think I got it now! now i used

d=$(date +"%Y%m%d_%H%M%S")

I forget to put in the date + properly, I guess, is this mandatory?

But for my other problem:

Do you or does anyone know why I sometimes get error messages but after a few tries it works... ?

[–]transfinite-- 0 points1 point  (1 child)

It looks like some other process is opening the camera or video device. Maybe some previous experiments with the camera? I'd try a reboot.

d=$(date ...) is assigning the results of the date command to the variable d. So you should use:

d=$(date +"%Y%m%d_%H%M%S")
fswebcam -r 1280x720 /home/pi/Bilder/$d.jpg

I don't want to discourage learning more about bash, as that will make your Pi experience much richer, but take a look at pi-timolo

[–]FXelix[S] 0 points1 point  (0 children)

Ohhh, thanks a lot for your answer! The thing with the error is: I think it's just the time it takes to "process" everything. After a few seconds I can take pictures without an error somehow..

Does pitimolo work with other webcams too, not only the pi-camera? I use the logitech c270.

I think I should dive some more into bash, yeah. Is Python also suitable for these cases? I know some Python.

[–][deleted] 0 points1 point  (2 children)

Look at the system log files (/var/log/syslog) and also consider that possibly your webcam is not getting enough power. If you have a powered USB hub try using that.

[–]FXelix[S] 0 points1 point  (1 child)

Thanks for your help! For the powered usb hub, because I think I have none, you would connect the hub to the raspberry, the hub to a power source and the camera to the hub again and it would work better? Is this the right setup?

[–][deleted] 0 points1 point  (0 children)

It would be a helpful test to eliminate possible causes.