The webcam used at Trikarus is used to deal for monitoring purposes and timelapse videos. Public embedding of the screen would create much traffic so we keep it for internal use only. It's stream is embedded into Repetier Server, Duet Web Control, Grafana, Instar Mobile App and screenshots are sent by email once per day. The main target is to make timelapse videos while printing large objects or for testing. This shall help to analyse the printing routines.
Installation of mjpg_streamer (Repetier Server script)
Do not raise the fps to values higher than 10 because Firefox starts lagging/freezing. Details can be found at https://forum.repetier.com/discussion/comment/32058#Comment_32058. In Chrome it was tested to rn with 30 fps totally fluent.
Repetier Server settings
- shoot images every 10 seconds
- framerate: 30 fps
- bitrate: 8000 kbps
Warning: after a finished print the Raspberry Pi has higher system load because it will generate a timelapse video file. This can take into account more than an hour. The CPU temperature will rise
Adjusting webcam parameters (zoom, fokus, etc.)
The same settings can also be done with
Embedding of the webcam
The used webcam does not allow to flip the image by software settings. For this reason we have to rotate the image afterwards. In the different software (Repetier Server, DWC, Grafana) this can be done different ways. For embedding in Grafana a simple CSS transformation ca be used:
Raspbian Buster v4l-utils fix (0 fps, 0x0 resolution) →Since Buster the output of "/usr/bin/v4l2-ctl --list-formats-ext -d /dev/video0" is different than on Jessie or Stretch. See https://forum.repetier.com/discussion/7144/repetier-server-linux-webcam-script-chokes-on-raspian-buster/p1 for fix.
mjpgStart script modification
While resetting USB devices it sometimes happens that /dev/video$NR number changes. This leads to wrong port mapping for mjpg_streamer. The following modification was done to ensure that the webcam always appears on port 8080 and accepts random device number
Install ffmpeg and configure (for timelapse use on Repetier Server)
mjpg Webstream with Instar Vision App for Android
Instar supports mpjeg streams only with http - https does not work! Also the picture can not be rotated here!
Webcam images by mail
This script sends a webcam snapshot embedded into Email. It's just some kind of reminder to have a look at the print
Sending image as attachment instead can easily done by replacing bash content to:
This problem mostly belongs to undervoltage problem and the error with USB device addressing
- if power problem
- trigger PSU relay to switch off PSU (by Repetier Server or by command line)
- trigger uhubctl script to power down USB hub
- trigger uhubctl script to power up USB hub again after some seconds
- trigger PSU relay to switch on PSU again
- a regular reboot of hangdevice does not help. You need to de-power the devices for a short amount of time
- if mpjeg_streamer problem
- check port 8080 if mjpeg_streamer is running
- maybe restart mjpeg_streamer
- check if mjpeg_streamer is running at other ports instead, e.g. 8081