Code Monkey home page Code Monkey logo

gps-beacon's Introduction

Task

Make BLE beacon to transmit GPS coordinates:

  • GPS coordinates should be given to the beacon via command from PC
  • Bluetooth beacon should have a distinctive Bluetooth device name
  • GPS coordinates should be transmitted as advertising data

Solution

Solution consists of firmware for NRF52 and two PC applications (nmeaSender and bleReceiver).

Firmware

It receives NMEA GPRMC messages via UART and parses them. After parsing, firmware updates advertising data with new latitude and longitude.

UART settings and data format

Port settings: 115200, 8bit, no parity, no flow. NMEA string example:

$GPRMC,094236.013,A,5926.669,N,02444.875,E,060.4,203.3,210719,000.0,W*73
$GPRMC,094240.013,A,5926.547,N,02444.962,E,083.4,227.0,210719,000.0,W*72

<CR><LF> ends the message.

BLE advertising packet format

02 01 04= First element with flags

0B = length of "MANUFACTURER_SPECIFIC_DATA"

FF = indicates "MANUFACTURER_SPECIFIC_DATA"

FF FF = Company identifier

00 00 00 00 00 00 00 00 = 4 bytes of latitude and 4bytes of longitude

08 09 74 72 61 63 6B 65 72 D2 = Device short name "tracker"

nmeaSender

App reads line by line NMEA data from file and sends to serial port with period 1 sec.

./nmeaSender/nmeaSender /dev/ttyACM0 nmeaSender/sample.nmea

Tool for generating GPS logs in NMEA format: NMEA Generator

bleReceiver

App receives BLE advertising packets, parse and draw points on the map. It uses Bluez HCI so it requires root privileges to run.

sudo ./bleReceiver/bleReceiver 

Screenshot

Required software

  1. Cross-platform IDE for embedded systems: Segger Embedded Studio. After installation open and add nRF CPU Support Package via Tools->Package Manager

  2. All-in-one debugging solution: J-Link / J-Trace Downloads

  3. Software development kit for the nRF52 SoC: nRF5 SDK ver 15.3059 ac345. Download and extract content to firmware/nRF5_SDK folder

  4. Libraries to compile PC utils:

sudo apt install libbluetooth-dev 

And Qt 5.12 framework

How to build

  1. nmeaSender
cd nmeaSender
qmake
make
  1. firmware Open firmware/beacon.emProject in Segger Embedded Studio, build and flash.

  2. bleReceiver

cd bleReceiver
qmake
make

gps-beacon's People

Contributors

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