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

changes on how to handle gps AT commands #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bledogit
Copy link

I have been trying to get your library to work, Here are some issues I found that might be helpful to somebody:

The GPS on the sim808 works without SIM. However, the init function returns false / error if there is no SIM. Minor issue, but would have been nice to know.

The GPS data is accessed by putting the chip on test mode.


bool DFRobot_SIM808::attachGPS()
{
  Serial.println("DFRobot_SIM808::attachGPS");
	 if(!sim808_check_with_cmd("AT+CGNSPWR=1\r\n", "OK\r\n", CMD)) { 
        return false;
    }
	 if(!sim808_check_with_cmd("AT+CGNSTST=1\r\n", "OK\r\n", CMD)) { 
        return false;
    }
	return true;
}

this floods the serial port with a lot of information, so a small serial buffer is likely to overflow (arduino's default is 64 Bytes), so function getGPS() will likely overflow between calls, and never return anything. For this to work, the getGPS() function MUST be called before the serial overflows.

I don't see the point in putting the chip in TEST mode to access functionality that i think should be accessed by using (AT+CGNSINF) instead.

the parse functions, don't work with the string returned by AT+CGNSINF as the format is slightly different.

So, Renamed
bool DFRobot_SIM808::getGPS() to bool DFRobot_SIM808::getGPSTestData()

Created function DFRobot_SIM808::getGPS() (body) that uses the on demand poll of data

@hoerup
Copy link

hoerup commented Jun 10, 2019

Looks interesting - unfortunately, DFRobot doesn't seem to have much interest in their community. I have never seen them respond to issues or PR's on github :(

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.

None yet

2 participants