Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to open any .stl files at all. #16249

Open
bsaddresss opened this issue Jul 22, 2023 · 37 comments · May be fixed by #19025
Open

Unable to open any .stl files at all. #16249

bsaddresss opened this issue Jul 22, 2023 · 37 comments · May be fixed by #19025
Labels
Status: Under Investigation The issue has been confirmed or is assumed to be likely to be a real issue. It's pending discussion. Type: Bug The code does not produce the intended behavior.

Comments

@bsaddresss
Copy link

Cura Version

5.4.0

Operating System

Mac Catalina

Printer

Cr-10S

Reproduction steps

Cura 5.4.0 beta and fresh installed 5.4.0 will not open any .stl files. I've tried at least 15 of them, and nothing ever appears on the virtual build-late. I've tried uninstalls, new installs, restarts, new .stl's from tinkercad, opening .stl's from inside cura, changing default app to Cura... all of the .stl's will still open on prusaslicer.

Actual results

No Stl will appear on the virtual print bed.

Expected results

stl should appear on print bed

Add your .zip and screenshots here ⬇️

na

@bsaddresss bsaddresss added Status: Triage This ticket requires input from someone of the Cura team Type: Bug The code does not produce the intended behavior. labels Jul 22, 2023
@MariMakes
Copy link
Contributor

Hey @bsaddresss,

Welcome to the UltiMaker Cura Github 🚀
Thanks for your report 👍

Your issue sounds super frustrating 😖
It reminds me of a similar issue we received earlier this week.

Could it be that our STL reader plug-in is disabled by accident?
If you go to the marketplace, click on the gear, and scroll down until you see STL Reader, you should be able to Enable it again from there.
image

Can you let us know if that is your issue?
If that's not the case, just let us know we'll take another look. 👍

@MariMakes MariMakes added the Status: Needs Info Needs more information before action can be taken. label Jul 24, 2023
@bsaddresss
Copy link
Author

bsaddresss commented Jul 24, 2023 via email

@github-actions github-actions bot removed the Status: Needs Info Needs more information before action can be taken. label Jul 24, 2023
@dnbernier
Copy link

@bsaddresss
I have similar issue. I can get my STL's to load after I disable the USB Printing plug-in. Only downside is that printing via computer to usb will not work.

@MariMakes MariMakes added Status: Under Investigation The issue has been confirmed or is assumed to be likely to be a real issue. It's pending discussion. and removed Status: Triage This ticket requires input from someone of the Cura team labels Aug 9, 2023
@MariMakes
Copy link
Contributor

I'll bring it up to the team to see what they can do to improve it.
Since the amounts of reports coming in on the topic is growing.

Fingers crossed 🤞

@MariMakes MariMakes pinned this issue Aug 10, 2023
@MariMakes
Copy link
Contributor

Quick update from our side 👋

This fix will probably help with with the plug-ins being disabled by accident.
Fix required plugins by nallath · Pull Request #891 · Ultimaker/Uranium
Move the required plugins list to before it's actually checked by nallath · Pull Request #16304 · Ultimaker/Cura

But they won't help with the workaround that requires you to disable the USB Printing plug-in, that still needs some more research.

@MariMakes
Copy link
Contributor

The Cura 5.5 Beta has been released 🎉 https://github.com/Ultimaker/Cura/releases/tag/5.5.0-beta.1

We are hoping it resolves some of the issues, but please let us know if that's not the case.

@BlondieGayMan
Copy link

BlondieGayMan commented Oct 15, 2023

I've had this same problem with every V5 release.

To Test, I also just downloaded 5.4.0-beta.1 and this not opening .stl or project files either, is still here!

What I have noticed, is that it either takes a long time, or if I launch OR I find that if I launch v4.8 and open the .stl, which appears instantly in 4.8, then, in 5.4.0, I can do file/new and then try to open the .stl... it won't open instantly like in 4.8, but after maybe 30 seconds, then it appears in 5.4.0.

So what I'm wondering, is there any possibility that have several versions installed on the same Window 10 box could have them interfering with each other?

However, to note, I don't have this problem in any version below 5.x.x. Only in V5.x.x

To be sure, right now, I X'd out of 5.4.0 and launched 5.1 and same issue. The .stl doesn't load (or takes minutes to appear).

I X out of 5.1, launch 4.8 and it opens the .stl instantly.

Clearly, there's something in 5.x.x causing this problem and I sure wouldn't want to be the coder that has to try and locate the offending library or code or plugin or whatever is causing this. LOL

Been there, done that....

I should have mentioned, once the .stl (or project) opens, then anything else opens fast and normal.
So there's SOMETHING that is being looked for on 1st launch that once it's in memory, the problem disappears until next launch.

@BlondieGayMan
Copy link

The Cura 5.5 Beta has been released 🎉 https://github.com/Ultimaker/Cura/releases/tag/5.5.0-beta.1

We are hoping it resolves some of the issues, but please let us know if that's not the case.

Sadly, the beta did not work either.
For clarity, the testing I've done is for both just an .stl file (using the same one that works fine in 4.8 and below) as well as the project file. Neither load right away.

The .stl I tried to open, FINALLY opened after about 4 minutes, so that's faster at least.

Now that something has finally loaded, I can now delete the object, open any other .stl I like without issue. It just appears instantly.

So it's clear that upon initial launch, there's some library or something missing, that doesn't get loaded right away. But after waiting for xx minutes and the object finally opens, the library or something is now in memory. Thus, everything just works fine from then on, UNTIL next fresh launch.

It might be interesting to put break points in the compiler to areas where loading happens and do a before/after list of modules loaded. Then, after the .stl finally appears, again, do the after list and compare what's missing. Once found, that could be added to the initial startup tables of modules to load.

Just some thoughts.

@darkblaze69
Copy link

This is still unsolved in 5.6.0. I wait 4 minutes fot stl to load. What it's doing?

@BlondieGayMan
Copy link

Yup! I don't know why the devs can't find this. On first run of Cura and first load of a .stl, it appears to be stuck in some kind of loop. Only a loop could cause this long of a delay.
As I said above, once the .stl loads, you can delete it and load another (without closing down Cura, of course) and it just pops up instantly.

I even put my Lab PC to sleep, which some programs have issues with, but Cura plays nicely. So coming out of sleep, with Cura having already been opened before sleep, it just works perfectly. STLs open instantly.

Just closing Cura, reopening and loading a .stl triggers the loop.

I'm at the point where I just don't care anymore. If I need to do some CAD design, I first load Cura and just load any old .stl and let it loop in the background.

By the time I ready to slice what I'm working on, Cura is ready to go.

@DJSnCa
Copy link

DJSnCa commented Mar 30, 2024

I've been experiencing the same issue on arch. running "cura --debug" doesn't seem to show anything other than attempting to read file along with attempting serial communication with a printer followed by changing baud rates

@BlondieGayMan
Copy link

I don't have my printer connected to the computer, but perhaps I could do that to see if by there now being serial comms, that perhaps it loads faster.

IF that is the case, then this is perhaps where devs might want to look in Cura's code.

When Cura itself first loads, it should perhaps check if a printer is connected.
Of even better, perhaps an option in settings where a person can choose to inform that a printer is connected or is not.

If NOT connected, then Cura code should bypass any serial connection attempts.

I may test this next week. This weekend isn't good for me. :)

@krifpvlic
Copy link

I'm experiencing a long delay to load an STL file on Nobara linux as well. An observation: it seems to load only when USBPrinting.AutoDetectBaudJob.run finishes. Here's an excerpt of the --debug output before opening the stl. Before it's just checking all of the tty ports.

2024-04-09 23:16:20,709 - DEBUG - [JobQueueWorker [7]] USBPrinting.AutoDetectBaudJob.run [39]: Checking /dev/ttyS28 if baud rate 9600 works. Retry nr: 1. Wait timeout: 15
2024-04-09 23:16:20,709 - DEBUG - [JobQueueWorker [4]] USBPrinting.AutoDetectBaudJob.run [39]: Checking /dev/ttyS31 if baud rate 9600 works. Retry nr: 1. Wait timeout: 15
2024-04-09 23:16:20,709 - DEBUG - [JobQueueWorker [5]] USBPrinting.AutoDetectBaudJob.run [39]: Checking /dev/ttyS29 if baud rate 9600 works. Retry nr: 1. Wait timeout: 15
2024-04-09 23:16:20,709 - WARNING - [JobQueueWorker [7]] USBPrinting.AutoDetectBaudJob.run [45]: Unable to create serial connection to None with baud rate 9600
2024-04-09 23:16:20,710 - WARNING - [JobQueueWorker [4]] USBPrinting.AutoDetectBaudJob.run [45]: Unable to create serial connection to None with baud rate 9600
2024-04-09 23:16:20,710 - WARNING - [JobQueueWorker [5]] USBPrinting.AutoDetectBaudJob.run [45]: Unable to create serial connection to None with baud rate 9600
2024-04-09 23:16:35,719 - DEBUG - [JobQueueWorker [1]] USBPrinting.AutoDetectBaudJob.run [77]: Unable to find a working baudrate for None
2024-04-09 23:16:35,721 - DEBUG - [JobQueueWorker [3]] USBPrinting.AutoDetectBaudJob.run [77]: Unable to find a working baudrate for None
2024-04-09 23:16:35,721 - DEBUG - [JobQueueWorker [1]] cura.Machines.ContainerTree.run [174]: Started background loading of MachineNodes
2024-04-09 23:16:35,722 - DEBUG - [JobQueueWorker [6]] USBPrinting.AutoDetectBaudJob.run [77]: Unable to find a working baudrate for None
2024-04-09 23:16:35,722 - DEBUG - [JobQueueWorker [2]] USBPrinting.AutoDetectBaudJob.run [77]: Unable to find a working baudrate for None
2024-04-09 23:16:35,726 - DEBUG - [JobQueueWorker [0]] USBPrinting.AutoDetectBaudJob.run [77]: Unable to find a working baudrate for None
2024-04-09 23:16:35,727 - DEBUG - [JobQueueWorker [5]] USBPrinting.AutoDetectBaudJob.run [77]: Unable to find a working baudrate for None
2024-04-09 23:16:35,727 - DEBUG - [JobQueueWorker [7]] USBPrinting.AutoDetectBaudJob.run [77]: Unable to find a working baudrate for None
2024-04-09 23:16:35,727 - DEBUG - [JobQueueWorker [4]] USBPrinting.AutoDetectBaudJob.run [77]: Unable to find a working baudrate for None
2024-04-09 23:16:35,741 - DEBUG - [JobQueueWorker [3]] UM.Mesh.MeshData.calculateNormalsFromVertices [561]: Calculating normals took 0.00025010108947753906 seconds
2024-04-09 23:16:35,741 - DEBUG - [JobQueueWorker [3]] STLReader.STLReader._read [68]: Loaded a mesh with 10830 vertices
2024-04-09 23:16:35,745 - DEBUG - [JobQueueWorker [3]] UM.Mesh.MeshData.approximateConvexHull [505]: approximateConvexHull(target_count=1024) Calculating 3D convex hull took 0.0038175582885742188 seconds. 104 input vertices. 104 output vertices.
2024-04-09 23:16:35,750 - DEBUG - [JobQueueWorker [3]] UM.FileHandler.ReadFileJob.run [87]: Loading file took 0.0 seconds
2024-04-09 23:16:35,755 - DEBUG - [JobQueueWorker [3]] UM.Mesh.MeshData.approximateConvexHull [505]: approximateConvexHull(target_count=1024) Calculating 3D convex hull took 0.0045583248138427734 seconds. 104 input vertices. 104 output vertices.
2024-04-09 23:16:35,762 - DEBUG - [MainThread] UM.Operations.OperationStack.push [72]: <UM.Operations.AddSceneNodeOperation.AddSceneNodeOperation object at 0x7f4da3545810>, took 0ms
2024-04-09 23:16:35,766 - DEBUG - [MainThread] UM.Operations.OperationStack.push [72]: GroupedOp.(#=2) RotateOp.(node=<CuraSceneNode object: 'Rode Lav Mc t-shirt clip v4.stl'>,rot.=Q<0.0,0.0,0.0,w=4.0>) TranslateOp.(node=<CuraSceneNode object: 'Rode Lav Mc t-shirt clip v4.stl'>,trans.=<0.000,0.000,0.000>), took 1ms

These errors also pop up when the file is loaded but I'm not sure how related they are

QIODevice::peek (QNetworkReplyHttpImpl): device not open
"Could not convert argument 0 at"
	 "@file:///tmp/.mount_UltiMaFR894K/share/cura/resources/qml/Menus/RecentFilesMenu.qml:33"
"Could not convert argument 0 at"
	 "@file:///tmp/.mount_UltiMaFR894K/share/cura/resources/qml/Menus/RecentFilesMenu.qml:33"
"Could not convert argument 0 at"
	 "@file:///tmp/.mount_UltiMaFR894K/share/cura/resources/qml/Menus/RecentFilesMenu.qml:33"
"Could not convert argument 0 at"
	 "@file:///tmp/.mount_UltiMaFR894K/share/cura/resources/qml/Menus/RecentFilesMenu.qml:33"

@BlondieGayMan
Copy link

It's interesting that USBPrinting.AutoDetectBaudJob.run seems to be involved.
That makes sense, actually.
So I wonder a couple of things.

For one, I wonder if, at least as a test, adding to the code a JUMP to bypass USBPrinting.AutoDetectBaudJob.run and continue, might reveal that this is the problem.

If so, then the USBPrinting.AutoDetectBaudJob.run code itself needs to be tightened up.

Also, perhaps an option on Cura's Settings to disable that call would resolve it for those of us NOT printing via USB. ????

I still haven't tested by connecting my printer to USB to see if the auto detect just detects it quickly and moves on.

It's still interesting that after the long delay and the 1st stl finally opens, that closing that .STL and loading a new one is instantaneous.

I wonder if after the first major delay, if
USBPrinting.AutoDetectBaudJob.run
is either bypassed or has cached what it found/didn't find and therefore no longer causes the delay..... hmmmm...

@krifpvlic
Copy link

In the flatpak version of the app, I was able to edit the AutoDetectBaudJob.py file and commented out lines 55-76. This resolved the issue and might work as a temporary remediation for those who don't use the USB printing feature.

@gtollini
Copy link

gtollini commented May 4, 2024

I fixed this by disabling USB printing altogether (I've never had an USB printer to begin with).
To do that:

  • Go to the “Installed” tab of the Marketplace.
  • Scroll down to USB Printing and click "disable".
  • Restart Cura.

@BlondieGayMan
Copy link

gtollini

YOU ARE PURE GENIUS!
I knew that this problem was related to some code loop and I suspected something to do with USB and I had considered connecting my printer to USB just so that Cura could "see" it.

But I would never have thought to go into Marketplace and fine "USB Printing."

So I disabled it as I NEVER use it nor ever would and after restarting Cura, a new .SLT file loaded instantly!

Thank you so much for this.

Perhaps now the Devs/coders can fix this issue for those who may use or not use USB printing.
Perhaps it can be a setting under each printer profile (USB Printing, yes/no) and based on that, just jump over the "USB Printing" code that loops for so long. Just like disabling it does.

Now that you've confirmed this, the fix would be so easy to do.

I hope that this gets picked up by the Dev team.

Again, A HUGE THANK YOU!

@gtollini gtollini linked a pull request May 6, 2024 that will close this issue
5 tasks
@gtollini
Copy link

gtollini commented May 6, 2024

I've made a PR with a fix that works for me. It would be interesting for you guys to test it on your machines and report if it works for you as well 😄. It's here.

As it turns out, it's not scanning each of our printers for USB. It's scanning each of our tty ports (in my case, 32) and trying to make a connection. It'll use a CPU core per port (in my case, 4), 15s per port, twice each. In my case, both in theory and in practice, this totaled 4 minutes between clicking "open" and the file actually opening.

For some reason unbeknownst to me, this was only enabled on Linux/MacOS. My fix was simply disabling it for everyone, and hopefully a dev with better understanding of the project can add a setting like "Auto Detect USB Printers" or something that we can toggle on or off.

@BlondieGayMan
Copy link

Just for clarity and now I see that I wasn't clear before. When I said that it seems like it's scanning, I may have said USB ports, but I should have said COMM ports. That's what you have confirmed.

I agree, I hope that the Devs do 2 things, actually. One, put an option in settings to configure Enable/Disable like you suggested above. But upon install of an upgrade apply the user's settings. On a new install, DISABLE this feature and perhaps have a pop up asking about it.

Secondly, rather than the code doing a full scan of tty/COMM ports to try and find printers, the code should (in Windows for example) read the comm list to see if a printer is there. I'm not saying that right as I don't code in that area. What I mean is, that when someone connects a printer to USB, the drivers are installed (again, I use Windows for my examples as I don't do MAC or Linux) so the info is already there. This should be pulled and not an unnecessary long scanning of all ports. It really is redundant at the very least.

In a case where someone does have a printer or more connected to USB, once Cura finds it/them I hope that it retains the data so that on next launch, it just launches without trying to find them all again.

Either way, your find and work around is just perfect. I really appreciate what you've done here.

Thanks again.

@gtollini
Copy link

gtollini commented May 6, 2024

@BlondieGayMan

There's something odd there. In theory, my fix wouldn't have a difference on Windows users. All I did was switch a Platform.IsWindows() (which would be True for you) for a hardcoded True. Can you build from source from my branch and test it on your system?

It could also be an implementation failure on IsWindows(), I'll investigate it a bit.

Also, if you don't mind sharing this information, which version of Windows are you running?

@BlondieGayMan
Copy link

This is on Windows 10 Pro, latest updates.
I'm sorry, but I can't do a test. I wish that I could. But I don't spend too much time on that computer and don't really have the time cycles. I literally only use it when I need to design something to 3D print and/or coding for the gadgets I design.
And I'm in a major slump right now, with several projects sitting on my lab desk, all staring at me. LOL

@ronsmits
Copy link

I can confirm that this is still an issue with 5.7 on pop os, disabling the USB printing fixed it

@BlondieGayMan
Copy link

I haven't had time (or motivation, to be honest) to test this, but if one does have the printer connected to USB and powered on so the operating system "sees" it, does Cura, if USB printed left enabled, still do the xx minutes thing?
Or since the print is now visible, does Cura "see" it immediately and then just loads the .stl file quickly??

Just curious.

I joke about not having time to test. It's more that in order to connect the printer, I have to dig out the computer to connect the printer to a USB port at the back.

@gtollini
Copy link

I don't have an USB printer to test this out, but I'd guess it would still take a long time to open files.
The code tests all tty ports for baud rate - independently of it connects, I think.

@BlondieGayMan
Copy link

BlondieGayMan commented May 12, 2024

Ok. If I can find some time tomorrow and remember, I'll connect the printer and test. I'll have to also remember to enable USB Printing. If I get this done, I'll report back the results here.

What I'm hoping, is that the coders had the sense to look first for an active port and if something found, then test for baud rate.

ADDED
Oh, I forgot, besides the above, once found, have the code save the settings for the printer(s) found, so that next time, the code could go right to THAT port with the prev. settings, like baud and then test with those numbers. If nothing has changed, then the test should be a second or two. Not minutes just repeating the massive testing that it does now.

@kafufafu
Copy link

kafufafu commented Jun 5, 2024

Could this have had any relation with the following? #19186

@gtollini
Copy link

Could this have had any relation with the following? #19186

Yes, it's the same root cause.

@sneakythr0ws
Copy link

I have same issue. Model doesn't appear before USBPrinting.AutoDetectBaudJob finishes.
Disabling usb printing pliugin helped

@GregValiant
Copy link
Collaborator

GregValiant commented Jul 21, 2024

I keep seeing this thread at the top of the page. There may be some movement on this as it has come up in other threads.

USB Printing is enabled by default as some older UltiMaker printers require it. For everyone else, it's a non-maintained legacy feature that not many use (or should use).

The "won't load files on startup" problem seems to be a lot worse when a user has other USB devices plugged into their computer and those devices are configured as serial devices. Headphones and some other accessories are known issues as Cura keeps polling the device and sending "M105" and the device keeps sending back "What?" and that goes on and on.

I'm in favor of adding a setting to the Extensions menu that will either jump to USB Printing in the MarketPlace where the user could turn it on, or better, just be a switch that would toggle it on and off. It's installed, loaded, and enabled by default and I see no reason to have to go to a remote website to disable it or enable it. (#19373 )

@horga83
Copy link

horga83 commented Aug 5, 2024

Still broken under both X and Wayland on latest Arch and Cura 5.8.0 running under GNOME 46
USB printing disabled and Cura still unusable

@horga83
Copy link

horga83 commented Aug 5, 2024

My apologies this may have been a bad STL for those wanting to test it is this project.
https://www.thingiverse.com/thing:3842871/files
The smaller STL opens the larger one does not.

@nebomuk
Copy link

nebomuk commented Sep 16, 2024

I keep seeing this thread at the top of the page. There may be some movement on this as it has come up in other threads.

USB Printing is enabled by default as some older UltiMaker printers require it. For everyone else, it's a non-maintained legacy feature that not many use (or should use).

The "won't load files on startup" problem seems to be a lot worse when a user has other USB devices plugged into their computer and those devices are configured as serial devices. Headphones and some other accessories are known issues as Cura keeps polling the device and sending "M105" and the device keeps sending back "What?" and that goes on and on.

I'm in favor of adding a setting to the Extensions menu that will either jump to USB Printing in the MarketPlace where the user could turn it on, or better, just be a switch that would toggle it on and off. It's installed, loaded, and enabled by default and I see no reason to have to go to a remote website to disable it or enable it. (#19373 )

I can reproduce this issue exactly. Download the latest Cura.AppImage (on linux), plug in a USB headphone and it will take a few minutes to load the simplest stl files.
The cura log is full of entries regarding the USB printing plugin.
When I disable the USB printing plugin, .stl files just load just instantly.

@BlondieGayMan
Copy link

So here's something. Due to Microsoft's BS with restoring Win10 images just failing, I wasn't able to restore my LabPC to an SSD.
So, ok... bite the bullet and just do a fresh install of everything.

So on this fresh install, after all updates done and my own config/setup, I downloaded and installed the latest version, 5.8.1.

Without doing anything to it and it couldn't pick up any old settings since this is a fresh install of Windows, I grabbed one of my bigger .STL files and it appeared instantly.

I didn't have to disable anything and yes, the things plugged into the USB ports has not changed. This includes a 10-port USB hub that I use mostly for Arduino and ESP32 boards.

So it seems to be fine here... at least, for now.

@horga83
Copy link

horga83 commented Sep 16, 2024 via email

@GregValiant
Copy link
Collaborator

@horga83
I'm on a Windows 10 system.

There is something wonky about the larger of the models you posted. It's kind of big for most printers. This is in MS 3D Builder and Cura shows the same numbers:
image

In Cura, at a scale of 0.10% it is 22mm tall. That makes a lot more sense than 22 meters tall.
image

@BlondieGayMan
Copy link

Now who wouldn't want a nice 22 METER printer?
LOL
By they way, with the picture of the object on the bed, PLEASE tell me no one is trying to print that in that orientation! LOL

I would nope not, but ya never know.

@GregValiant
Copy link
Collaborator

That was just the Z.
In reality (I'm not sure whose) the printer would need to be be 150m x Y100 x 30m (500ft x 325ft x 100ft). You could print a full size Boeing 747.

In regards to the orientation of that part - it's my printer and I can print however I want.
(The smaller part came in at a reasonable size so I didn't fool with it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Under Investigation The issue has been confirmed or is assumed to be likely to be a real issue. It's pending discussion. Type: Bug The code does not produce the intended behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.