Repository: OctoPrint

I suspect the issue is with Ingress itself (I think I’ve seen such an issue mentioned), but I’ll need to test it a bit. Currently I’m unable to allocate time for this, but I’ll try to investigate it during this month.

Hello, I have this installed and running but I can’t seem to connect Prusa Slicer to Octoprint.
In Prusa slice you enter the IP and API key of Octoprint so I entered the IP of my Homeassistant Rpi bu Prusa Slicer can’t find it also tried the bonjour name and port but still no luck Prusa slices also has a network search option but again it can’t find Octoprint on Home Assistant.

Any ideas?

I’m not using PrusaSlicer right now, but it should work if you:

  • Set WebUI port in addon settings (port 5000 by default)
  • Use homeassistant.local:5000 instead of homeassistant.local:8123 (assuming you’re using port 5000).
1 Like

Does anyone have example config of getting a usb webcam that’s plugged into the system running Hassio / Octoprint working?

1 Like

Here is something that works for me.

Wbcam configuration in OctoPrint:


Camera configuration in HA:

camera:
  - platform: mjpeg
    name: OctoPrint
    still_image_url: http://192.168.52.37/webcam/?action=snapshot
    mjpeg_url: http://192.168.52.37/webcam/?action=stream

HA card configuration to show image from camera (normally it is still image, you need to click on it to see live stream in popup):

aspect_ratio: 74%
camera_image: camera.octoprint
entity: camera.octoprint
image: 'http://octopi.local/webcam/?action=stream'
show_name: false
show_state: false
type: picture-entity

I have the same issue, as this been solved in any way?

Only way I’ve found is to add a port to OctoPrint via the supervisor and visit that directly… eg. https://myhass:5000

2 Likes

Could you be more detailed that I need to do it too?
Otherwise does anyone know how to do it?

I thank you in advance

Thank you! That “solved it”… it would be better to have it within HA. But certainly not critical.

Supervisor->Octoprint->Configuration->In the network tab, type 5000 next to WebUI.
Save and restart.
Then access Octoprint via your homeassistant URL but at port 5000.

Guys I can’t update octoprint, nor install any plugin.

It looks like octoprint can’t access the internet. it’s always saying:

Failed to establish a new connection: [Errno -2] Name does not resolve

Thanks! From here it works, but opening web ui from HA I can’t see the webcam why?

An update to this addon:
I’m unsure how to safely update this to Python3 and the latest version of OctoPrint without the risk of breaking existing installs. That is one of the reasons I have not provided any update yet.

Edit: Will remove Py3 suffix and use “Dev” instead, to avoid having four (!) different versions. Warning remains.
You may have noticed the Python 3 version I added today. This is based on Python3 and OctoPrint 1.5.3, but the way I added it is very experimental and not tested. I would expect it to break whenever I update it. To avoid interfering with current installs, it currently uses a separate folder for configuration. Note that I have not tested this at all as my printer is offline for maintenance and I’m not sure when it will be back up and running.

Does everything else work on your network? My guess is this is due to a DNS issue, which is something I would not be able to debug.

Everything else works… updating ha for example works… so I guess it’s only octoprint container that can’t access internet…

Installed just fine but when prompted I went for an update inside the GUI, only to end up in error. Here’s what I found in the log:

image

2021-01-27 19:34:14,498 ! building 'psutil._psutil_linux' extension
2021-01-27 19:34:14,498 ! creating build/temp.linux-x86_64-2.7
2021-01-27 19:34:14,498 ! creating build/temp.linux-x86_64-2.7/psutil
2021-01-27 19:34:14,498 ! gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=580 -DPSUTIL_LINUX=1 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/data/python/include/python2.7 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_common.o
2021-01-27 19:34:14,498 ! unable to execute 'gcc': No such file or directory
2021-01-27 19:34:14,498 ! error: command 'gcc' failed with exit status 1
2021-01-27 19:34:14,498 ! ----------------------------------------
2021-01-27 19:34:14,498 ! ERROR: Command errored out with exit status 1: /data/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ral8An/psutil/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ral8An/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-JnkvwD/install-record.txt --single-version-externally-managed --compile --install-headers /data/python/include/site/python2.7/psutil Check the logs for full command output.

This is because the build packages are not included by default. If you set add_build_packages: true in the addon configuration and restart the addon, you should be able to update.

now I’m getting this error in the HA addon log and it won’t even start anymore :frowning:

2021-01-27 20:55:00,951 - octoprint.cli.server - ERROR - Uncaught exception
Traceback (most recent call last):
  File "/data/python/bin/octoprint", line 8, in <module>
    sys.exit(main())
  File "/data/python/lib/python2.7/site-packages/octoprint/__init__.py", line 615, in main
    octo(args=args, prog_name="octoprint", auto_envvar_prefix="OCTOPRINT")
  File "/data/python/lib/python2.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/data/python/lib/python2.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/data/python/lib/python2.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/data/python/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/data/python/lib/python2.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/data/python/lib/python2.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/data/python/lib/python2.7/site-packages/octoprint/cli/server.py", line 207, in serve_command
    ignore_blacklist)
  File "/data/python/lib/python2.7/site-packages/octoprint/cli/server.py", line 119, in run_server
    octoprint_server.run()
  File "/data/python/lib/python2.7/site-packages/octoprint/server/__init__.py", line 608, in run
    sockjs_url="../../static/js/lib/sockjs.min.js"))
  File "/data/python/lib/python2.7/site-packages/octoprint/vendor/sockjs/tornado/router.py", line 114, in __init__
    self._sessions_cleanup.start()
  File "/data/python/lib/python2.7/site-packages/tornado/ioloop.py", line 1209, in start
    self._schedule_next()
  File "/data/python/lib/python2.7/site-packages/tornado/ioloop.py", line 1237, in _schedule_next
    self._update_next(self.io_loop.time())
  File "/data/python/lib/python2.7/site-packages/tornado/ioloop.py", line 1244, in _update_next
    callback_time_sec *= 1 + (self.jitter * (random.random() - 0.5))
TypeError: unsupported operand type(s) for *: 'EPollIOLoop' and 'float'

I’m sorry, I thought I had fixed that. I just (intentionally) broke an install to verify this.

The quickest way will be to uninstall the addon, then reinstall. Plugins will be lost, but configuration should be safe (it’s stored in /config/octoprint which will not be deleted when addon is removed).

My plan was to not touch the Python2 (currently default) version of the addon, and focus on a newer Python3 based version, but I may have to reconsider that. I’m testing a fix now, but must at least:

  • make sure it fixes the issue after it appears.
  • test to upgrade an existing install.

Update:
It won’t be done today/tonight. Building takes some time and I haven’t tried it yet.

I’ll see if I can update to OctoPrint 1.5.3 while I’m at it.

1 Like

I’ve now published version 0.4.4, which should help. Changes include:

  • New install will have OctoPrint 1.5.3, previously 1.4.0.
  • Resolved a warning from HAProxy config.
  • Updated request_recovery. It will now install build packages before attempt to reinstall Python packages present in the previous install IF there are any packages not in the default install.

So far, I haven’t seen issues when I update my own system, but I always recommend a backup just in case something goes wrong.

For anyone using this addon still on OctoPrint 1.4.0 I would:

  • Create a backup. If you are using plugins which has their own backup/export feature make sure to also use that (I had issues with data missing from SpoolManager when I restored my backup on a clean install, haven’t figured out why).
  • Set build_packages true, restart, update OctoPrint, set build_packages false.

I believe the main issue was a change from OctoPrint 1.4.0 to 1.4.1 required some build tools, but I did not look further into this. I hope this latest update helps if it would happen again. I also want to point out the new feature in OctoPrint where you go to <OctoPrint WebUI>/recovery (will not work in Ingress), which could be helpful.