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

[1.4.0rc*] PY3: COMM autodetection is broken #3385

Closed
foosel opened this issue Dec 11, 2019 · 2 comments
Closed

[1.4.0rc*] PY3: COMM autodetection is broken #3385

foosel opened this issue Dec 11, 2019 · 2 comments

Comments

@foosel
Copy link
Owner

@foosel foosel commented Dec 11, 2019

COMM autodetection is broken

Traceback (most recent call last):
  File "/home/bzed/tools/OctoPrint/src/octoprint/util/comm.py", line 2694, in _openSerial
    serial_obj = factory(self, self._port, self._baudrate, settings().getFloat(["serial", "timeout", "connection"]))
  File "/home/bzed/tools/OctoPrint/src/octoprint/util/comm.py", line 2647, in default
    port = self._detect_port()
  File "/home/bzed/tools/OctoPrint/src/octoprint/util/comm.py", line 2627, in _detect_port
    programmer.connect(p)
  File "/home/bzed/tools/OctoPrint/src/octoprint/util/avr_isp/stk500v2.py", line 36, in connect
    self.sendMessage([1])
  File "/home/bzed/tools/OctoPrint/src/octoprint/util/avr_isp/stk500v2.py", line 102, in sendMessage
    checksum ^= ord(c)
TypeError: ord() expected string of length 1, but int found

struct.pack returns bytes in Python3, looping over bytes gives integers there.

I've tried

--- a/src/octoprint/util/avr_isp/stk500v2.py
+++ b/src/octoprint/util/avr_isp/stk500v2.py
@@ -98,7 +98,7 @@ class Stk500v2(ispBase.IspBase):
                for c in data:
                        message += struct.pack(">B", c)
                checksum = 0
-               for c in message:
+               for c in message.decode():
                        checksum ^= ord(c)
                message += struct.pack(">B", checksum)
                try:

But then the connections just timed out. There must be another issue hidden somewhere.

Originally posted by @bzed in #3382 (comment)

@foosel foosel added this to the 1.4.0 milestone Dec 11, 2019
@foosel

This comment has been minimized.

Copy link
Owner Author

@foosel foosel commented Dec 11, 2019

Fixed in b06c222

@foosel

This comment has been minimized.

Copy link
Owner Author

@foosel foosel commented Dec 12, 2019

1.4.0rc3 has just been released

@foosel foosel closed this Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.