{"id":18890449,"url":"https://github.com/workingdog/gpsd4scala","last_synced_at":"2026-02-25T15:30:16.435Z","repository":{"id":8165992,"uuid":"9588171","full_name":"workingDog/Gpsd4Scala","owner":"workingDog","description":"A Scala/Akka client for connecting to the gpsd server.","archived":false,"fork":false,"pushed_at":"2015-10-21T01:17:44.000Z","size":41832,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-31T06:13:17.351Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/workingDog.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":"2013-04-22T00:47:22.000Z","updated_at":"2015-10-20T11:16:18.000Z","dependencies_parsed_at":"2022-09-14T13:40:37.371Z","dependency_job_id":null,"html_url":"https://github.com/workingDog/Gpsd4Scala","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FGpsd4Scala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FGpsd4Scala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FGpsd4Scala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FGpsd4Scala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workingDog","download_url":"https://codeload.github.com/workingDog/Gpsd4Scala/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239861708,"owners_count":19709273,"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-08T07:55:38.720Z","updated_at":"2026-02-25T15:30:16.369Z","avatar_url":"https://github.com/workingDog.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gpsd4Scala Overview\n\nGpsd4Scala is a Scala and Akka client for connecting to the [gpsd](http://www.catb.org/gpsd/) daemon.\n\nThis scala client library is to help developers in retrieving GPS data from\nGPS devices connected to a computer (e.g. Raspberry PI). This is done through the intermediate\n[gpsd server](http://www.catb.org/gpsd/). The scala client first connects to the gpsd service, then reads the GPS data\nfrom it and presents that data to the developer as scala objects.\n\nFrom [gpsd](http://www.catb.org/gpsd/) home page:\n\"gpsd is a service daemon that monitors one or more GPSes or AIS receivers\nattached to a host computer through serial or USB ports, making all data on\nthe location/course/velocity of the sensors available to be queried on TCP\nport 2947 of the host computer. With gpsd, multiple location-aware client\napplications (such as navigational and wardriving software) can share access\nto receivers without contention or loss of data. Also, gpsd responds to queries\nwith a format that is substantially easier to parse than the NMEA 0183 emitted\nby most GPSes. The gpsd distribution includes a linkable C service library,\na C++ wrapper class, and a Python module that developers of gpsd-aware applications\ncan use to encapsulate all communication with gpsd. Third-party client bindings\nfor Java and Perl also exist.\"\n\ngpsd provides data as [JSON](http://www.json.org/) objects that are decoded by Gpsd4Scala\ninto equivalent scala objects. See also [gpsd_json](http://catb.org/gpsd/gpsd_json.html) for\nthe meaning of the JSON objects returned by gpsd.\n\n# How to setup\n\nFirst download and install gpsd from http://www.catb.org/gpsd/. Launch gpsd according to the instructions.\n\nWith the gpsd server running in the background the Gpsd4Scala client library can\nbe used to connect and retrieve GPS data from the server on port 2947 (see the example).\n\n# How to use\n\nGpsd4Scala is a library, so it is up to you to create your own application.\nHere is an example:\n\n    object Example {\n      def main(args: Array[String]) {\n       implicit val context = ActorSystem(\"Example\")\n       // create a collector that will receive the decoded gps data\n       val collector = context.actorOf(Props(classOf[BasicCollector]))\n       // create the client session actor\n       val linker = context.actorOf(GPSdLinker.props(\"localhost\", 2947), \"linker\")\n       // register the collector\n       linker ! Register(collector)\n       // start the client to connect to the gpsd server\n       linker ! Start\n       // give it time to connect\n       Thread.sleep(2000)\n       // example of sending a command to the gpsd server\n       linker ! Watch\n      }\n    }\n\nOther commands can also be sent to the gpsd daemon such as:\n\n  - linker ! Version\n  - linker ! Poll\n  - linker ! Device\n  - linker ! Device(deviceObj)\n  - linker ! Watch(watchObj)\n\nNote: to give the linker time to setup the connection and process the commands, it is\nadvisable to wait for a second or two.\n\nIn your application, simply include the gpsd4scala jar file that can be generated by [SBT](http://www.scala-sbt.org/).\n\n# How to collect the data\n\nThe collector is where the data arrives, this is where you do something with the data received from the gpsd.\nIn your application all you have to do is to create your own collector and register it with the linker,\nas shown in the example above, the rest is done for you.\n\nHere is the typical structure of a collector actor showing the data arriving with the Collect(obj) message:\n\n    class BasicCollector extends Actor with Collector {\n\n      def receive = { case Collect(obj) =\u003e collect(obj) }\n\n      def collect(rep: Report) {\n        rep match {\n          case x: TPV =\u003e println(\"TPV: \" + rep.toString)\n          case x: Version =\u003e println(\"Version: \" + rep.toString)\n          case x: Device =\u003e println(\"Device: \" + rep.toString)\n          case _ =\u003e println(\"other report: \" + rep.toString)\n        }\n      }\n    }\n\nwhere \"Report\" such as TPV, Version, Device etc... are the scala objects representing\nthe core gpsd socket protocol as described [here](http://catb.org/gpsd/gpsd_json.html).\n\nOther example collectors can be found in the collector directory such as:\n\n  - The FileLogger records data to a text file.\n\n  - The GoogleEarthCollector example shows the GPS location in Google Earth as a placemark.\nNote this collector depends on [scalakml](https://github.com/workingDog/scalakml) and\n[scalaxal](https://github.com/workingDog/scalaxal) libraries. These two libraries are included\nhere in the lib directory.\n\n# Dependencies\n\nGpsd4Scala uses the Play json library part of the [Play framework](http://www.playframework.com/download)\nand [Akka](http://akka.io/).\n\nThe code can be compiled/packaged/run using: sbt compile, sbt package and sbt run.\n\n# Status\n\nGpsd4Scala has not been fully tested yet, as I do not have a GPS device.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkingdog%2Fgpsd4scala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkingdog%2Fgpsd4scala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkingdog%2Fgpsd4scala/lists"}