[Support] Octoprint docker template - Spants


Recommended Posts

Has anyone had any luck adding multiple instances of this with two different webcams?

 

I was able to get two docker instances running, with a webcam on one, but since plugging in a second webcam that is the only one I can get working.

 

I have been attempting to read the appropriate documentation, but I am having a hard time understanding exactly how DVB drivers are interacting with the Octoprint container to be able to figure it out for myself.

 

Edit: I got it working! You just need to set it to video1 instead of video0, and it all works. The trouble I was getting before was trying to do all of my changes in an already existing doctor directory. I'm using all the wrong words, but basically I just made a new docker container from scrath and then it all worked perfectly. Thanks for making an awesome tool!

Edited by RutgerPVH
Link to comment

Hi,

i´m trying to set up my camera resolution, but it won´t work for me. It´s reset to default every time.

I receive the following error in the log:

 

i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 2560 x 1440
i: Frames Per Second.: 15
i: Format............: YUYV
i: JPEG Quality......: 80
i: TV-Norm...........: DEFAULT
i: The specified resolution is unavailable, using: width 1280 height 720 instead
i: FPS coerced ......: from 15 to 10
o: www-folder-path......: /usr/local/share/mjpg-streamer/www/

image.thumb.png.05f423a4f6972caa831efe668564f6a4.png

 

 

Due missing file at "/boot/config.txt" i´m not able to test it the "official" way. I laso played with mjpg settings a bit, but no success. Did someone managed to handle this?

 

Regards

Marc

Link to comment
  • 2 weeks later...

How do I connect to a specific printer if I'm running multiple printers? I have 2 of the same printers (both elegoo neptune 2s) and I've made 2 instances of the docker with different ip ports.

 

I tried to change the Printer USB Port variable for each template but there's only one choice and so when I run the 2 instances and connect, one will connect successfully to one printer and when I try to connect with the 2nd instance it just tries to connect to the same printer as the first.

Link to comment

Hi everyone,

I'd like to update my printer firmware via the plugin "Firmware Updater". To make this work the tool avrdude has to be installed. Is there any way to install it in this docker container? 

 

Any help is appreciated!

 

Best regards

Stefan

EDIT: Actually this docker template comes with avrdude preinstalled, so I just had to enter the path /usr/bin/avrdude in the plugin settings! :)

Edited by SiggiSpak
  • Like 1
Link to comment
  • 3 weeks later...

Hi there,

I have two Dockers running with Octoprint. My two printers connect and work as well. I have a webcam for each printer, but I can't get both to work. Only the one whose Docker starts first will work. Of course I adjusted the ports (5005, 5006 & 5007) and the video DEV to video2. Docker internally I can't change the ports (80 and 8080). Maybe there is the problem?

 

Next I would like to control one of the two printers with klipper. How to install this? Is that even possible? I'm a complete newbie to Docker.

 

Can anyone give me tips on how to get the cams and Klipper to work?

Link to comment
2 hours ago, Notrial said:

Hey all, I installed the container but it won't start for some reason.

It throws this error: Execution error / server error...

 

This is my configuration.

 

Any clues? 😅

 

 

 

 

 

Hey Notrial,

maybe you didn't choose the right printer USB port.

It still looks like the original settings
 
Try to choose the ttyusb0 or suitable for you by selecting it.

1.png.df1cc89add31a299694b01c15eff0888.png

 

For me, TTYUSB0 is the first printer and TTYUSB1 is the second.

 

2.png.5a0214fc35540a3b0be9eac121ff54f2.png

 

 

Link to comment

That's a point, but to test whether the printer wants to respond at all, ttyusb is ok.  
/dev/serial/by-id/ usb_Prusa_Reserve… was also the default in my installation and didn't work.  
The hint that it is better to use /dev/serial/by-id would have come after the success message.  

 

Link to comment
16 hours ago, BiggDad said:

Hey Notrial,

maybe you didn't choose the right printer USB port.

It still looks like the original settings
 
Try to choose the ttyusb0 or suitable for you by selecting it.

1.png.df1cc89add31a299694b01c15eff0888.png

 

For me, TTYUSB0 is the first printer and TTYUSB1 is the second.

 

2.png.5a0214fc35540a3b0be9eac121ff54f2.png

 

 

That was it! in my case ttyACM0!

Managed to setup Logitech C525 as well 🎉

Thanks!

Link to comment
On 3/3/2022 at 9:01 PM, spants said:

best to use the /dev/serial/by-id/ method rather than usbtty as the port may change if you plug the printers in differently 

Great,

now the hint from spants applies.
Under /dev/serial/by-id/ choose the right connection to your printer (should only be one if nothing else is connected) and see if everything works after restart the Octoprint-Docker.

 

 

Edited by BiggDad
Link to comment
  • 2 weeks later...

Can somebody help me get webcam working?

I setup Octoprint with this template and my settings are as indicated below:
 

Capture.thumb.PNG.36158893ddeb8ebd4c733669c3f629fc.PNG

The printer is detecting fine, but the webcam doesnt work.  I enter http://192.168.1.102/?action=stream in the test URL in Octoprint but nothing comes up.


Capture2.thumb.PNG.7adb0297ebc18fee9d1982571c3d7f89.PNG


SOLVED!!!

I have figured out a solution in case anybody comes across this in the future having the same issue.

First off, if your webcam is showing up as a USB device when you type the command "lsusb" in unraid, but NOT assigning a dev/video0 to it, it is a driver issue.  My picture above shows me using the USB Device ( dev/bus/usb/003/025) because I had no dev/video0.  I figured out that it was because my webcam (Logitech C270) was old and even tho is was listed correctly in USB devices, it was missing drivers.  This thread talks about this issue.  So I went to the Unraid app store and searched for DVB drivers by ich777 and installed that.  Upon server reboot, I was now getting a dev/video0 and dev/video1.  I tried both and the octoprint log spazed out with dev/video1 (so I guess that was incorrect) but worked correctly with dev/video0.

The last part of the puzzle was figuring out the stream URLs to enter in octoprints timelapse settings page.

They are:

Stream Url: http://xxx.xxx.xxx.xxx:5003/webcam/?action=stream
Snapshot URL: http://xxx.xxx.xxx.xxx:5004/?action=snapshot (This did work for me but then gave me problems later.  http://127.0.0.1:8080/?action=snapshot later worked for me)

I needed to enter the port numbers set on the unraid template.  the internal port numbers of 80 and 8080 dont work.  You can also test the stream url by just entering it in your browser, and should see your webcam if its working.

Edited by 007craft
Link to comment
On 3/3/2022 at 12:01 PM, spants said:

best to use the /dev/serial/by-id/ method rather than usbtty as the port may change if you plug the printers in differently 


When I use /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 (The only entry I have, and is indeed my printer as when I unplug it, that entry goes away), it doesn't work.  But when I use /dev/ttyUSB0 it works.  Why is this?

Edited by 007craft
Link to comment

Is there a way to get multiple webcams working with this template?  I know it can be done, and theres an octoprint plugin to view multi webcams easily and octolapse also works with multiple webcams.  I just cant figure out how to pass multiple cameras into the container.  A second mjpeg streaming instance needs to be made for the second webcam I believe.

Link to comment
11 hours ago, 007craft said:

Is there a way to get multiple webcams working with this template?  I know it can be done, and theres an octoprint plugin to view multi webcams easily and octolapse also works with multiple webcams.  I just cant figure out how to pass multiple cameras into the container.  A second mjpeg streaming instance needs to be made for the second webcam I believe.

 

You probably could by adding extra keys, but you can also spin up another docker (use one for each printer)-that is what I did!

 

Link to comment
On 3/19/2022 at 8:55 PM, 007craft said:


When I use /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 (The only entry I have, and is indeed my printer as when I unplug it, that entry goes away), it doesn't work.  But when I use /dev/ttyUSB0 it works.  Why is this?

 

I have no idea - it should work! (sorry, I know that isn't a proper answer. I will reinstall my setup and check in a couple of days)

Link to comment
On 3/23/2022 at 2:33 AM, spants said:

 

You probably could by adding extra keys, but you can also spin up another docker (use one for each printer)-that is what I did!

 


By key do you just mean another device variable, pointing to my next webcam (/dev/video2)?  How would I get the container to create another mjpeg streamer for the second camera?

Ideally I don't want a separate docker because its not a separate printer (Just one printer with multiple webcams).  And there is a plugin in octoprint to use multiple webcams. 

I guess I can run a second octoprint container and just use the stream url pasted into the first container, but it seems overkill to run a whole separate container and octoprint instance just to setup a second webcam for the first instance.  The only instructions I could find for setting up multiple webcams was for octopi, and it mentions editing a text file which I dont think the docker uses.

Link to comment
  • 2 weeks later...
On 3/19/2022 at 9:55 PM, 007craft said:


When I use /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 (The only entry I have, and is indeed my printer as when I unplug it, that entry goes away), it doesn't work.  But when I use /dev/ttyUSB0 it works.  Why is this?

 

I found it out. You need to add "/dev/serial/by-id/*" to the Octoprint settings of the additional serial connection ports:

image.png.352a0babdfabee3927e06f6a603d6b4f.png

 

Is this available as Container Variable? Maybe it can be prefilled so the user does not need to add it.

 

PS I was really confused about the port settings. The container uses port 80 for the web-ui, while the template uses port 80 for the webcam?! As I don't have a webcam by now, I changed it as follows:

image.thumb.png.c7f1a6d5c5ed9520d836b0a145fe5f4a.png

 

 

 

 

 

Link to comment

Is it possible to start this container without the printer?  Still waiting for my printer and I'm trying to test my webcam configuration.

Edit:  Figured it out.  Just removed the device mapping in the configuration for anyone who is wondering.

Edited by binarymelon
  • Like 1
Link to comment
  • 3 weeks later...

It seems as though every day this breaks for me - when I restart the docker after doing a backup, it moves all the keys around, resulting in the key for the USB ID of the printer being changed to the setting for camera, etc.

I don't have a camera plugged in and I have removed those entries to allow it to start - it works fine until it restarts and then it dies, so I have to reinstall it again.

 

Any workaround?

 

Link to comment
1 hour ago, abra5umente said:

It seems as though every day this breaks for me - when I restart the docker after doing a backup, it moves all the keys around, resulting in the key for the USB ID of the printer being changed to the setting for camera, etc.

I don't have a camera plugged in and I have removed those entries to allow it to start - it works fine until it restarts and then it dies, so I have to reinstall it again.

 

Any workaround?

 

If you use the "by-id" serial identification this won't happen as it uses the identity of the printer.  If you use ttyACM0 or ttyUSB1 methods, these can change

 

Link to comment
3 hours ago, spants said:

If you use the "by-id" serial identification this won't happen as it uses the identity of the printer.  If you use ttyACM0 or ttyUSB1 methods, these can change

 

Thanks - I do use the By-Id method - the issue is that the template changes the key from printer port to camera port - so it thinks the camera should be my printer.

Link to comment
18 hours ago, spants said:

If you use the "by-id" serial identification this won't happen as it uses the identity of the printer.  If you use ttyACM0 or ttyUSB1 methods, these can change

 

Had to wait for it to do a backup before I could show it.

It does this - I had previously removed the webcam device key, as well as ENABLE_MJPG_STREAMER, CAMERA_DEV, MJPG_STREAMER_INPUT, webcam, and snapshot. All I had was the printer USB port key - as you can see it's removed the printer USB port and replaced it with webcam device, which means the container doesn't start.

 

Now that I think about it - it could be because the printer is not powered on when it does a backup, so when it comes back the USB device does not exist, but I don't know why it would change the template.

 

I'll try creating an automation to turn the printer on during the backup window - however I have also tried setting community apps backup to ignore the octoprint folder, but it still happens. I've had plenty of containers where I've edited the templates and I've never had this happen.

Screen Shot 2022-05-01 at 12.19.03 pm.png

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.