Skip to content

Error with repeated readaddress commands #2

@jpfingstmann

Description

@jpfingstmann

I'm not sure if this is just happening on my box, but when doing multiple reads, it eventually fails (usually pretty quickly). The levelASet and levelBSet commands do a read of what I assume is the 0x4064 and 0x4065 addresses as part of the change. I'm not sure why this is, but I see regular failures:

power = 1
... while power < 50:
... power += 1
... et312.levelASet(level=power)
... time.sleep(0.2)
...
True
True (x 14)
Traceback (most recent call last):
File "", line 4, in
et312.levelASet(level=power)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/home/pchan/buttshockold/lib/python3.13/site-packages/mk312/com.py", line 519, in levelASet
read_levela = self.readaddress(address=ADDRESS_LEVELA)
File "/home/pchan/buttshockold/lib/python3.13/site-packages/mk312/com.py", line 220, in readaddress
raise MK312ReceivingLengthException('Reading failed getting %i bytes.' % len(read_data))
mk312.exceptions.MK312ReceivingLengthException: Reading failed getting 2 bytes.

However, this runs consistently without issue:

power = 1
... while power < 50:
... power += 1
... et312.writedata(address=16484,data=power)
... time.sleep(0.2)
...
True
True
True
True
True

It could be my box, it's pretty old, but I have tried different cables, just in case. I also adjusted the time to 0.5 or 1 second and it still happens, so it doesn't appear to be a timing issue (unless within the levelASet routine itself).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions