-
Notifications
You must be signed in to change notification settings - Fork 20
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
Version 2.0 release #104
Comments
Moving forward with a release sounds good to me. Yes I will contribute documentation. |
@alustig3 I think I'm finished updating the code and docs for the v2.0 release. The Is there anything else you think needs updating/fixing before the release? |
@ThomasAkam, I am still getting a bad checksum when using
|
@alustig3 I cannot reproduce the bad checksum error on my machine. Looking at the output in the image you sent I think the problem must be to do with how the data bytes sent by the Frame_trigger are being converted into python arrays. The content of those arrays should just be pulse numbers, so should start at 1 and increment by 1 each sample, as seen here where I print them to the log each time an analog chunk is recieved: I suspect that the problem is that the byteorder is different in the data sent from the pyboard from that which the comptuer python is expecting when it converts the data to bytes. This could either be because the byteorder different on Mac than windows, or because it is different on the pyboard D to the pyboard 1.1. Can you test if modifying pycboard.py line 482 to explicitly specify the byte order fixes the problem: data = np.frombuffer(content_bytes[2:], dtype="<" + self.sm_info.analog_inputs[ID]["dtype"]) |
@ThomasAkam the np.frombuffer line did not fix the problem. I also modified my debug statement to be: bad_msg = f"Bad {data}\t{content_bytes[2]},{content_bytes[6]},{content_bytes[10]}\t\t{content_bytes}" (updates here:alustig3@bc6ae88) so it looks like the data is there, but packed with 3 zero bytes in between each value... I think this is likely a Mac problem. I currently and debugging with a d-series board, but originally had the problem with a v1.1 board. I also downgraded the firmware to micropython v1.12 and it did not make a difference. |
Hmmm, I think we expect there to be 3 zero bytes between each value becuase these are 4 byte integers and for numbers 1-255 only the last of the 4 bytes should be non-zero. However it looks like first byte of the first sample in each chunk is missing as there are only two zero bytes before the non-zero byte. Does the Analog_input class work correctly? |
@ThomasAkam The problem is the datatype "l" is different on my mac. import struct
for dtype in ("bhil"):
print(f'{dtype} = {struct.calcsize(dtype)}') gives
so on line 481 of pycboard data = array(self.sm_info.analog_inputs[ID]["dtype"], content_bytes[2:]) it was creating an array of 3 8-byte values instead of 6 4-byte values I haven't had time to come up with a clean solution yet. I tried replacing line 301 of self.bytes_per_sample = struct.calcsize(data_type) but it did not make a difference. Let me know what you think. |
Thanks @alustig3. I think a simple fix may be just to use |
@ThomasAkam that fixes the problem. Thanks! |
@alustig3 - I woudl like to get the v2.0 release out soon so think we should stop working on new functionallity and get the last bits ready for the release. Is there anything else functionallity wise you want to include in this release? Otherwise I think the main things are updating the docs and checking the data import is working OK for the new data files. Are you happy to do the bits of the docs relating to the changes that you've implemented, and I'll do the bits relating to mine?
The text was updated successfully, but these errors were encountered: