Jump to content
  • 0

Mainsail USB Camera Question


Carter

Question

Hi, I've just decided to add a camera to my printer using Mainsail and Crowsnest, however, it shows as "No signal." 

Crowsnest config

#### crowsnest.conf
#### This is a typical default config.
#### Also used as default in mainsail / MainsailOS
#### See:
#### https://github.com/mainsail-crew/crowsnest/blob/master/README.md
#### for details to configure to your needs.


#####################################################################
####                                                            #####
####      Information about ports and according URL's           #####
####                                                            #####
#####################################################################
####                                                            #####
####    Port 8080 equals /webcam/?action=[stream/snapshot]      #####
####    Port 8081 equals /webcam2/?action=[stream/snapshot]     #####
####    Port 8082 equals /webcam3/?action=[stream/snapshot]     #####
####    Port 8083 equals /webcam4/?action=[stream/snapshot]     #####
####                                                            #####
#####################################################################
####    RTSP Stream URL: ( if enabled and supported )           #####
####    rtsp://<ip>:<rtsp_port>/stream.h264                     #####
#####################################################################


[crowsnest]
log_path: /home/ctn3770/printer_data/logs/crowsnest.log
log_level: verbose                      # Valid Options are quiet/verbose/debug
delete_log: true                       # Deletes log on every restart, if set to true
no_proxy: false

[cam 1]
mode: mjpeg                  # ustreamer - Provides mjpg and snapshots. (All devices)
                                        # camera-streamer - Provides webrtc, mjpg and snapshots. (rpi + Raspi OS based only)
enable_rtsp: true               # If camera-streamer is used, this enables also usage of an rtsp server
rtsp_port: 8554                         # Set different ports for each device!
port: 8080                              # HTTP/MJPG Stream/Snapshot Port
device: /dev/v41/by-id/usb-GENERAL_GENERAL_-_UVC-video-index0       # See Log for available ...
resolution: 1280x720                 # widthxheight format
max_fps: 30
# If Hardware Supports this it will be forced, otherwise ignored/coerced.
#custom_flags:                          # You can run the Stream Services with custom flags.
#v4l2ctl:                               # Add v4l2-ctl parameters to setup your camera, see Log what your cam is capable of.



Crowsnest Log

[09/07/23 16:21:58] crowsnest: crowsnest - A webcam Service for multiple Cams and Stream Services.
[09/07/23 16:21:58] crowsnest: Version: v4.0.4
[09/07/23 16:21:58] crowsnest: Prepare Startup ...
[09/07/23 16:21:58] crowsnest: INFO: Host information:
[09/07/23 16:21:58] crowsnest: Host Info: Distribution: Raspbian GNU/Linux 11 (bullseye)
[09/07/23 16:21:58] crowsnest: Host Info: Release: MainsailOS release 1.2.1 (bullseye)
[09/07/23 16:21:58] crowsnest: Host Info: Kernel: Linux 6.1.21-v8+ aarch64
[09/07/23 16:21:58] crowsnest: Host Info: Model:  Raspberry Pi 4 Model B Rev 1.5
[09/07/23 16:21:58] crowsnest: Host Info: Available CPU Cores: 4
[09/07/23 16:21:58] crowsnest: Host Info: Available Memory: 3705536 kB
[09/07/23 16:21:58] crowsnest: Host Info: Diskspace (avail. / total): 729M / 7.0G
[09/07/23 16:21:58] crowsnest: INFO: Checking Dependencies
[09/07/23 16:21:58] crowsnest: Dependency: 'crudini' found in /usr/bin/crudini.
[09/07/23 16:21:58] crowsnest: Dependency: 'find' found in /usr/bin/find.
[09/07/23 16:21:58] crowsnest: Dependency: 'xargs' found in /usr/bin/xargs.
[09/07/23 16:21:58] crowsnest: Dependency: 'ustreamer' found in bin/ustreamer/ustreamer.
[09/07/23 16:21:58] crowsnest: Dependency: 'camera-streamer' found in bin/camera-streamer/camera-streamer.
[09/07/23 16:21:58] crowsnest: Version Control: ustreamer is up to date. (v5.42)
[09/07/23 16:21:59] crowsnest: Version Control: camera-streamer is up to date. ((ef8f6a4))
[09/07/23 16:21:59] crowsnest: INFO: Print Configfile: '/home/ctn3770/printer_data/config/crowsnest.conf'
[09/07/23 16:21:59] crowsnest:        [crowsnest]
[09/07/23 16:21:59] crowsnest:        log_path: /home/ctn3770/printer_data/logs/crowsnest.log
[09/07/23 16:21:59] crowsnest:        log_level: verbose
[09/07/23 16:21:59] crowsnest:        delete_log: true
[09/07/23 16:21:59] crowsnest:        no_proxy: false
[09/07/23 16:21:59] crowsnest:        
[09/07/23 16:21:59] crowsnest:        [cam 1]
[09/07/23 16:21:59] crowsnest:        mode: mjpeg
[09/07/23 16:21:59] crowsnest:        
[09/07/23 16:21:59] crowsnest:        enable_rtsp: true
[09/07/23 16:21:59] crowsnest:        rtsp_port: 8554
[09/07/23 16:21:59] crowsnest:        port: 8080
[09/07/23 16:21:59] crowsnest:        device: /dev/v41/by-id/usb-GENERAL_GENERAL_-_UVC-video-index0
[09/07/23 16:21:59] crowsnest:        resolution: 1280x720
[09/07/23 16:21:59] crowsnest:        max_fps: 30
[09/07/23 16:21:59] crowsnest: INFO: Detect available Devices
[09/07/23 16:21:59] crowsnest: INFO: Found 1 total available Device(s)
[09/07/23 16:21:59] crowsnest: INFO: Found 1 available v4l2 (UVC) camera(s)
[09/07/23 16:21:59] crowsnest: /dev/v4l/by-id/usb-GENERAL_GENERAL_-_UVC-video-index0 -> /dev/video0
[09/07/23 16:21:59] crowsnest: Supported Formats:
[09/07/23 16:21:59] crowsnest:        [0]: 'MJPG' (Motion-JPEG, compressed)
[09/07/23 16:21:59] crowsnest:        Size: Discrete 1280x720
[09/07/23 16:21:59] crowsnest:        Interval: Stepwise 0.033s - 0.033s with step 0.000s (30.000-30.000 fps)
[09/07/23 16:21:59] crowsnest: Supported Controls:
[09/07/23 16:21:59] crowsnest:        
[09/07/23 16:21:59] crowsnest:        User Controls
[09/07/23 16:21:59] crowsnest:        
[09/07/23 16:21:59] crowsnest:        brightness 0x00980900 (int)    : min=1 max=255 step=1 default=48 value=48
[09/07/23 16:21:59] crowsnest:        contrast 0x00980901 (int)    : min=1 max=127 step=1 default=36 value=36
[09/07/23 16:21:59] crowsnest:        saturation 0x00980902 (int)    : min=1 max=127 step=1 default=64 value=64
[09/07/23 16:21:59] crowsnest:        hue 0x00980903 (int)    : min=-128 max=127 step=1 default=0 value=0
[09/07/23 16:21:59] crowsnest:        gamma 0x00980910 (int)    : min=0 max=20 step=1 default=0 value=10
[09/07/23 16:21:59] crowsnest:        sharpness 0x0098091b (int)    : min=0 max=3 step=1 default=3 value=3
[09/07/23 16:21:59] crowsnest:        backlight_compensation 0x0098091c (int)    : min=0 max=127 step=1 default=8 value=8
[09/07/23 16:21:59] crowsnest: Try to start configured Cams / Services...
[09/07/23 16:22:00] crowsnest: INFO: Configuration of Section [cam 1] looks good. Continue ...
[09/07/23 16:22:00] crowsnest: V4L2 Control: No parameters set for [cam 1]. Skipped.
[09/07/23 16:22:02] crowsnest: Starting ustreamer with Device /dev/v41/by-id/usb-GENERAL_GENERAL_-_UVC-video-index0 ...
[09/07/23 16:22:04] crowsnest:  ... Done!
[09/07/23 16:22:04] crowsnest: WATCHDOG: Lost Device: '/dev/v41/by-id/usb-GENERAL_GENERAL_-_UVC-video-index0'

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
27 minutes ago, Carter said:
[cam 1]
mode: mjpeg                  # ustreamer - Provides mjpg and snapshots. (All devices)
                                        # camera-streamer - Provides webrtc, mjpg and snapshots. (rpi + Raspi OS based only)

This needs to be changed to :

mode: camera-streamer

Also in your mainsail setup, ?action=stream, needs to be replaced with webrct.

See here for full explanation.

image.thumb.png.3643b18269fd2a8fde2e53a519ec3653.png

For raspi cam troubleshooting, see this section.

Hope it helps

 

Link to comment
Share on other sites

  • 0

Just tried this, it shows that is is connecting, but the webcam isnt loading. It also shows an error in crowsnest log saying,

 

[09/07/23 17:09:20] crowsnest: WATCHDOG: Lost Device: '/dev/v41/by-id/usb-GENERAL_GENERAL_-_UVC-video-index0'

Edit-Now it is displaying a grey background

Edited by Carter
Link to comment
Share on other sites

  • 0

[cam 1]
mode: ustreamer                         # ustreamer - Provides mjpg and snapshots. (All devices)
                                        # camera-streamer - Provides webrtc, mjpg and snapshots. (rpi + Raspi OS based only)
enable_rtsp: false                      # If camera-streamer is used, this enables also usage of an rtsp server
rtsp_port: 8554                         # Set different ports for each device!
port: 8080                              # HTTP/MJPG Stream/Snapshot Port
device: /dev/video0                     # See Log for available ...
resolution: 1280x960
#resolution: 640x480                     # widthxheight format
max_fps: 30                             # If Hardware Supports this it will be forced, otherwise ignored/coerced.
#custom_flags:                          # You can run the Stream Services with custom flags.
#v4l2ctl:                               # Add v4l2-ctl parameters to setup your camera, see Log what your cam is capable of.

is the camera to usb then must "ustreamer" activate

It is also sufficient to set the path to /dev/video0. You do not need to enter the ultra-long one.

 

greetings

Ralf

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...