RFExplorer / RFExplorer-for-Python

RF Explorer libraries and examples for Python 3
GNU Lesser General Public License v3.0
51 stars 25 forks source link

parse RFE6GEN calibration '#$q' messages #6

Closed aa1i closed 7 years ago

aa1i commented 7 years ago

My signal generator was produces '#$q' messages that are not parsed out in ReceiveSerialThread.py

This causes strReceived to fill up and prevent further messages from being parsed. Stripping them out by advancing strReceived to the next line clears this up, and seems to work on my siggen.

I am not sure what is in the '#$q' messages, I hope this doesn't cause issues on other devices. If it does, code will need to be added to properly parse these messages.

aa1i commented 7 years ago

Thanks!

It didn't seem right to just dump the messages, but I couldn't find documentation on how to properly parse them. Ignoring them did get me working, but a proper fix is certainly preferred.

EDIT: I found RFE6GEN_CalibrationData.py and figured out how to parse the $q messages properly, and will commit to my fork soon, and can add to this pull request if desired.

aa1i commented 7 years ago

87d2a08 now parses the RFE6GEN calibration messages instead of dumping them, and passes them to RFE6GEN_CalibrationData:InitializeCal() . This appears to work on my RFE6GEN. Let me know if I can do anything further to help.

0956379 is a pesky newline/blank line at the end of the file. Sorry about that, but it keeps git happy.

arocholl commented 7 years ago

Excellent, we will review and merge asap.

jcalderon09 commented 7 years ago

Calibration data from generator are not correct. Your code has 162 data but actually need to have 161. The first one is no need. That is, your code has: -39.5, -28.8, -28.8, -28.9,... and should have: -28.8, -28.8, -28.9,...

aa1i commented 7 years ago

Sorry, I had no documentation on the $q response, so I made a bad assumption based on the length of RFE6GEN_CalibrationData.m_arrSignalGeneratorCalRanges_KHZ .

I have committed b7c4622 which skips the first datum from the $q response, yielding 161 elements. This seems to be what your comment suggested.

Is there something more constructive I should do with that first item, or is it correct to just discard it?

arocholl commented 7 years ago

The final fix is included in new version v1.17.1707.2, this pull request is no longer applicable.

Kindly test the new code and let us know if you find any issue.

aa1i commented 7 years ago

v1.17.1707.2 seems to be working for me. Thank you!

arocholl commented 7 years ago

excellent, thanks for your feedback