-
Notifications
You must be signed in to change notification settings - Fork 26
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
Data transfer was incomplete. #66
Comments
Does that happen every time you tried to get the histogram? |
Yes it does |
Could you let us know which version of the library you are using, as well as what version of Python, and what firmware version of the OPC-N2 you are using? |
Hi dhhagan, I was using the pyusbiss library using a simple pip3 install with python 3 and the OPC-N2 firmware version I have is 18.2. |
What version of pyusbiss are you using?
…On Sat, 12 May 2018, 09:20 rach8cww, ***@***.***> wrote:
Hi dhhagan, I was using the pyusbiss library using a simple pip3 install
with python 3 and the OPC-N2 firmware version I have is 18.2.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#66 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIB3VT-VjbN5cx5RCIQy1cW-ym3wagWSks5txptfgaJpZM4T79Uu>
.
|
Sorry for the delay, I'm using pyusbiss 0.2.2 |
Can you try pyusbiss 0.2.0?
…On Sun, 13 May 2018, 16:00 rach8cww, ***@***.***> wrote:
Sorry for the delay, I'm using pyusbiss 0.2.2
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#66 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIB3VU42E_rP1q158QbC43s4tCAVxAfzks5tyEpygaJpZM4T79Uu>
.
|
Still no luck, fails with the same error message:
Could this be an issue with my device? |
Solved the issue - the instrument needs to have time to warm up before you ask for the histogram. I've added a few short sleep pauses in as well and is makes it run smoother. This is the output now: Trying to connect to instrument ttyACM0 ...
|
@rach8cww Great to hear! I'll be sure to add a note to the docs about waiting a bit between commands. I did speak with Alphasense and they mentioned this may be a requirement... |
Does alphasense have some more details on timings for each i2c commands and
probably timing diagrams?
…On Fri, 22 Jun 2018, 02:38 David H Hagan, ***@***.***> wrote:
@rach8cww <https://github.com/rach8cww> Great to hear! I'll be sure to
add a note to the docs about waiting a bit between commands. I did speak
with Alphasense and they mentioned this may be a requirement...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#66 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIB3VfcbL860lSyxnrmVSiScELLrMwx9ks5t_EqNgaJpZM4T79Uu>
.
|
@DancingQuanta They do not - it's quite unfortunate. I do have quite a few screenshots (and data) for most of the commands via a Logic Analyzer, but that's about it. In addition, some of the commands aren't designed to actually be functional, which they say will be fixed on the OPC-N3 (i.e. the laser_off command doesn't actually do anything). |
Ah well that is a shame. Looks like we have to figure out what works. What
will your strategy be regarding issues raised here?
…On Fri, 22 Jun 2018, 15:22 David H Hagan, ***@***.***> wrote:
@DancingQuanta <https://github.com/DancingQuanta> They do not - it's
quite unfortunate. I do have quite a few screenshots (and data) for most of
the commands via a Logic Analyzer, but that's about it. In addition, some
of the commands aren't designed to actually be functional, which they say
will be fixed on the OPC-N3 (i.e. the laser_off command doesn't actually do
anything).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#66 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIB3VYbKwaoD4WFA89dJafLIIMS-ySnJks5t_P26gaJpZM4T79Uu>
.
|
I'd suggest creating a method, which simply checks every 200ms until the device is ready. alpha = opc.OPCN2(spi, debug=True).await() alpha = opc.OPCN2(spi, debug=True, await=True, check=200) |
@tavurth That sounds like a fantastic idea, though I'm not sure exactly how to implement it with this device. Do you have any thoughts? |
I have an idea. Can |
@DancingQuanta That would be perhaps preferable: command = 0x30
# Send the command byte
self.cnxn.xfer([command])
# Wait 10 ms
sleep(10e-3)
# read the histogram
for i in range(62):
r = self.cnxn.xfer([0x00])[0]
resp.append(r) Here we see that we send a command byte, and then expect to read 62*
I'd be wary about interfacing with the bits directly as we have a good interface to work off of here, built by @dhhagan. However if it's more stable, or extensible, then we should certainly do so. Perhaps you could comment on the above two questions if you have more information? |
Alas, I do not know the details of Alphasensw’s spi. The code snippet you have shown is common in this library and the number of byte read back varies. As someone who likes to see more functions than repeating patterns, I suggest this snippet be encapsulated in a function with two or three arguments for a byte command and number of reads and maybe a time period for sleep. On other note, I noticed that this library already have a ping function, this sends one byte and read back one byte so pretty efficient way of checking the device is ready, compared with your wait method. |
I'm having an issue while reading the histogram from my device:
Any ideas on what the issue could be?
The text was updated successfully, but these errors were encountered: