Another "muli-instance problem"

What is the problem?

I hope I'm doing it right here , if not please move that to the "docker-section"
I installed 2 instances using this guide

both instances are working fine, but MJPG-Streamer is not reachable at the second instance with
redirected port. default-port for the mjpg-streamer is 8080 and it is redirected/forwarded to 8081.
But its not available at 8081, only 8080.

What did you already try to solve it?

I tried to re-configure the docker composer-file, gave both containers a static IP and the ports
tried to change the order, gave other ports and double checked the firewall-settings.
The instances are reachable at port 5000 and 5001, so all is fine.

Have you tried running in safe mode?

No, Octoprint itself is running fine, so no need to

Did running in safe mode solve the problem?

no

Systeminfo Bundle

Additional information about your setup

OctoPrint version: 1.7.2
printer: Ender3 Pro, Forge-Bot, FLSUN QQS Pro, Prisa i3 MK3is
Firmware: Marlin, Smoothieware, FLSUN own stuff, like Prusa
Browser: Edge, Chrome, Firefox
Operating system: WIndows 10, Windows 11, DietPi

to prevent misunderstandings : Octoprint is working fine, my only problem is : no webcam support in docker container 2, because mjpg is not reachable.

Here is my docker-composer file :

1version: '3.6'
2 services:
3 #####Ender3_Pro
4 Octoprint1:
5 container_name: Ender3
6 image: octoprint/octoprint
7 hostname: Ender3
8 restart: unless-stopped
9 ports:
10 - "5000:5000"
11 - "8080:8080"
12 volumes:
13 - /home/dietpi/docker/octoprint1:/octoprint1
14 environment:
15 - ENABLE_MJPG_STREAMER=true
16 - MJPG_STREAMER_INPUT=-n -d /dev/video0:/dev/video0 -r 1280x720 -f 20
17 devices:
18 #Printer Port
19 - /dev/ttyUSB0:/dev/ttyACM0
20 #Webcam port
21 - /dev/video0:/dev/video0
22
23 #####FLSUN_QQS_pro
24 Octoprint2:
25 container_name: FLSUN
26 image: octoprint/octoprint
27 hostname: FLSUN
28 restart: unless-stopped
29 ports:
30 - "5001:5000"
31 - "8081:8080"
32 volumes:
33 - /home/dietpi/docker/octoprint2:/octoprint2
34 environment:
35 - ENABLE_MJPG_STREAMER=true
36 - MJPG_STREAMER_INPUT=-n -d /dev/video1:/dev/video0 -r 1280x720 -f 30
37 devices:
38 #Printer Port
39 - /dev/ttyUSB1:/dev/ttyACM1
40 #Webcam Port
41 - /dev/video1:/dev/video0

if you have any suggestions, please let me know. I wasted more than a day right now to get this up and running, and its pretty much frustrating.

Regards
MAMEniac.

Are you able to get into the container to try and find some sort of log file? I'm not familiar with the inner workings of the docker container to try and help. But it might hold the answer for you. I know the container will be generating some sort of log somewhere.

Actually, looking at the compose file - why is there the two devices /dev/video1:/dev/video0 in the mjpg streamer line? Not sure if it will work like this. I would have thought it should just be /dev/video0, with the device mapping you have elsewhere.

its like the ports. on the left side you have the host, and on the right the one gave into the container.
So if you like to reach your webserver on Port 666 you need to put Ports: 80:666 and same with the video device: one the the physical port where the cam is connected and I hand it over to the container at video0 so nothing need to be reconfigured. And no logfile is beeing created. MJPG is just not listening. These are two identical container created from the same image one is working, one not. MJPG is listening on Port 8080 by default. so I forwarded all incoming connection to that port. Its working on container one, but not in the second one. But only with MJPG .. OctoPrint is listening on Port 5001 as configured.
And no, it not a firewall problem. (just sayin' before you ask)
There is absolute no reason why that port is not getting forwarded into the second container.

of course you can go inside a container ..
its working like a normal machine.
Just open a shell inside it and do what ever you want.

Good morning and "god dammit i found it" ..
Sleep is the best thing you can do to find solutions.
Fact is : @Charlie_Powell your hint was the initial ignition ...
everything was well configured, but NOT the port where the 2nd USB is connected.
The first one is /dev/vidceo0 but the second one is NOT /dev/video1, because the RasPi 3B+ is having an internal USB hub, its /dev/video2 and I give it into the container as video0 .. THATS IT !

Your hint made me thinking about it !
You saved my day !
Thank you very much !

Regards
MAMEniac

You are going to run into these connection issues again, with both cameras and printers, on every reboot unless you provide some udev rules. There are tools for auto-detection and assignment of printer udev entries as part of octoprint_deploy on github.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.