I’ve seen it…this is my first attempt at octoprint/pi and I’ve installed on my instance of HA. I’d firstly like to say thank you for creating this, I was googling ways to do this so I didn’t need to buy another pi to be a dedicated machine
I saw you said you were using the ‘next’ so that’s what I’ve installed.
Currently setting it up on my pi remotely so when I get home I can plug and play…fingers crossed.
A few of the how to’s and guides I’ve seen all mention about editing text for the stream in ‘octopi.txt’.
I know this is different to octopi because it’s not an image running on the pi but do we need to edit that text anywhere also?
Ive got 2 cameras, a Logitech 925 and a pi cam. I’m thinking I’ll try and set up the Logitech first and maybe add the pi cam as a nozzle cam down the track.
Editing octopi.txt is not possible for this addon, that file seems specific for OctoPi, but I believe you could use the addon configuration option mjpg_input. By default I use input_uvc.so -n, for more information about options see mjpg-streamer/README.md at master · jacksonliam/mjpg-streamer (github.com).
USB camera is not something I’ve tested myself, but I’d start with that as it should be the easiest to test. I’m using a Pi camera which requires some other changes - there should be more information in the documentation of the addon and earlier in this thread.
Multi-camera support is something I’ve considered recently, and should be possible, but would require some changes (in code for the addon, not just user configuration) to:
Handle multiple arguments to ‘mjpg-streamer’, as you want one -i <input_module> <arguments> for each camera.
Reverse proxy configuration (may be needed, not sure).
Until I’ve started with those changes, which I won´t have time to look at for at least 3 weeks, here are some other options to consider:
See if the camera stream can be added natively in Home Assistant. Not sure if it would be easy to add to OctoPrint though. Pi camera does not work natively in Home Assistant, as far as I know.
I have another addon I simply called ‘mjpg-streamer’, if you want to have the camera running separate from OctoPrint, or need a second instance of ‘mjpg-streamer’.
There is a plugin for OctoPrint I just noticed, called MultiCam, that may be relevant for multiple cameras. Nothing I’ve tested, I just noticed it.
Let me know if you find any issues with the ‘Next’ version. I’m using my printer for smaller / hobby prints, but so far it seems stable. There have been some plugins I need to configure with direct access (so not through Ingress) which may be good to know.
Thanks for the quick response. Just in name ‘multi cam’ sounds promising haha.
I should hopefully get some time this weekend to hook it all up.
I’ve got remote access through zero tier and I can get to the ui through a browser so it’s looking good so far.
I’d be happy just to get octoprint running even without the cam for the first few days and then worry about the cam/S later. But I will let you know if if come across anything.
And yep I’ve got the intent to read this whole thread; I did do a search for the ‘octopi.txt’ before posting to see if someone had brought it up.
All up and running the USB camera is pretty temperamental though. It will work after a reboot of the pi itself, not just octoprint; for 1 print and then after that it won’t work. Even using power menu to turn camera back on after the print doesn’t work.
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
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
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.
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.
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.