Skip to content

Commit

Permalink
cleaned up repo
Browse files Browse the repository at this point in the history
  • Loading branch information
thigg committed Mar 20, 2024
1 parent 00a033f commit a0868aa
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 330 deletions.
14 changes: 0 additions & 14 deletions .editorconfig

This file was deleted.

17 changes: 0 additions & 17 deletions .eslintrc.json

This file was deleted.

35 changes: 0 additions & 35 deletions dbrenderer.js

This file was deleted.

52 changes: 0 additions & 52 deletions package.json

This file was deleted.

76 changes: 0 additions & 76 deletions prices.js

This file was deleted.

32 changes: 9 additions & 23 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,13 @@ Findings:
![fahpreise plot](images/img.png)

## How to run
I run the service on a raspberry and do the plots from my laptop. I mount the datafolder of the raspberry
to my laptop with `mkdir /tmp/fahrpreise && sshfs raspberry:/var/fahrpreise /tmp/fahrpreise`.
### run service
1. build this tool with `npm run prodbuild`
5. create `/var/fahrpreise`, `/opt/fahrpreise` and `/etc/fahrpreise/connections.json` and grant access to the fahrpreise user
2. move the files from dist to `/opt/fahrpreise/`
3. create a user fahrpreise
4. install the files from [service](service) to `/etc/systemd/system/`
6. create `/etc/fahrpreise/connections.json` with the connections you want to monitor.
Format:
```json
[
[start, destination],...
]
```

7. `sudo systemctl daemon-reload && sudo systemctl enable --now fahrpreise` to enable the service
8. This collects now every few hours (see timer definition file) the connection prices
9. In /var/fahrpreise are for each capture run the files with date of capture and stations compressed with brotli for minimal filesize
I run the service on a server and create the plots from my laptop. I sync the database file to my laptop for plotting.
### install gatherer service
You can install the gatherer via ansible using this [role](./gatherer_role).
This sets the [node app](./gatherer_hafas) up as a separate user and adds a systemd service and timer
### plot
1. mount the datafoler (see above)
2. run `plotter/main.py` (install dependencies before?)
3. for development of the plotter you can set the accufile parameter so you dont need to accumulate data for every test
1. get the file
2. run `plotter/main.py` (install dependencies before?) with required arguments

# Contributing
For questions/issues use the issue tracker. Feel free to create pull requests with your modifications.
Expand All @@ -50,7 +34,9 @@ If you created interesting results with this tool and published them, let me kno


# License
This is based on [db-prices-cli](https://github.com/derhuerst/db-prices-cli)
This was based on [db-prices-cli](https://github.com/derhuerst/db-prices-cli)
and by Jannis R. Thanks go to him for the great base.

Reworked this to work with a fork of [hafas-client](https://github.com/public-transport/hafas-client). thanks to the authos

See the [license file](license.md) for further information.
36 changes: 0 additions & 36 deletions render.js

This file was deleted.

9 changes: 0 additions & 9 deletions service/fahrpreise.service

This file was deleted.

12 changes: 0 additions & 12 deletions service/fahrpreise.timer

This file was deleted.

5 changes: 0 additions & 5 deletions testconnections.json

This file was deleted.

51 changes: 0 additions & 51 deletions where.js

This file was deleted.

0 comments on commit a0868aa

Please sign in to comment.