1 of 1 people found this helpful
I'll give it a go when I'm next in the office, but I haven't tried yet. However, you're not saying what exactly you've tried and how you've tried to send them to the GPS ?
With the update rate are you referring to:
Fix interval up to 10Hz
Which the microstack GPS documentation claims should be laid out in:
For more information consult the Microstack™ Node Python library documentation or the L80 GPS module protocol specification.
The tech' spec's do state:
Update interval 1Hz up to 10Hz
So the code to work with, is in the Raspbian package, but it's also available here: https://github.com/microstack-IoT/python3-microstacknode and I've attached L80 and Quectel docs to the blog post.
Reading : https://github.com/microstack-IoT/python3-microstacknode/blob/master/docs/example.rst implies that L80GPS can only read data every second:
Some commands may take one or more seconds to return. This is because L80GPS reading the latest data from the serial port which the GPS module is connected to. It only updates every second.
Which seems confused, as though we're interfacing with something that is in between the GPS chip and the Pi (we may be). Which means that we may not actually be able to send commands to the GPS chip directly to set it in a mode where it's running at 10Hz instead of 1Hz.
After checking the hardware manual from Quectel (which I think I attached to this blog post) it states that it accepts "PMTK proprietary commands input" over serial. An example command is:
Which apparently disables 'EASY' which is used in geo-location/satellite prediction for the device.
So PMTK is a proprietary standard. After a bit of digging for an example command, I happened upon this:
Which covers a bunch of commands. However, this may not be the case for the chip we're using. To quote from the document itself:
Packet Type: 220 PMTK_SET_NMEA_UPDATERATE
Support Chip Type: MT3318、MT3329、MT3339
Packet Meaning: Set NMEA port update rate Data Field: Position fix interval (millisecond).
The possible interval values range between 100 and 10000 millisecond.
Note： Before user input this command for update rate setting, it needs to see if the baud rate is enough or not. User can use PMTK251 command for baud rate setting 1000(millisecond) = 1(sec) 1/1 = 1Hz 200(millisecond) = 0.2(sec) 1/0.2 = 5 Hz 100(millisecond) = 0.1(sec) 1/0.1 = 10 Hz
However it seems this is pretty standard. Whether or not the device'll pay attention to you is a different matter (and you may have to adjust the baud/data rate with a similar command).
The documentation states setting an update rate higher than 1Hz will disable 'EASY'.
Any luck? None here. It just doesn't seem to change anything!
What are you using/how are you sending the command?
1 of 1 people found this helpful
I use minicom and just type/paste the commands, have also tried echo command. Have also attempted in software by opening up the com port.
Send the command via command line like this:
echo -e "\$PMTK220,200*2C\r\n" > /dev/ttyAMA0
for 5Hz mode
To be able to go above 1Hz you will need to switch to a higher baud rate:
echo -e "\$PMTK251,57600*2C\r\n" > /dev/ttyAMA0
Don't forget to update your tools connection speed!
How're you validating that it accepted the command and is updating faster?
I updated the baud rate in /usr/lib/python3/dist-packages/microstacknode/gps/l80gps.py (line 47) and re-ran my averaging code.
It now spits out the average of the 10 values every second (as I executed mine with PMTK220,100*2F).
Alternatively, you could watch the NMEA messages fly by at a break neck pace in minicom.
Sorry to be particular, what did you update the baud rate to?
57600. I suppose you could go to 115200 (or maybe even slower) but that is just the number I tried and it worked.
After some research, my unit was bad. I had a 2nd one I was sent a while back and that one works fine.
I can now update the baud and the refresh rate.