Code Monkey home page Code Monkey logo

ublox-neo6m-gps's Introduction

U-blox NEO6M GPS Device Driver

A simple device driver for the U-blox NEO6M (might be compatible with other NEO-6 series although it is now deprecated according to the product page). It uses software-serial to communicate with the GPS receiver over the Raspberry Pi GPIO pins. See the datasheet for the module itself and the NMEA-0183 protocol for more information about the hardware.

Software Requirements

Besides the actual hardware, to connect and use the GPS receiver with the Raspberry Pi (running Raspbian), it needs the following packages/executables.

  • kernel headers : the kernel headers are needed to compile this kernel module. The version to download will depend on your (target) kernel version which can be found running uname -r.
  • dtc : RPi uses device tree for hardware enumeration. The dtc command will be used to compile the overlay and it may already be installed by default. The compiled overlay can be placed in the overlays directory and configured to be applied on boot.

Configuration

By default, the GPS receiver uses the NMEA 0183 protocol with the following UART settings:

  • Baudrate : 9600 bps
  • Data bits : 8
  • Parity bit : None
  • Stop bit : 1
  • Supported messages : GSV, RMC, GSA, GGA, GLL, VTG, TXT

Although the GPS receiver can handle other communication protocols and messages, this is the configuration used for this project. For more information on the configuration, see the datasheet for the GPS receiver.

Install

Clone the repository, run make to compile the device tree overlay and the kernel module.

Device Tree Overlay

This kernel module uses the GPIO pins specified in overlay.dts. Therefore, the overlay must be compiled, and put into /boot/firmware/overlays/ for it to be accessible. Specify the overlay in /boot/config.txt to apply the overlay. For example,

# Compile the overlay
dtc -@ -I dts -O dtb -o $(DT_OVERLAY).dtbo $(DT_OVERLAY).dts

# Place the overlay in the overlays dir
cp $(DT_OVERLAY).dtbo /boot/firmware/overlays/.

# Edit config.txt to include the overlay
echo "dtoverlay=$(DT_OVERLAY)" >> /boot/config.txt

After rebooting, check that the overlay has been properly applied to the device tree by running

dtc -I fs /sys/firmware/devicetree/base | less

There should be the module name in the device tree.

Kernel Module

To install the kernel module, run :

insmod gps.ko

sudo may be needed due to permission. modprobe may be used instead of insmod but there are no other dependencies for this module. To ensure that the kernel module has been installed, check the messages from the kernel by running :

dmesg -wH

To remove (uninstall) the kernel module, run :

rmmod gps

Usage

As it is a kernel module, you can use applications like cat and echo to read and write data to the device. For example:

TODO:

License

GPL

ublox-neo6m-gps's People

Contributors

thinkty avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.