update README
This commit is contained in:
parent
835a1f3b6f
commit
07882741ec
1 changed files with 41 additions and 34 deletions
75
README.md
75
README.md
|
@ -2,22 +2,29 @@
|
|||
|
||||
This is a [Flask](http://flask.pocoo.org/) app served via [Gunicorn](https://github.com/benoitc/gunicorn) and [Nginx](http://nginx.org/) using [docker](https://www.docker.com/) containers orchestrated by docker-compose.
|
||||
|
||||
For use with [kizniche/ttgo-tbeam-ttnmapper](https://github.com/kizniche/ttgo-tbeam-ttnmapper) for the T-Beam TTGO (tracker node) that transmits data to [The Things Network](https://thethingsnetwork.org) (TTN) for [TTN Mapper](https://ttnmapper.org/).
|
||||
For use with TTN Mapper nodes such as [kizniche/ttgo-tbeam-ttnmapper](https://github.com/kizniche/ttgo-tbeam-ttnmapper) for the T-Beam TTGO (tracker node), which transmits data to [The Things Network](https://thethingsnetwork.org) (TTN) for [TTN Mapper](https://ttnmapper.org/).
|
||||
|
||||
This app pulls coordinate data acquired from the tracker node that's been stored on TTN. It stores these coordinates in an SQLite database and displays the coordinates on a map ([leaflet](https://github.com/Leaflet/Leaflet)) in your web browser. This is useful for testing the signal range from gateways while driving, so you can see when and where your signal was able to reach a gateway.
|
||||
This app pulls coordinate data acquired from the tracker node that's been stored on TTN. It stores these coordinates in an SQLite database and displays the coordinates on a [leaflet](https://github.com/Leaflet/Leaflet) map in your web browser. This is useful for testing the signal range from LoRaWAN gateways while driving, so you can see when and where your signal was able to reach a gateway.
|
||||
|
||||
This is very similar to the TTN Mapper frontend, however TTN Mapper takes a long time to update the data points on its map. This software runs locally on your own hardware and responds instantly to new data on TTN, making it a good companion in your vehicle if you want to get instant updates as to whether your tracker node successfully communicated its coordinates or not.
|
||||
This is very similar to the TTN Mapper frontend, however TTN Mapper takes a long time to update the data points on its map. This software runs locally on your own hardware and responds instantly to new data on TTN when the browser page is refreshed, making it a good companion in your vehicle if you want to get instant updates as to whether your tracker node successfully transmitted its coordinates or not.
|
||||
|
||||
Features include:
|
||||
### Platforms
|
||||
|
||||
- Multiple map layers, including satellite, topology, and streets (No API keys required)
|
||||
- Measuring tool to measure distances between points
|
||||
- Map stays focused on the same point across page refreshes (refreshing brings in new data)
|
||||
Successfully built this on Raspbian OS (Raspberry Pi 3) and Ubuntu 18.04.2 (64-bit). However, since this is docker, it should run on a variety of other platforms.
|
||||
|
||||
### Features
|
||||
|
||||
- Multiple map layers, including topology, streets, and satellite ([Bing API key](https://www.bingmapsportal.com) required for satellite)
|
||||
- Measuring tool for measure distances between points
|
||||
- Map stays focused on the same point across page refreshes (refreshing adds new data points to the map)
|
||||
- Clicking gateway or data point markers pops up information about them
|
||||
|
||||
### Setup:
|
||||
### TODO
|
||||
|
||||
I've successfully set this up on a Raspberry Pi.
|
||||
- Add user-configurable auto-refresh
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
Make sure you have your application set up on The Things Network with the integration "Data Storage". The integration "TTN Mapper" is optional but is recommended to be able to provide signal data to the public.
|
||||
|
||||
|
@ -37,51 +44,51 @@ cd ttn-tracker
|
|||
|
||||
### Edit the config file
|
||||
|
||||
Edit ttn-tracker/flask_app/config.py with your application API Key, application ID, Device ID(s), and gateway location(s) before building the docker image. If you need to edit this file after the image is created, you can rebuild the image (destroying data) or copy the new config file over the old while the flask_app container is running (see below).
|
||||
Edit ```ttn-tracker/flask_app/config.py``` with your application API Key, application ID, Device ID(s), gateway location(s), and Bing map API key (optional) before building the docker images. If you need to edit this file after the images are created, you can rebuild the image (destroying data) or copy the new config file over the old file while the flask_app container is running (see [Notes](#notes), below).
|
||||
|
||||
### Build and start the app
|
||||
|
||||
This will build and start the app and keep it running across reboots.
|
||||
### Build and start the services
|
||||
|
||||
```sudo make build```
|
||||
|
||||
### Stop app (preserving data)
|
||||
### Access the app
|
||||
|
||||
```sudo docker-compose stop```
|
||||
Open a web browser to the address, below, replacing IP_ADDRESS with the IP address of the system running the docker containers.
|
||||
|
||||
### Start app after stopping
|
||||
|
||||
```sudo docker-compose start```
|
||||
|
||||
### Web Address
|
||||
|
||||
Open a browser to this address, replacing IP_ADDRESS with the IP address of the system running the docker containers.
|
||||
|
||||
http://IP_ADDRESS:5550/dsf673bh
|
||||
```http://IP_ADDRESS:5550/dsf673bh```
|
||||
|
||||
Note: there is no security preventing someone from viewing this page if they happen to request "/dsf673bh" on the server (however, knowing this is the page is unlikely). Therefore, make sure you are comfortable with this or implement your own security measures such as not allowing port 5550 to be publicly accessible (connect to your home network via VPN to access the app) or add a login system such as [Flask-Login](https://github.com/maxcountryman/flask-login).
|
||||
|
||||
### Notes
|
||||
|
||||
#### Stop app and delete data (keep containers)
|
||||
## Notes
|
||||
|
||||
### Stop services (preserving data)
|
||||
|
||||
```sudo docker-compose stop```
|
||||
|
||||
### Start services
|
||||
|
||||
```sudo docker-compose start```
|
||||
|
||||
### Stop services and delete data (keep containers)
|
||||
|
||||
```sudo docker-compose down```
|
||||
|
||||
#### Stop app and delete containers
|
||||
### Stop services and delete containers
|
||||
|
||||
```sudo docker-compose rm -fs```
|
||||
|
||||
#### List docker containers
|
||||
### List docker containers
|
||||
|
||||
```sudo docker ps```
|
||||
|
||||
#### Start a shell in a docker container
|
||||
### Start a shell in a docker container
|
||||
|
||||
```sudo docker exec -i -t CONTAINER_ID /bin/bash```
|
||||
|
||||
#### Copy files to/from a docker container
|
||||
### Copy a file to a docker container
|
||||
|
||||
```
|
||||
docker cp foo.txt CONTAINER_ID:/foo.txt
|
||||
docker cp CONTAINER_ID:/foo.txt foo.txt
|
||||
```
|
||||
```docker cp foo.txt CONTAINER_ID:/foo.txt```
|
||||
|
||||
### Copy a file from a docker container
|
||||
|
||||
```docker cp CONTAINER_ID:/foo.txt foo.txt```
|
||||
|
|
Loading…
Add table
Reference in a new issue