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

enabling http auth causes crash #51

Closed
Thijskunst opened this issue Nov 20, 2023 · 2 comments
Closed

enabling http auth causes crash #51

Thijskunst opened this issue Nov 20, 2023 · 2 comments

Comments

@Thijskunst
Copy link

Thijskunst commented Nov 20, 2023

plugin causes cura to crash when sending file to a printer with http basic authentication enabled.

To Reproduce
Steps to reproduce the behavior:

  1. load a 3d model
  2. slice
  3. click 'print on printername' or 'upload to printername'
  4. See error

Expected behavior
print starts on printer or file gets uploaded to printer

Version Information

  • Operating System: windows 11 pro 22H2
  • Cura Version: 5.4.0
  • Cura-DuetRRF Plugin Version and Installation: 1.2.9 installed via Marketplace
  • Duet RepRapFirmware Version: RepRapFirmware for STM32F4 based Boards 3.5beta2+_103 (2023-02-11)
    Duet WiFi Server Version: 1.27-02S32-D

error traceback
Traceback (most recent call last):
File "C:\Users\thijs\AppData\Roaming\cura\5.4\plugins\DuetRRFPlugin\DuetRRFPlugin\DuetRRFOutputDevice.py", line 234, in _onFilenameAccepted
self._send('rr_connect',
File "C:\Users\thijs\AppData\Roaming\cura\5.4\plugins\DuetRRFPlugin\DuetRRFPlugin\DuetRRFOutputDevice.py", line 137, in _send
headers['Authorization'] = 'Basic ' + base64.b64encode(auth)
TypeError: can only concatenate str (not "bytes") to str

Cura Log

@Thijskunst Thijskunst changed the title http auth crash on cura 5.4 enabling http auth causes crash Nov 20, 2023
@Kriechi
Copy link
Owner

Kriechi commented Nov 25, 2023

Thanks for reporting this @Thijskunst!

In your local file C:\Users\thijs\AppData\Roaming\cura\5.4\plugins\DuetRRFPlugin\DuetRRFPlugin\DuetRRFOutputDevice.py n line 137, please change the line to:

headers['Authorization'] = 'Basic ' + base64.b64encode(auth).decode()

Save the file and restart Cura.

Please try this bug fix - if it works for you, I'll commit a fix and release a new version.

@Thijskunst
Copy link
Author

thanks for your reply,

sorry for my slow reply. I was in the proces of changing the kinematics, so i wasnt able to print anything.
i tested it and the plugin works now without any issue.

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

2 participants