IOT>> ODS>> 返回
项目作者: ParadigmHyperloop

项目描述 :
Paradigm Telemetry Processing Server for hyperloop-core
高级语言: Python
项目地址: git://github.com/ParadigmHyperloop/ODS.git
创建时间: 2016-11-08T03:10:57Z
项目社区:https://github.com/ParadigmHyperloop/ODS

开源协议:Other

下载


OpenLoop Data Shuttle Build Status

All the Telemetry

This service runs at the Control Point and is the direct recipient of all
telemetry data from all PODs on the PODNET

Overview

The ODS is a required service to operate the Paradigm Pod. Without a valid
telemetry server connection, the OpenLoop Pod will refuse to proceed to a
Post-boot stage. See
the core control code.

ODS is responsible for:

  • Receiving all telemetry from the vehicle (UDP)
  • Storing Telemetry in an InfluxDB server
  • Caching and serving telemetry to the Web UI
  • Maintaining a persistent heartbeat with the pod
    • Handling network disconnects/failures appropriately
  • Relaying Commands from the Web UI to the pod
  • Forwarding telemetry to SpaceX using the SpaceX UDP Telemetry Format (a SpaceXPacket)

The 5 second ASCII diagram

This is far from the actual diagram… it is meant to give you a 10,000 foot
picture

  1. Control Point
  2. +--------------------+
  3. | |
  4. | InfluxDB & Grafana |
  5. | |
  6. +--------------------+
  7. ^
  8. |
  9. +------------+ +-------------+
  10. | | | |
  11. | ODS Server | -- | Web GUI |
  12. | | | |
  13. +---------+--+ +-------------+
  14. ^ |
  15. ===== | +---------------+ ========= Network Boundary (NAP)
  16. | |
  17. +--------------------+ +--+-------------+
  18. | | | |
  19. | Logging Client | | Command Server |
  20. | | | |
  21. +--------------------+ +-------+--------+
  22. ^ |
  23. | Paradigm Pod |
  24. | |
  25. +------------------------------+--------+
  26. | |
  27. | Core Control Thread |
  28. | |
  29. +---------------------------------------+

Setup and Usage

Prerequisites

  • A sane python 3 environment (use virtualenv).
  • InfluxDB (brew install influxdb)
  • Grafana (brew install grafana)

To setup pip on a mac, use the following:

  1. sudo easy_install pip
  2. sudo pip install virtualenv

Install Dependencies

  1. $ virtualenv -ppython3 .env
  2. ...
  3. $ source .env/bin/activate
  4. $ which python3
  5. /Users/edhurtig/dev/ODS2/.env/bin/python3 # Just make sure it's not the global python
  6. $ pip install -r requirements.txt
  7. ...

Running

If you have Influxdb running on your localhost and the core control code is running on your computer, then you can just run ./ods.py --pod-addr="127.0.0.1". Otherwise,
use the following arguments to tell the ODS server where you have InfluxDB
running so that it can dump the incoming telemetry data.

  1. usage: ods.py [-h] [-v] [-p PORT] [-d DIRECTORY] [-s SERIAL]
  2. [--spacex-host SPACEX_HOST] [--spacex-port SPACEX_PORT]
  3. [--team-id TEAM_ID] [--http-host HTTP_HOST]
  4. [--http-port HTTP_PORT] [--influx-host INFLUX_HOST]
  5. [--influx-port INFLUX_PORT] [--influx-user INFLUX_USER]
  6. [--influx-pass INFLUX_PASS] [--influx-name INFLUX_NAME]
  7. [--web-root WEB_ROOT] [--pod-addr POD_ADDR]
  8. [--pod-port POD_PORT]
  9. Paradigm (formerly Openloop) Data Shuttle
  10. optional arguments:
  11. -h, --help show this help message and exit
  12. -v, --verbose
  13. -p PORT, --port PORT Server listen port
  14. -d DIRECTORY, --directory DIRECTORY
  15. directory to store raw log and data files in
  16. -s SERIAL, --serial SERIAL
  17. Serial device that spits out raw data
  18. --spacex-host SPACEX_HOST
  19. IP of the SpaceX data reciever (192.168.0.1)
  20. --spacex-port SPACEX_PORT
  21. The SpaceX data reciever port
  22. --team-id TEAM_ID The team id assigned by spacex
  23. --http-host HTTP_HOST
  24. The hostname/ip to bind the HTTP Server to
  25. --http-port HTTP_PORT
  26. The port to bind the HTTP Server to
  27. --influx-host INFLUX_HOST
  28. Influxdb hostname
  29. --influx-port INFLUX_PORT
  30. Influxdb port
  31. --influx-user INFLUX_USER
  32. Influxdb username
  33. --influx-pass INFLUX_PASS
  34. Influxdb password
  35. --influx-name INFLUX_NAME
  36. Influxdb database name
  37. --web-root WEB_ROOT Path to the Pod Web Static Files
  38. --pod-addr POD_ADDR IP of the pod
  39. --pod-port POD_PORT Command Port on the pod

To run ODS for competitions use:

  1. ./ods.py --pod-addr="192.168.0.10" --spacex-host="192.168.0.1" --spacex-port=3000 --team-id=11

To run ODS for testing with the pod:

  1. ./ods.py --pod-addr="192.168.0.10"

To run ODS local full-system HOOTL testing, along with the packet_test_server.py script found in Google Drive, along with the core control code.

  1. ./ods.py --pod-addr="127.0.0.1" --spacex-host="127.0.0.1" --spacex-port=3000 --team-id=11

PodCTL

A utility called PodCTL is also included in this repo. PodCTL acts as a
terminal emulator for the remote command interface. It utilizes the same module
for connecting to the pod as ODS itself and is thus co-located in this repo.

  1. ./podctl.py --host "127.0.0.1"

License

See the LICENSE for full licensing details.

In summary, (you still need to read the whole thing), this code is for
OpenLoop and OpenLoop only. It is shared with the world for the benefit of
observers and potential developers. If you wish to utilize this code in any
way, you must contact us first and receive written permission to utilize the
source for the purpose you require.

Lastly, DON’T trust this code to work for your HyperLoop pod, or your project.
This code is only being verified and tested on the OpenLoop platform.