Cura OctoPrint Connection plugin

Something went awry when I updated Cura from 4.8 to 4.9 and despite uninstalling/reinstalling, keeping/removing config, importing backup. This has dragged on to 4.10.
I have 2 printers running OctoPrint, requesting API key only works for 1, the other simply doesn't show the request button at all.
This is in detail what I attempted last, I'll include screenshots where relevant.

  • uninstalled cura and removed config
  • reinstalled cura 4.10, making sure previous versions were uninstalled (they seemed to linger despite having uninstalled)
  • reinstalled cura connection plugin.
    the same weird behavior persisted.
    I added a printer as part of the setup so on the manage printers screen I only see that with the Connect Octoprint button. Once this is clicked, I get the add printer screen, this is when the Ender 5 is selected

    As you can see in the screenshots, the request button just isn't there for the Ender 5. If I grab the API key from web interface, Settings>Features>Applications Keys, I get the message "The API key is not valid...."
    If I generate another key, same error message.
    Also, even if the API key checks out for the X5SA and it connects, it still doesn't add this printer so no way to select any printer unless it's added manually, local only.
    I can add an instance manually, it shows up in the "connect to OctoPrint", connects when supplied with the API key but is not added to printers and doesn't appear in the printer selection menu.

Strange...

thanks for taking the time, any help is appreciated.

Hello @OrAnGeWorX !

Have you checked the IP address? They sometimes change if you don't set them static before.

My IPs are set to be static... this wouldn't explain the missing Request button though

I've tried it here:

When I change the printer on the left side, for a brief moment there is no request button., but it appears then.
I assume, when you click Open in browser..., the WEB GUI appears.

my request button doesn't appear, even after a while... but as you said, open in browser open web GUI

Maybe @fieldOfView has a clue

it was mentioned somewhere at the beginning of this thread, so someone else had that but I figured since it was a 2yr-old post, I should be re-engaging the matter

If the "Request" button does not show up that either means that AppKey support is turned off on the OctoPrint instance, or that Cura is unable to get an affirmative response from the OctoPrint instance when it checks to see if AppKeys are supported. So this could mean either no response, or not an "ok" response.

If you get the "API key is not valid" message, that means that when trying to contact the OctoPrint instance with the API key, Cura did not get the response it expected. But it did get a response.

Is the OctoPrint instance a "plain vanilla" OctoPi instance, or is it somehow customised (eg custom haproxy rules such as an https redirect)?

If you go to Help -> Show configuration folder... in Cura, the cura.log file there may include additional hints about what is going wrong.

Thanks for the response!
I do have the https redirect setup. In fact, I recently went over the process to update the certs.
But the problem had appeared when I went from 4.8 to 4.9 when my printer configs got messed up and had to reset everything. Could only get the printers to work, only partially by restoring a cura backup. I was able to send jobs to both printers, though the API request wasn't there.
Also, not sure if that has anything to do but every couple days or so, Cura would complain that the printer with the connection issue has a bad config which needs to be reset, haven't reset as that was the same issue that came up when I went 4.8 to 4.9

As far as the cura.log is concerned, there seem to be lots of errors/warnings... Not sure what to check in there...

Thanks for the help

Edit: Update on log.

2021-07-04 08:52:36,394 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:479:25: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
2021-07-04 08:52:36,400 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:352:21: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
2021-07-04 08:52:36,405 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:338:21: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
2021-07-04 08:52:36,423 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:620: TypeError: Cannot call method 'getId' of undefined
2021-07-04 08:52:37,012 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:380: TypeError: Cannot call method 'getId' of undefined
2021-07-04 08:52:41,052 - DEBUG - [MainThread] cura.AutoSave._onTimeout [64]: Autosaving preferences, instances and profiles took 0.02302694320678711 seconds
2021-07-04 08:53:21,384 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Program Files/Cura/qml/QtQuick/Controls/Private/EditMenu_base.qml:159: ReferenceError: mouse is not defined
2021-07-04 08:53:24,699 - DEBUG - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction.testApiKey [263]: Trying to access OctoPrint instance at http://192.168.2.65:80/ with the provided API key.
2021-07-04 08:53:30,449 - DEBUG - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction.testApiKey [263]: Trying to access OctoPrint instance at http://192.168.2.69:80/ with the provided API key.
2021-07-04 08:53:46,687 - DEBUG - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction.testApiKey [263]: Trying to access OctoPrint instance at http://192.168.2.69:80/ with the provided API key.
2021-07-04 08:53:55,145 - DEBUG - [MainThread] cura.TaskManagement.OnExitCallbackManager.triggerNextCallback [51]: No more on-app-exit callbacks to process. Tell the app to exit.
2021-07-04 08:53:55,149 - INFO - [MainThread] cura.CuraApplication.closeApplication [609]: Close application
2021-07-04 09:03:45,580 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:620: TypeError: Cannot read property 'getId' of undefined
2021-07-04 09:03:45,593 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:620: TypeError: Cannot read property 'getId' of undefined
2021-07-04 09:03:46,116 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:380: TypeError: Cannot read property 'getId' of undefined
2021-07-04 09:03:47,512 - DEBUG - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction.testApiKey [263]: Trying to access OctoPrint instance at http://192.168.2.69:80/ with the provided API key.

As I tried to manually enter the printer info Vs the auto detection mode enabled.

As a follow up:

2021-07-04 09:10:36,122 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:479:25: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
2021-07-04 09:10:36,128 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:352:21: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
2021-07-04 09:10:36,132 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:338:21: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
2021-07-04 09:10:36,151 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:620: TypeError: Cannot call method 'getId' of undefined
2021-07-04 09:10:36,742 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:380: TypeError: Cannot call method 'getId' of undefined
2021-07-04 09:10:41,946 - DEBUG - [MainThread] cura.AutoSave._onTimeout [64]: Autosaving preferences, instances and profiles took 0.01407480239868164 seconds
2021-07-04 09:10:55,172 - DEBUG - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction.testApiKey [263]: Trying to access OctoPrint instance at http://192.168.2.65:443/ with the provided API key.
2021-07-04 09:10:55,188 - WARNING - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction._onRequestFailed [442]: Connection refused or timeout when trying to access OctoPrint at http://192.168.2.65:443/api/settings
2021-07-04 09:11:07,955 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:620: TypeError: Cannot read property 'getId' of undefined
2021-07-04 09:11:07,966 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:620: TypeError: Cannot read property 'getId' of undefined
2021-07-04 09:11:08,490 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:380: TypeError: Cannot read property 'getId' of undefined
2021-07-04 09:11:14,029 - DEBUG - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction.testApiKey [263]: Trying to access OctoPrint instance at https://192.168.2.65:80/ with the provided API key.
2021-07-04 09:11:14,047 - WARNING - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction._onRequestFailed [442]: Connection refused or timeout when trying to access OctoPrint at https://192.168.2.65:80/api/settings
2021-07-04 09:11:17,989 - DEBUG - [MainThread] cura.AutoSave._onTimeout [64]: Autosaving preferences, instances and profiles took 0.009298324584960938 seconds
2021-07-04 09:11:24,739 - DEBUG - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction.testApiKey [263]: Trying to access OctoPrint instance at http://192.168.2.65:80/ with the provided API key.
2021-07-04 09:11:35,411 - DEBUG - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction.testApiKey [263]: Trying to access OctoPrint instance at https://192.168.2.65:80/ with the provided API key.
2021-07-04 09:11:35,422 - WARNING - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction._onRequestFailed [442]: Connection refused or timeout when trying to access OctoPrint at https://192.168.2.65:80/api/settings
2021-07-04 09:11:55,594 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:620: TypeError: Cannot read property 'getId' of undefined
2021-07-04 09:11:55,603 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:620: TypeError: Cannot read property 'getId' of undefined
2021-07-04 09:11:56,120 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:380: TypeError: Cannot read property 'getId' of undefined
2021-07-04 09:11:58,099 - DEBUG - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction.testApiKey [263]: Trying to access OctoPrint instance at http://192.168.2.69:80/ with the provided API key.
2021-07-04 09:12:05,615 - DEBUG - [MainThread] cura.AutoSave._onTimeout [64]: Autosaving preferences, instances and profiles took 0.010035514831542969 seconds
2021-07-04 09:12:06,765 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:620: TypeError: Cannot read property 'getId' of undefined
2021-07-04 09:12:06,778 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:620: TypeError: Cannot read property 'getId' of undefined
2021-07-04 09:12:07,291 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [421]: file:///C:/Users/testdummy/AppData/Roaming/cura/4.10/plugins/OctoPrintPlugin/OctoPrintPlugin/qml/DiscoverOctoPrintAction.qml:380: TypeError: Cannot read property 'getId' of undefined
2021-07-04 09:12:09,636 - DEBUG - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction.testApiKey [263]: Trying to access OctoPrint instance at https://192.168.2.69:80/ with the provided API key.
2021-07-04 09:12:09,670 - WARNING - [MainThread] OctoPrintPlugin.DiscoverOctoPrintAction._onRequestFailed [442]: Connection refused or timeout when trying to access OctoPrint at https://192.168.2.69:80/api/settings

And both printers no longer connect... I could possibly revert the SSL setup, this is what's causing the problem clearly. Though it worked fine when I had initially done it, I really can't tell what broke,

Cheers

It looks like the plugin is having a problem following the redirect you configured.

The autodiscovery using Bonjour/Zeroconf by default advertises the http connection. You can configure it to directly advertise your SSL connection instead in config.yaml, by changing the useSsl and publicPort fields: Discovery Plugin β€” OctoPrint master documentation

The publicPort field should probably be set to 443; having an https connection on port 80 is unlikely (and it would conflict with the http connection that still has to be there for the redirect to work).

The last two lines in the latest log you posted shows you are trying to access an ssl connection on port 80. I think you have added an OctoPrint instance via the "Add" button, and checked the option to use HTTPS. You forgot to change the port number though.

1 Like

Thanks @fieldOfView
I'll look into your suggestion
and yes, I had tried to do the manual add on those 2 lines and I had attempted port 443 but that also didn't work... thought checking the HTTPS would "automatically" redirect to port 443

Thanks again
will keep you posted!

So I've tried what you were suggesting but that didn't make a difference... I went back to cura, set the port to 443 and checked the https and this time it did work. For both printers... Though there was a connection, the printers weren't being added to the printer selection menu. that's even stranger

After flashing anew, reinstalling everything with the newest versions and reinstalling plugins and reconnecting everything. I made some progress reconnecting Cura to Octoprint.

I have Cura sending and storing the Gcode.

But the file I upload doesn't show up in the Octoprint UI. That's where things end.

The port and Host IP and Hostname are all reachable.

Where should I look to fix this?
Thanks!

I can't help you much without logs. Both the OctoPrint logs and the Cura logs. The Cura logs can be found via Help -> Show configuration folder... The file you are looking for is Cura.log.

Upload both logs somewhere and post a link here.

Hi, first thanks for maintaining this. I was having trouble with the automatic turning on the printer option. It has two plugs greyed out in the settings: Unknown Plug (which is selected) and name(TP-link SmartPlug). I have the tp-link plugin to turn on printer when a file is uploaded, but i cant figure out how to get it turn on and startup a print. I get an error of "printer is already printing " or now "waiting for octoprint to complete g-code analysis.

Probably best to open a new thread.
Personally, I'm using PSU Control, which is "listening" on the commands (G-code) to start the printer.

If you're using the OctoPrint Connection plugin in Cura, then it's handling the power-on the way it does for my plugins as well. So your gcode start isn't actually taking effect since you can't send gcode with a disconnected printer.

Thanks I will try out that psu control.

Yep


same problem, except now instead of T-link Smartplug listed in grey, it says PSU control, and still not selectable.