Skip to content
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

[msom] Add GNSS test FQC command #2721

Merged
merged 5 commits into from
Jan 12, 2024
Merged

[msom] Add GNSS test FQC command #2721

merged 5 commits into from
Jan 12, 2024

Conversation

scott-brust
Copy link
Member

Problem

Msom hardware supports a built in GNSS engine along with the cellular modem. The mfg-cli needs to be updated to test this GNSS functionality as part of FQC testing at the factory. A new tinker:gnss-test command has been added to enable testing of both M404 (Quectel BG95-M5 modem/GNSS) and M524(Quectel EG91 modem/GNSS) hardware.

Solution

Add support for the new particlemfg tinker:gnss-test command

Steps to Test

Use mfg-cli to test per instructions here

Example App

Use tinker

References

See CLI PR here
See slack here

Copy link
Contributor

@YutingYou YutingYou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, also verified on M524(EG91-EX) and M404(BG95-M5)

$ npm run-script mfg-cli:start tinker:gnss-test start

> cli-monorepo@1.0.0 mfg-cli:start /Users/yuting/projects/js_prj/particle-cli
> ./packages/mfg-cli/bin/run "tinker:gnss-test" "start"

{
    "pass": true
}

$ ./packages/mfg-cli/bin/run tinker:gnss-test status
{
    "pass": true,
    "message": "Found 1 satellites"
}

r = Cellular.command("AT+QGPS=1\r\n");

bool success = false;
for (int i = 0; i < RETRIES && !success; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop is used elsewhere as well. It would be handy to have a macro/template that wraps retry loops with delay. Don't worry about it today.

int r = 0;
// Configure antenna for GNSS priority
for (int i = 0; i < RETRIES && r != RESP_OK; i++) {
r = Cellular.command("AT+QGPSCFG=\"priority\",0");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AT+QGPSCFG="priority" command should take a maximum of 300ms to execute. I see you don't have a timeout on the command call.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I just use the default 10 second timeout. I dont care about timing just that it succeeded.

switch (i) {
case 5: // TotalNumSat
{
int numberSattelites = atoi(token);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling

i++;

switch (i) {
case 5: // TotalNumSat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two constellations reported in the GSV sentences. This method may take the last set only, which is GLONASS.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this just lazily finds the last GSV sentence satellite count. I didnt do any more parsing since its not clear what data (if any) we care about returning to the host.

If we can see any number of satellites, then I consider gnss working and return success.
If we want this test to do more, then we need to specify that and I can improve it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to target the constellation that would be provided by the GNSS simulator during manufacturing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eugene posted an example simulator that reported GPS, but we dont know for sure what the factory will end up using. This will work with any constellation.

If we care about detecting/parsing each individual constellation I can do that, but we should make sure this will be used somewhere.

@scott-brust scott-brust merged commit 40bdcd4 into develop Jan 12, 2024
@scott-brust scott-brust deleted the fix/fqc-gnss-test branch January 12, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants