10 Replies Latest reply on Aug 14, 2015 8:04 AM by screamingtiger

    Microstack GPS - Commands


      Has anyone been able to get the microstack GPS to accept commands?  it defaults updates to 1HZ and I want to up it to at least 2-3HZ.



        • Re: Microstack GPS - Commands
          Christopher Stanton

          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.




          $PMTK220, 200*2C



          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'.

          1 of 1 people found this helpful
          • Re: Microstack GPS - Commands

            Any luck?  None here.  It just doesn't seem to change anything!

            • Re: Microstack GPS - Commands

              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!

              • Re: Microstack GPS - Commands

                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.


                Thanks guys!