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

Python3 controller.info() error #11

Open
dorox opened this issue Mar 5, 2019 · 3 comments
Open

Python3 controller.info() error #11

dorox opened this issue Mar 5, 2019 · 3 comments

Comments

@dorox
Copy link

dorox commented Mar 5, 2019

Exception has occurred: TypeError
ord() expected string of length 1, but int found

I can contribute to solve that as soon as the owner is still working on it

@freespace
Copy link
Owner

Hi @dorox can you provide more information? On which line does the error occur?

@dorox
Copy link
Author

dorox commented Mar 7, 2019

Hi, see below. There are some other issues, which are solved in @yuriy-kozlov fork.
However, neither master, nor forks solve another issue I have with LTS150 not returning status message (get_status.py, goto.py), even when correct request message was sent: it seems like there is nothing returning. At the same time move.py command returns status upon move completion.
I'll try to work it out since I need to log movement velocity profile, should I create a fork (I'm new to GitHub)?

  File "~/controller.py", line 491, in info
    fwverminor = ord(fwver[0])
TypeError: ord() expected string of length 1, but int found

Here is the quick workaround I've written:

info = st.unpack('<I 8s H 3b x 48s 12s HHH', getmsg.datastring)
sn, model, hwtype, fwvermajor, fwverinterim, fwverminor, notes, _, hwver, modstate, numchan = info
fwver = '%d.%d.%d' % (fwvermajor, fwverinterim, fwverminor)
return (sn, model.decode().strip('\x00'), hwtype, fwver, notes.decode().strip('\x00'), hwver, modstate, numchan)

@freespace
Copy link
Owner

These issues may be related if the controller is not responding to request/get appropriately. I assume the controller works as expected using thorlab's own software.

If you can perhaps get me a sample of getmsg.datastring from line 487 of controller.py we could do some testing. Unfortunately I don't have any APT hardware at the moment and so can not do any testing.

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