OctoPrint 1.4.2
OctoPi Version 0.17.0, running on Raspberry Pi 3 Model B Plus Rev 1.3
Raspberry Pi Camera Module v2
AdaFruit 2 meter cable.
This setup initially worked.
Then, about two weeks ago, the camera did not come up.
I tinkered and poked, and re-seated both cable ends very firmly and carefully.
No joy. I thought the camera was dead.
Then, I got another camera to go with a second R-Pi for a second printer.
Long story short: Both cameras work with the original 15 cm cable. Neither camera works with the 2 meter cable.
I ordered some shorter cables ( 61cm ) because the 15cm is way too short.
The 200cm cable worked.
First question: The guidelines say I have to include logs when asking for help. As I recall, I found no logs to give me any clue to the source of the problem. Which logs should have the info I need to share ? Do I have to turn up the logging level ?
Here are some logs:
Tinkering with the 200cm cable
root@octopi:/var/log# cat haproxy.log
Dec 5 21:26:26 octopi haproxy[554]: [WARNING] 339/195851 (554) : Exiting Master process...
Dec 5 21:26:26 octopi haproxy[554]: [ALERT] 339/195851 (554) : Current worker 558 exited with code 143
Dec 5 21:26:26 octopi haproxy[554]: [WARNING] 339/195851 (554) : All workers exited. Exiting... (143)
Dec 5 21:28:13 octopi haproxy[554]: [WARNING] 339/212813 (554) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to make this warning disappear.
In one window:
root@octopi:/var/log# systemctl restart webcamd
In another one:
pi@octopi:~ $ tail -F /var/log/syslog | grep webcam
Dec 5 21:35:19 octopi systemd[1]: Stopping the OctoPi webcam daemon with the user specified config...
Dec 5 21:35:19 octopi systemd[1]: webcamd.service: Main process exited, code=killed, status=15/TERM
Dec 5 21:35:19 octopi systemd[1]: webcamd.service: Succeeded.
Dec 5 21:35:19 octopi systemd[1]: Stopped the OctoPi webcam daemon with the user specified config.
Dec 5 21:35:19 octopi systemd[1]: Starting the OctoPi webcam daemon with the user specified config...
Dec 5 21:35:19 octopi webcamd[776]: Starting up webcamDaemon...
Dec 5 21:35:19 octopi webcamd[776]: --- Configuration: ----------------------------
Dec 5 21:35:19 octopi webcamd[776]: cfg_file: /boot/octopi.txt
Dec 5 21:35:19 octopi webcamd[776]: camera: raspi
Dec 5 21:35:19 octopi webcamd[776]: usb options: -r 640x480 -f 10
Dec 5 21:35:19 octopi webcamd[776]: raspi options: -fps 10
Dec 5 21:35:19 octopi webcamd[776]: http options: -w ./www-octopi -n
Dec 5 21:35:19 octopi webcamd[776]: Explicitly USB device:
Dec 5 21:35:19 octopi webcamd[776]: -----------------------------------------------
Dec 5 21:35:19 octopi webcamd[776]: Found video devices:
Dec 5 21:35:19 octopi webcamd[776]: /dev/video0
Dec 5 21:35:19 octopi webcamd[776]: /dev/video10
Dec 5 21:35:19 octopi webcamd[776]: /dev/video11
Dec 5 21:35:19 octopi webcamd[776]: /dev/video12
Dec 5 21:35:19 octopi webcamd[776]: raspi
Dec 5 21:35:19 octopi webcamd[776]: config file='/boot/octopi.txt':Start MJPG-streamer with video device: raspi
Dec 5 21:35:19 octopi webcamd[776]: <13>Dec 5 21:35:19 root: Starting Raspberry Pi camera
Dec 5 21:35:19 octopi webcamd[776]: Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_raspicam.so -fps 10
Dec 5 21:35:19 octopi webcamd[776]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
Dec 5 21:35:19 octopi webcamd[776]: i: fps.............: 10
Dec 5 21:35:19 octopi webcamd[776]: i: resolution........: 640 x 480
Dec 5 21:35:19 octopi webcamd[776]: i: camera parameters..............:
Dec 5 21:35:19 octopi webcamd[776]: Sharpness 0, Contrast 0, Brightness 50
Dec 5 21:35:19 octopi webcamd[776]: Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Dec 5 21:35:19 octopi webcamd[776]: Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Dec 5 21:35:19 octopi webcamd[776]: Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Dec 5 21:35:19 octopi webcamd[776]: Rotation 0, hflip No, vflip No
Dec 5 21:35:19 octopi webcamd[776]: ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
Dec 5 21:35:19 octopi webcamd[776]: o: www-folder-path......: ./www-octopi/
Dec 5 21:35:19 octopi webcamd[776]: o: HTTP TCP port........: 8080
Dec 5 21:35:19 octopi webcamd[776]: o: HTTP Listen Address..: (null)
Dec 5 21:35:19 octopi webcamd[776]: o: username:password....: disabled
Dec 5 21:35:19 octopi webcamd[776]: o: commands.............: disabled
Dec 5 21:35:19 octopi webcamd[776]: i: Starting Camera
Dec 5 21:35:50 octopi webcamd[776]: Done bring up all configured video device
Dec 5 21:35:50 octopi webcamd[776]: Goodbye...
Dec 5 21:35:50 octopi systemd[1]: Started the OctoPi webcam daemon with the user specified config.
A 2 meter cable is quite long, your problem is most likely interference. Since the Pi cam cables are very thin and unshielded. Check it isn't going past the motors, power cables, and maybe you can DIY shield it but I don't know how that would work (something like wrap it in foil?)
Note that every time the camera disconnects you may have to restart webcamd, since it will not carry on trying to connect. sudo service webcamd restart gets you there, as you know.
If you have a multimeter check that each wire has connectivity from end to end. The wires can be very brittle and break in the middle with no visual damage.
Not that it can't work but I know that the manufacturer of the Pi WebCam that I use (Longruner) only recommends ribbon cables of 1M or less due to attenuation.
So true. In an original setup I had an unshielded 10cm ribbon cable close to an equally unshielded USB power cord of an Ikea desk lamp - and boy did the image flicker and cycle through colours... at first I thought the cam had gotten stuck on some acid trip
Shielding or even just physical distance between the two cords worked magic fortunately.
It's a Pi ribbon cable to HDMI adapter.
Reason to build it was that I didn't found one to buy and additional I need I2C and 5V power besides standard Pi 3,3V at the camera.
HDMI cable has special shielded cable pairs, what will transfer signals better over longer distance.
And there are more wires then Pi need, so it's possible to use one HDMI cable only for all.
In the *.zip, there is also a small eagle library with special parts that are used.
Eagle will need it. Additional a HDMI connector is also in that library.