-
Notifications
You must be signed in to change notification settings - Fork 365
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
Confirm GPS is responsive before claiming GPS initialization complete #253
Comments
When reading a com port, even an empty one, random noise can show up On 02/16/2016 05:58 AM, bkwny wrote:
|
Since NMEA sentences start with the $ sign, can the code look for $ signs? (Two or three in two or three seconds (assumes worst case of 1 Hz) to make sure the first wasn't random noise?) Or, since commas are a large part of the NMEA sentence, look for 3 commas in a second to say GPS is working? |
"And any signal the host sees will indicate the port is working." I disagree. For us to proclaim the GPS receiver is working and therefore GPS initialization is complete, the data received from the port has to be some syntactically valid response to whatever it was we wrote to the port. I don't know the protocol well enough to prescribe what we should write and what we should look for in response, but the parsing of the response should reveal that the response is a fully formed, syntactically valid response to whatever it was we wrote. Failing that the GPS receiver is not online and so initialization is not complete. |
IF one adds validation code upon initializing an RS-232 port, then yes, On 02/16/2016 10:10 AM, bkwny wrote:
|
I added that message as a development / debug marker when I reworked the u-blox initialization code several weeks ago. Sole intent was to flag when the serial writes were done and that the port was being reopened to read. You're right, though that these are blind writes, and that Stratux doesn't know if the GPS actually configured itself until the port is opened and we start listening for NMEA messages. In my development branch, I've updated the wording to:
with similar wording for other GPS types to be added as other initialization routines are added (SIRF, Mediatek, ST Micro, etc.) As to the other points about detecting / validating signals, the current codebase validates NMEA message checksums to determine that the port is receiving correctly. Upon verification, There's future work to do for finer-grained control of the initialization process (better device detection; explicit verification that specific init messages are received, etc.) but development is already moving in that direction. |
WOW! On 02/17/2016 08:49 AM, AvSquirrel wrote:
|
WOW +1! |
Improved GPS detection (including device identification and post-configuration validation) is in my development branch. Targeting later this week for a pull request. |
0.7b1 + 1 commit
Dual SDR Nano 2. RY835AI via GPIO. AHRS no. External power.
N/A for this issue.
In ry835ai.go at line 124 we have function initGPSSerial() which attempts to initialize the GPS receiver. The function both initializes the serial port and writes initialization messages to the attached GPS receiver so as to configure it. The function then writes a console message claiming GPS initialization complete. The console message suggests to the user the GPS receiver was responsive to the initialization messages and is now ready to do work.
In wiring my HAT I inadvertently switched RXD and TXD. Thus no messages were ever flowing to the GPS receiver and in fact the R Pi never established communication with it. Stratux repeatedly printed a stanza of console messages claiming GPS initialization complete. The serial port might well have been initialized but communication with the GPS receiver clearly was never established. Once I found and repaired my wiring mistake all was well.
I suggest initGPSSerial() not claim and print GPS initialization complete until it has confirmed it really is in communication with the GPS receiver. Once configuring the serial port, make an attempt to send something, receive the response, parse the response, and confirm the parsed response is as expected. If that all works then claim GPS initialization complete. Otherwise print some kind of error message indicating which step in that sequence failed.
The text was updated successfully, but these errors were encountered: