pyAPT
pyAPT copied to clipboard
Python3 controller.info() error
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
Hi @dorox can you provide more information? On which line does the error occur?
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)
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.