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

[BUG]: Unable to connect to cloud service on X1C #61

Closed
singhm29 opened this issue Dec 1, 2024 · 17 comments
Closed

[BUG]: Unable to connect to cloud service on X1C #61

singhm29 opened this issue Dec 1, 2024 · 17 comments

Comments

@singhm29
Copy link

singhm29 commented Dec 1, 2024

Describe the Bug
Unable to connect to the cloud service on an X1C after getting verification email for 2FA

Expected Behavior
To recieve an authentication token after entering the verficiation code

Debug Logs
plugin_bambu_printer_serial.log
serial.log

Please let me know if the above isnt adequate. First time posting logs

Screenshots

Printer and Plugin Setting Details

  • Printer model? X1C
  • Is your printer connected to Bambu Cloud? Yes
  • Is the plugin configured for local access only? No and it seems to not work locally either. Prior to the 2FA introduction I was using this plugin sucessfully!

I have read the a similar issue with the A1 in the other thread and looked at the approaches between that and the A1 not reporting printing status and temperature thread. At least a month a go I was actively using the plugin but after some issues not being able to actually issue commands through the terminal I thought maybe my authenticaiton token was stale with the new 2FA and decided to reinstall and follow steps to install the releaese candidate. Unfortunately now I cant get the auth token to move forward.

@jneilliii
Copy link
Owner

There have been updates in the release candidate that have the new 2fa verification process incorporated. Go into software update settings and change the plugin's release channel to release candidate and update when prompted.

@singhm29
Copy link
Author

singhm29 commented Dec 1, 2024

Thanks for the quick response. To clarify I am using Bambu Printer: 0.1.8rc11 so I do get prompted for 2FA authentication and get the new Verify field. When I enter in my password (which I have tested and verified) I get pinged in my email by Bambu labs with the verification code but entering it does not produce an auth token as expected and the field remains unpopulated.

@jneilliii
Copy link
Owner

Do you see this same error in your octoprint.log? #59 (comment)

@singhm29
Copy link
Author

singhm29 commented Dec 1, 2024

Feel a bit silly but do I have the right things active to log that?
image

I have all three settings active, and I follow the process of entering my login credentials into the plugin. I receive an email from Bambu, enter the code, and click verify, but nothing happens. If I click the verify button again, it triggers Bambu to send another email, but there’s still no update to the authentication token.

I apologize if I’ve missed anything. Please let me know if I need to do something else to capture the correct logging information. I reviewed the logs with those three settings enabled but didn’t see the same output as the other user. It seems like I might have set up the logging incorrectly, as the issue appears identical to theirs.

@jneilliii
Copy link
Owner

Yeah, the octoprint.plugin.bambu_printer one should be enough to log the additional information, but even without that you should see the lines

2024-12-01 13:53:10,568 - octoprint.plugins.bambu_printer - INFO - Verifying user [email protected]
2024-12-01 13:53:21,725 - octoprint.plugins.bambu_printer - INFO - Error verifying: codeExpired

as they are of info logging level. debug logging just gives us more information, and the error mentioned in that other post should always log if you get the same error.

@singhm29
Copy link
Author

singhm29 commented Dec 1, 2024

Weirdly the only thing generated is this one log. Not seeing the lines above let me know if I should be doing something more to get them generated other than attempting to log in and to connect to the printer.
plugin_bambu_printer_serial (2).log

@lordCONAN
Copy link

Check octoprint.log and search for bambu_printer

@jneilliii
Copy link
Owner

Just released a potential fix in https://github.com/jneilliii/OctoPrint-BambuPrinter/releases/tag/0.1.8rc12, but I haven't personally tested it yet. I have merged in the upstream changes for pybambu and adjusted to get it working in local only mode the way I use it. Give it a try and see if your authentication with cloud is working now.

@kawaiishay
Copy link

@jneilliii I have the most recent 0.1.8rc13 pre-release installed but do not get the "verify" popup. But this is in the logs:

`Traceback (most recent call last):
  File "/Users/shaynahjackson/OctoPrint/venv/lib/python3.9/site-packages/octoprint/server/api/__init__.py", line 161, in pluginCommand
    response = api_plugin.on_api_command(command, data)
  File "/Users/shaynahjackson/OctoPrint/venv/lib/python3.9/site-packages/octoprint/util/__init__.py", line 1686, in wrapper
    return f(*args, **kwargs)
  File "/Users/shaynahjackson/OctoPrint/venv/lib/python3.9/site-packages/octoprint_bambu_printer/bambu_print_plugin.py", line 136, in on_api_command
    auth_response = self._bambu_cloud.login(data["region"], data["email"], data["password"])
  File "/Users/shaynahjackson/OctoPrint/venv/lib/python3.9/site-packages/octoprint_bambu_printer/printer/pybambu/bambu_cloud.py", line 360, in login
    result = self._get_authentication_token()
  File "/Users/shaynahjackson/OctoPrint/venv/lib/python3.9/site-packages/octoprint_bambu_printer/printer/pybambu/bambu_cloud.py", line 195, in _get_authentication_token
    raise EmailCodeRequiredError()
octoprint_bambu_printer.printer.pybambu.bambu_cloud.EmailCodeRequiredError: Email code required`

Should I rollback to 0.1.8rc12?

@jneilliii
Copy link
Owner

No version will work at this time until I go through the code again. Was hoping for a drop in replacement but appears the ha integration refactored a good bit. I'll be digging in deeper this week in my spare time.

@singhm29
Copy link
Author

singhm29 commented Dec 8, 2024

Was able to generate a verification code and an authentication token with the latest RC. Thank you for the fix @jneilliii!

@singhm29
Copy link
Author

Hi, I’m encountering some issues after running more prints. Specifically, I keep getting the error: “The OctoPrint server is currently not running” whenever a print is run with the plugin enabled. At first, I thought it might be an issue with OctoPrint itself or another plugin, but I’ve been able to reproduce the problem consistently whenever a print is run.

If the plugin is connected and idle, everything works fine. Similarly, if OctoPrint is running but disconnected from the printer, it also continues to function without errors.

Would it help if I posted the output from Octoprint.plugins.bambu_printer with serial logging enabled?

@jneilliii
Copy link
Owner

it would help to attach octoprint.log with octoprint.plugins.bambu_printer logging set to debug potentially. I haven't been running the integration for long periods of time, but never had an issue with it killing the OctoPrint service.

@singhm29
Copy link
Author

Ive attached both. A few things Ive noticed and will try. I am initiating the print through Bambu Studio instead of uploading the gcode to Octoprint and then starting. I am almost certain this was not a problem before 2FA issues but I have noticed that it stays in a state of operational despite the print starting on the Bambu Handy side. I think this makes sense because it doesnt quite know whats going on, it does correctly reflect the tempature changes though. I will try running a print thats been uploaded to Octo to see if behaviour differs. I did also run into filament spool issue midprint in case you notice that but Octoprint crashed before reaching that so not sure it was caught in the log.

octoprint.log
plugin_bambu_printer_serial.log

@jneilliii
Copy link
Owner

hmm...looks like it's getting in a file listing loop. can you share the "Elegoogcode.3mf.gcode.3mf" file and possibly the original 3mf file prior to slicing?

@singhm29
Copy link
Author

Apologies for the delay—I wasn’t able to access my printer over the past few days. When I attempted to retrieve the file “Elegoogcode.3mf.gcode.3mf,” it appeared to be corrupted. To address this, I reformatted the SD card (a Sandisk Ultra 16GB) to FAT32 as a precaution.

I also discovered that the “Cache prints to SD card” option wasn’t enabled. After enabling it, the missing progress tracking issue when printing from Bambu Studio was resolved. Now, the progress displays correctly, even when the print wasn’t initiated through OctoPrint. So far, this setup has avoided always crashing the OctoPrint server, even when sending direct prints from Bambu Studio, which used to cause crashes consistently. I have had it go down once after a print with this change however.

I’m curious if you’re still observing the file listing loop issue. Continuous Print Manager, which worked previously, is also throwing errors and I haven’t found a workaround yet..thinking it might be related.

Lastly I’ve noticed another anomaly: occasionally, the file list doesn’t update properly and remains blank when I connect. Disconnecting and reconnecting OctoPrint usually resolves this on the first attempt, though not always.

I’ve attached updated logs showing a connection to the printer and the “cube.3mf” file sent directly from Bambu Studio. I’m happy to share the G-code and STL files, but they’re currently greyed out as an attachment option here.

plugin_bambu_printer_serial.log
serial.log

@jneilliii
Copy link
Owner

I also discovered that the “Cache prints to SD card” option wasn’t enabled.

This is definitely a requirement with cloud connected printers, otherwise OctoPrint has no way of identifying. Now that's enabled I'm not seeing the same file list retrieval loop as before.

Continuous Print Manager, which worked previously, is also throwing errors and I haven’t found a workaround yet..thinking it might be related.

Not sure, I don't use that plugin but curious if it's what's sending the M400 command on print completion? If not, make sure you don't have anything in OctoPrint's settings under GCODE Scripts. Make all of them empty...

2024-12-15 23:08:19,861 <<< N9 M400*46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants