飛行派工作日誌《十》 | FreeSandal 16/12/4 FreeSandal

樹莓派, 樹莓派之學習, 樹莓派之教育 飛行派工作日誌《十》

2016-12-04 | 懸鉤子 | 發表迴響

安裝軟體,使用 gps 接收器, Adafruit 已有很好的入門文件︰

Adafruit Ultimate GPS on the Raspberry Pi

Adding GPS tracking to your Pi-based projects

Introduction Setting Everything Up Using your GPS Using UART instead of USB Further Resources

Multiple Pages Download PDF

若想自己寫應用程式,最好先知道 gpsd 的來歷︰

gpsd — a GPS service

http://www.freesandal.org/?p=63189 1 / 9 飛行派工作日誌《十》 | FreeSandal 16/12/4 About gpsd

gpsd is a service daemon that monitors one or more GPSes or AIS receivers attached to a host computer through serial or USB ports, making all data on the location/course/velocity of the sensors available to be queried on TCP port 2947 of the host computer.

With gpsd, multiple location-aware client applications can share access to supported sensors without contention or loss of data. Also, gpsd responds to queries with a format that is substantially easier to parse than the NMEA 0183 emitted by most GPSes. The gpsd distribution includes a linkable service library, a C++ wrapper class, and a Python module that developers of gpsd-aware applications can use to encapsulate all communication with gpsd. Third- party client bindings for Java and Perl also exist.

Besides gpsd itself, the project provides auxiliary tools for diagnostic monitoring and profiling of receivers and feeding location-aware applications GPS/AIS logs for diagnostic purposes.

GPSD is everywhere in mobile embedded systems. It underlies the map service on Android phones. It’s ubiquitous in drones, robot submarines, and driverless cars. It’s increasingly common in recent generations of manned aircraft, marine navigation systems, and military vehicles.

Applications that presently use gpsd include pyGPS, , GpsDrive, gpeGPS, roadmap, roadnav, navit, viking, tangogps, foxtrot, obdgpslogger, geohist, LiveGPS, geoclue, qlandkartegt, gpredict, OpenCPN, gpsd-navigator, gpsd-ais- viewer, and firefox/mozilla. In addition, the Android smartphone (from version 4.0 onwards and possibly earlier; we don’t know for sure when the change happened) uses GPSD to monitor the phone’s on-board GPS, so every location-aware Android app is indirectly a GPSD client.

GPSD is also extremely widely deployed in mobile embedded systems: it’s a basic building block for navigation used http://www.freesandal.org/?p=63189 2 / 9 飛行派工作日誌《十》 | FreeSandal 16/12/4 by UAVs, robot submarines, and driverless cars as well as more conventional applications like marine navigation and military IFF systems.

Under , gpsd normally runs with zero configuration. Binary packages for this program install hotplug scripts that do the right thing when a USB device goes active, launching gpsd if needed and telling gpsd which device to read data from. Then, gpsd deduces a baud rate and GPS/AIS type by looking at the data stream.

gpsd is high-quality, carefully-audited code; see our notes on reliability engineering. In January 2010, the GPSD project won the first Good Code Grant from the Alliance for Code Excellence.

Statistics about the code volume, commit history, and contributors associated with this project are available at OpenHUB

Our development platforms are open-source Unixes — Linux, and the *BSD family. Presently Linux, OpenBSD and NetBSD are directly supported. The code is also extremely widely deployed on Android phones. We’ll support proprietary Unixes if it’s not too much work (and it usually isn’t). Apple’s OS X is supported in a limited fashion. Some older OS X drivers are buggy and prevent gpsd from being able to read from some USB-serial devices. No, we don’t support Windows — get a better operating system.

If you represent a GPS manufacturer interested in qualifying your device for use with Linux and other open- source operating systems, we are your contact point. We’ll need (1) on-line access to interface documentation, (2) a few (as in, no more than three) eval units, and (3) an engineering contact at your firm. For more, see our page welcoming vendor cooperation.

There are simple installation instructions for people running distributions with binary package systems. See the FAQ for information on how to report bugs.

http://www.freesandal.org/?p=63189 3 / 9 飛行派工作日誌《十》 | FreeSandal 16/12/4 If you appreciate GPSD, and especially if you make money from it, please leace a remittance at Patreon.

News

This web page was last updated on Fri Sep 2 12:26:05 2016. You can browse the project’s news file or to-do list here. Note: because of the way this website is maintained, these files may reflect the state of the repository tip (development version) rather than the latest released stable version.

看一看

GPSD Client HOWTO

Eric S. Raymond version 1.19, Jul 2015

Table of Contents Introduction Sensor behavior matters What GPSD does, and what it cannot do How the GPSD wire protocol works Interfacing from the client side The sockets interface Shared-memory interface D-Bus broadcasts C Examples C++ examples Python examples Other Client Bindings Java Perl Backward Incompatibility and Future Changes

派生 Python 愛好者,或需讀一讀 gps.py 原始碼哩︰

gpsd/gps/gps.py http://www.freesandal.org/?p=63189 4 / 9 飛行派工作日誌《十》 | FreeSandal 16/12/4 #!/usr/bin/env python

# -*- coding: utf-8 -*-

#

# This file is Copyright (c) 2010 by the GPSD project

# BSD terms apply: see the file COPYING in the distribution root for details.

#

# gps.py — Python interface to GPSD.

#

# This interface has a lot of historical cruft in it related to old

# protocol, and was modeled on the C interface. It won’t be thrown

# away, but it’s likely to be deprecated in favor of something more

# Pythonic.

#

# The JSON parts of this (which will be reused by any new interface)

# now live in a different module.

#

http://www.freesandal.org/?p=63189 5 / 9 飛行派工作日誌《十》 | FreeSandal 16/12/4

上一篇文章 飛行派工作日誌《九》

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

迴響

名稱 *

電子郵件 *

個人網站

張貼迴響

十二月 2016

日 一 二 三 四 五 六

1 2 3 http://www.freesandal.org/?p=63189 6 / 9 飛行派工作日誌《十》 | FreeSandal 16/12/4 4 5 6 7 8 9 10

11 12 13 14 15 16 17

18 19 20 21 22 23 24

25 26 27 28 29 30 31

« 十一月

搜尋 …

近期文章

飛行派工作日誌《十》

飛行派工作日誌《九》

飛行派工作日誌《八》

飛行派工作日誌《七》

飛行派工作日誌《六》

近期迴響

Phonon Republic 【聲子共和國】 | 夸克資訊 在 Phonon Republic ︰【聲子共和國】之緣起

音樂派初登場 | 樹莓派|Raspberry Pi 在 Phonon Republic ︰【聲子共和國】之緣起

樹莓派 3B 外篇 | 樹莓派|Raspberry Pi 在 W!o+ 的《小伶鼬工坊演義》︰樹莓派 3 三兩事之 UART 篇

懸鉤子 在 勇闖新世界︰ W!o《卡夫卡村》變形祭︰教具教材‧計算觀

Bally 在 勇闖新世界︰ W!o《卡夫卡村》變形祭︰教具教材‧計算觀

彙整

2016 年 十二月

2016 年 十一月

2016 年 十月

2016 年 九月 http://www.freesandal.org/?p=63189 7 / 9 飛行派工作日誌《十》 | FreeSandal 16/12/4

2016 年 八月

2016 年 七月

2016 年 六月

2016 年 五月

2016 年 四月

2016 年 三月

2016 年 二月

2016 年 一月

2015 年 十二月

2015 年 十一月

2015 年 十月

2015 年 九月

2015 年 八月

2015 年 七月

2015 年 六月

2015 年 五月

2015 年 四月

2015 年 三月

2015 年 二月

2015 年 一月

2014 年 十二月

2014 年 十一月

2014 年 十月

2014 年 九月

2014 年 八月

2014 年 七月

2014 年 六月

2014 年 五月

http://www.freesandal.org/?p=63189 8 / 9 飛行派工作日誌《十》 | FreeSandal 16/12/4

分類

樹莓派

樹莓派之問答

樹莓派之學習

樹莓派之實作

樹莓派之教育

樹莓派之文摘

樹莓派之疑難

樹莓派之編程

樹莓派之除錯

部落格訊息

其它

註冊

登入

文章 RSS 訂閱

迴響 RSS 訂閱

WordPress 台灣正體中文

自豪的採用 WordPress

http://www.freesandal.org/?p=63189 9 / 9