Giter VIP home page Giter VIP logo

beacon-mountain's Introduction

beacon-mountain

P2P position app. This is a phone app that can act both as a server and as a client. All clients send their nickname and position to the server. The server keep track on all connected clients and return their positions when a client post a new location.

NOTE1: All communication is directly between the phones via GPRS (no data is stored anywhere except on the phone acting as a server)

NOTE2: If you are using WIFI on your phone, this app will most probably not work since it's behind a firewall and/or you have a private IP number.

The app is written for Android and IOS

Some use-cases for the app:

  • For hunting. Place a app in client-mode on a dog and let one hunter have the app in server-mode. Other hunter-clients might connect to the server and view where the dog/other hunters are located
  • For monitoring. To keep track on where your family/group are located at all times (for example in a market place/concert)

Overview of the communication

overview

  1. An app is started in server mode
  2. One or more apps is started in client mode. When the client starts it can choose to input the servers IP directly or leave blank for receiving an SMS with servers IP from the server
  3. (optionally) The server can send one/more SMS:es to the clients (currently using the servers phone's address book)
  4. (optionally) The client receives the SMS from the server, within the app (with the servers IP)

The connection between the client(s) and the server is now established. All clients initiates the connection to the server.

  1. The client send their nickname, position and a flag telling the server if the client wish the receive all other clients positions or not (a client unit attached on a dog, for example, might not need all others positions)
  2. The server replies with nothing (if the flag is 'N') or the nicknames and postions of all other clients (and the server)

Current status

Android:

  • No map is shown yet

IOS:

  • No map is shown yet
  • The server and client protocol part in not yet finished

Protocol

The protocol between the client and server app's is named YAPP (Yet Another Protocol Protocol). As mentioned above, all communication is initiated from the client.

The app acting as a server is listening on port 4711

Currently the protocol looks like this (NOTE breaking changes might be coming):

To server:

HELO:<nickname>:<latitude>:<longitude>:<answer>\0

<nickname>  is the name of the connecting client
<latitude>  is the latitude in WGS84 coordinates
<longitude> is the longitude in WGS84 coordinates
<answer>    is 'N' or 'Y'. If 'N' is sent the client don't want a reply. 'Y'
            means the client want the nicknames and positions for all connected
            clients

Example: HELO:Nick:54.3176:93.1234:N\0

From server:

The 'N' case:

YOLO\0

The 'Y' case:

DATA:<number of records>:<nickname i>:<latitude i>:<longitude i>\0
<number of records> The number of connected clients (including the server)
<nickname i>        i=1..<number of records> The name
<latitude i>        i=1..<number of records> The latitude
<longitude i>       i=1..<number of records> The longitude

Example 1: DATA:0\0
Example 2: DATA:2:Nick:54.3176:93.1234:Nina:54.3312:93.1245\0

Possible enhancements

  • Save position data more permanent (in a database) on the server
  • Let the server remember the nicknames in a group
  • Let the server give the group a name
  • Control the interval, how often the clients send their positions to the server. (A dog might for example send their positions more often than other clients)

beacon-mountain's People

Contributors

johanekblad avatar joparo avatar mattiasbpersson avatar thesam avatar

Watchers

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