Repository: OctoPrint

I’m away from my setup this weekend, so won’t be able to look at it right now. Some ideas:

  • Could you check if there is anything in the logs?
  • What power supply do you use, does it provide enough power (amps)?
  • Could you check another USB port, if available.
  • Does the USB camera work properly if you connect it to a computer?

Hey,
It happens on both USB 2.0 and 3.0 ports, I’ve now tried two of the same camera and it happens with both and they work fine on a normal computer.
I’ve just put a 12hr print on so will put another small print on after it and then grab the logs.
It’s like the USB loses power and can get it back.
The power supply is a genuine rPi one, I think they are 2.5a but I can double check

ive just finished an ~8hr print and the camera worked the whole time, but the light in the room turned off haha so the lapse wasn’t great. I forgot about the automation’s for that room.
I pulled the logs about 15min after it finished, and then i tried another print that failed due to the camera. I tried the ‘start camera’ and then print and it failed, then i tried the ‘stop camera’ and then ‘start camera’ then print and that worked.
i’m not sure if its my camera settings or actual camera but when it does work its pretty crappy quality. heres an example of what i mean…I’m aware that the camera angle is less than ideal

Regarding that it seems to power off the USB ports, I assume you don’t use a plugin like this: TokugawaHeavyIndustries/OctoPrint-USBControl: An OctoPrint plugin to allow USB ports to be programmatically turned OFF and ON from within the web interface (github.com)? I’ll have to test some back-to-back prints with camera enabled and see if I can recreate the issue.

For the camera quality, what arguments do you use for mjpg_input? If your camera is listed on USB webcams known to work with mjpg-streamer - Get Help / FAQ - OctoPrint Community Forum you could try with the arguments listed there. Perhaps start with adding -e to reduce bandwidth consumption.

Update: I’ve done 3 prints using virtual printer and enabled timelapse every 10 seconds (using Pi camera), no issues encountered.

I’ve used similar arguments for the camera as a similar model with same specs. Not to sure what’s going on and why it keeps dropping out. I can deal with it for now anyway.

The USB power cycling plug in could be an issue though because it says it resets all the USB ports which would include the connection from the pi to my printer.

Just for anyone else that comes across the same issues as me; i’ve given up on the logitech c925e. Great camera for video conferecing etc but doesn’t seem too suited to this application. I might give it another go some other time when ive got more time.
I swapped to the raspicam 5mp and had a different set of dramas. i had to take the SD card out of the pi and put it in another pc to edit the config.txt file as outlined in - Getting the Raspberry Pi Camera to Work on HASSOS · GitHub
from there i couldnt get it working through the inbuilt mjpg-streamer with the octoprint add-on; however; if i use the seperate mjpg-streamer it work.i’ve updated the stream addresses in octoprint and octolapse and the quality looks good. i’m just about to try a print with octolapse and the live stream to see how it goes.
Oh the added bonus of using the seperate mjpg-streamer is that you don’t need to use ‘start camera’ from the power options menu

Interesting that the Pi camera works with the separate ‘mjpg-streamer’ but not with ‘mjpg-streamer’ in the OctoPrint Next addon, as both should be based on the same source code. I’ll have to make a clean install and verify the behavior later, may take a few weeks though.

Did you try the c925e with the separate addon? It should have the same behavior, but I’m curious as there was a difference for the Pi camera.

Nope, I didn’t think about using the seperate Mjpg-streamer until the pi cam wasn’t working, I did want to change to the pi cam anyway mainly due to size/weight difference.
I did have a bit of an issue where a print got hung up due to losing comms with the rPi and I had to do a hard reset now I’m getting a few errors in octoprint. I’ve got a core update due so I’ll back up, update, restart and see if it’s still there after a sort restart.
Here is an octolapse using the pi cam which you can compare to the Logitech one I posted earlier

On my ancient (2010) Mac book pro I’m getting a settings load error when using the browser.
Only started since the disconnect issue I had yesterday.
Here’s a screenshot

Might give the old girl a courtesy restart for good measure haha

Ok next issue,
I don’t quite understand what’s happening. But it’s happened 3 times now. The pi with HA and Octo on it seems to disconnect from the network (I don’t think this usually happens but unsure) and then the print stalls at that point.
That’s what I don’t understand; if I’ve uploaded the gcode to octoprint why would network connectivity cause it to stall if the printer is connected to the pi via cable?
Ah actually maybe the pi itself is crashing

So other ppl don’t lose 1day figuring this one out.

The way to connect this add-on GitHub - fredrikbaberg/hassio-addons: Intended home for hassio addons, if time allows.
from CURA octoprint is NOT to go to the link you get on the UI when you open the addon UI.

like https://servername/774437fd_octoprint/dashboard

But you have to enable the 5000 port on the addon


and then either reverse proxy to that port or just use the plain old IP to connect to it.

Have you figured out something new regarding this? Is it the Pi itself crashing? If so, that would also explain the issues with the camera.

I’ve noticed an issue with loss of connectivity when trying to add a bed level visualizer plugin, where the system attempted to build numpy from source. There will be an update to the addon (OctoPrint Next) with numpy included within an hour or so. Update: “Bed Level Visualizer” plugin uses a different version of numpy, so I’ll skip the update for now.

I think the camera issue was a power issue. I don’t think the pi can supply enough for a stable stream.
But due to the crashing of the pi I decided to uninstall and just use a separate pi with the octopi image.
No discredit to you, you’ve done great work. I was just lazy and didn’t want to figure out why it was crashing.

The important part is that it works well for you.
If you, or anyone else, figure out why it did not behave properly - and if it is something I can try to fix - please let me know.

1 Like

After some new issues on the GitHub repository, I’ve started to work on an updated version. If you’ve noticed some bugs or have feature requests, please make sure they are added to the GitHub repository issues so that I can take them into consideration.

I’m looking at changing base image - this means upgrading from the current addon version will not be possible, so it will probably be another version.

1 Like

New version is live, it’s simply called “3DPrinter”.

  • Still based on Alpine (I noticed a 50% increase of image size with the change of base image which I considered too much).
  • If mjpg-streamer is enabled in addon options it starts automatically.
  • Klipper included in the addon. Moonraker has been added but not tested. Both are disabled by default.

My plan is to deprecate all existing variations of OctoPrint addons and eventually remove them. I need to test it some more to see that I haven’t broken anything that worked before, printing was just tested.

Hopefully I can change the stage from “experimental” to “stable” by the end of this month.

Note: I haven’t tried to migrate from any previous version of the addon, so I don’t know if that will work. I’ve moved some files around, you there will most likely be differences in config.yaml. You can find the updated file in: hassio-addons/config.yaml at master · fredrikbaberg/hassio-addons (github.com)

Thanks for your work, i’ve been using your plugin since my begining with HA.

Just migrate from Octoprint to the new plugin 3D printer, backup seem to be working without major issues.
Only my printer profile was missing but this is a matter of seconds to make it again. And of course my database of spool manager but that’s on me, i’ve completely forget to export it.
Need mor time to see if there is any problem with the backup but so far it look complete !

Nice work :stuck_out_tongue:

I can’t start this plugin. I tried everything what I can with this and still…

[22:27:13] INFO: OctoPrint cont-init.d
Traceback (most recent call last):
  File "/data/python/octoprint/bin/octoprint", line 8, in <module>
    sys.exit(main())
  File "/data/python/octoprint/lib/python3.9/site-packages/octoprint/__init__.py", line 959, in main
    from octoprint.util.fixes import patch_sarge_async_on_py2
  File "/data/python/octoprint/lib/python3.9/site-packages/octoprint/util/__init__.py", line 52, in <module>
    from octoprint.util.connectivity import ConnectivityChecker  # noqa: F401
  File "/data/python/octoprint/lib/python3.9/site-packages/octoprint/util/connectivity.py", line 12, in <module>
    from octoprint.util.net import resolve_host, server_reachable
  File "/data/python/octoprint/lib/python3.9/site-packages/octoprint/util/net.py", line 14, in <module>
    import netifaces
ModuleNotFoundError: No module named 'netifaces'
[cont-init.d] octoprint.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
s6-nuke: fatal: unable to kill: No such process

I assume this is with the 3DPrinter addon, on what hardware and architecture? Was this from a clean install of the addon or did you attempt to restore a backup?

There is an issue for this on GitHub OctoPrint + DietPi + Supervised install = missing netifaces library · Issue #237 · fredrikbaberg/hassio-addons (github.com), we’re trying to figure out if it’s only occurring on a certain architecture.

RB 4B+ with HA OS. Clean instalation, no backups.