{"id":21413182,"url":"https://github.com/github0013/nmea_gps","last_synced_at":"2025-10-19T10:51:02.040Z","repository":{"id":24751918,"uuid":"28164740","full_name":"github0013/nmea_gps","owner":"github0013","description":null,"archived":false,"fork":false,"pushed_at":"2014-12-27T03:02:51.000Z","size":360,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-20T13:48:38.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github0013.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-18T02:19:53.000Z","updated_at":"2014-12-27T03:02:51.000Z","dependencies_parsed_at":"2022-08-17T17:25:25.383Z","dependency_job_id":null,"html_url":"https://github.com/github0013/nmea_gps","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/github0013/nmea_gps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0013%2Fnmea_gps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0013%2Fnmea_gps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0013%2Fnmea_gps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0013%2Fnmea_gps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github0013","download_url":"https://codeload.github.com/github0013/nmea_gps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0013%2Fnmea_gps/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261049282,"owners_count":23102533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T18:17:24.646Z","updated_at":"2025-10-19T10:50:57.006Z","avatar_url":"https://github.com/github0013.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://raw.githubusercontent.com/github0013/nmea_gps/master/lib/images/top.jpg)  \n\n## Why another NMEA gem?\nI was looking for a NMEA gem, but none of them I could find were written in the ruby-way.  \nI wanted to get GPS data pushed when it gets updated, so I created one.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'nmea_gps'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install nmea_gps\n\n## Usage\n\n```ruby\n\n# set your zone if you want to get time in you local time zone. \n# otherwise it will be UTC\nNmea::Config.time_zone = \"Tokyo\"\n\n# create a serialport to your GPS receiver\n# you should know how to open a connection between your GPS device\n# mine runs on `9600 baudrate`, `8bit`, `1stop bit`, `none parity`\nserialport = SerialPort.new(\"/dev/cu.your_whatever_device\", 9600, 8, 1, SerialPort::NONE)\n\n# you should know about your GPS receiver's update Hz(how often it will update logs 10Hz = 10 times per sec.)\n# if you don't know leave it blank.  It will at least update every sec.\ngps = Nmea::Gps.new serialport update_hz: 10\n\n# this will be called automatically!!\ngps.rmc do |rmc|\n  # you will get a sentence object as a parameter\n  # for gsv callback, it will be an array containing multiple gsv objects [gsv, gsv, gsv]\n  p rmc.raw_sentence_line\n  p rmc.raw_data\n  p rmc.time\n  p rmc.latitude\n  p rmc.longitude\n  p rmc.heading\n  p rmc.date\nend\n# sentences \u003e https://github.com/github0013/nmea_gps/tree/master/lib/nmea_gps/sentences\n# you have a callback on each sentence such as gga, gll ..., \n\n# built-in error callback (catch errors in the internal thread)\ngps.error do |exception|\n  p exception.message\n  puts exception.backtrace.join \"\\n\"\nend\n\n# if you want to receive all ...\ngps.all do |sentence, sentence_object|\n  p sentence         # such as :gga, :rmc\n  p sentence_object  # such as Nmea::Gps::Rmc, [Nmea::Gps::Gsv, Nmea::Gps::Gsv, ...]\nend\n\n# start the tracking\ngps.track!\n\n# you can also have\n# gps.gga do |gga|\n#   ..\n# end\n# gps.gll do |gll|\n#   ..\n# end\n# gps.gsa do |gsa|\n#   ..\n# end\n# gps.vtg do |vtg|\n#   ..\n# end\n# gps.zda do |zda|\n#   ..\n# end\n# \n# this one gets multiple Gsv objects\n# gps.gsv do |gsvs|\n#   p gsvs.count\n#   ..\n# end\n\n# do your other works\n# ..\n# ..\n# ..\n\n\n# you can clear callbacks on the run\ngps.clear_rmc # this will stop the call instantly\n\n\n# you can even start a callback on the run \ngps.gga do |gga|\n  p [gga.latitude, gga.longitude]\nend\n\n# when you want to stop callbacks, you can call this\n# gps.stop!\n# then close the connection\n# serialport.close\n```\n\n## sentences\n[click here](https://github.com/github0013/nmea_gps/tree/master/lib/nmea_gps/sentences) for details\n\n| sentence | callback | parameter to be passed |\n|:----|:----|:---------------|\n| GGA | gga | Nmea::Gps::Gga |\n| GLL | gll | Nmea::Gps::Gll |\n| GSA | gsa | Nmea::Gps::Gsa |\n| GSV | gsv | [Nmea::Gps::Gsv, Nmea::Gps::Gsv, ...] |\n| RMC | rmc | Nmea::Gps::Rmc |\n| VTG | vtg | Nmea::Gps::Vtg |\n| ZDA | zda | Nmea::Gps::Zda |\n\n## Contributing\n\n1. Fork it ( https://github.com/[my-github-username]/nmea_gps/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub0013%2Fnmea_gps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub0013%2Fnmea_gps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub0013%2Fnmea_gps/lists"}