Skip to content

Commit

Permalink
Fix log file, add startup to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
devdupont committed Sep 19, 2019
1 parent a963a79 commit 45faa29
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This project requires Python 3.6+ to run the `avwx` library. Run these commands
```bash
python -V
python3 -V
python3.6 -V
python3.7 -V
```

If you're running this on a Raspberry Pi that does not yet have 3.6+ on it, you can find [instructions here](https://gist.github.com/dschep/24aa61672a2092246eaca2824400d37f).
Expand All @@ -29,13 +29,28 @@ However, the program can be run on any screen or computer in its own window for
Install the dependancies using the Python version from above.

```bash
python3.6 -m pip install avwx-engine~=0.11.6 pygame~=1.9.3
pip3 install -r requirements.txt
```

Then just run the screen file to boot the display.

```bash
python3.6 screen.py
python3 screen.py
```

On the main display, pressing the RMK, WX, WX/RMK displays more METAR information. Pressing the gear displays more options.

### Startup

If you want the METAR screen to run on boot, we can use autostart by creating this file:

`/home/pi/.config/autostart/metar.desktop`

```text
[Desktop]
Type=Application
Name=Metar
Exec=/usr/bin/python3 /home/pi/METAR-RasPi/screen.py
```

Make sure the Exec line uses your version of Python and points to your project folder.
9 changes: 5 additions & 4 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@
"9",
]

if cfg.log_file is None:
logger = logging.getLogger()
else:
logger = logging.FileHandler(cfg.log_file)
logger = logging.getLogger()
logger.setLevel(cfg.log_level)
if cfg.log_file is not None:
log_file = logging.FileHandler(cfg.log_file)
log_file.setLevel(cfg.log_level)
logger.addHandler(log_file)


def ident_to_station(idents: [int]) -> str:
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# Set log level - CRITICAL, ERROR, WARNING, INFO, DEBUG
log_level = logging.DEBUG

# Send METAR Pi logs to a file
# Send METAR Pi logs to a file. Ex: "output.log"
log_file = None

# Set to True to shutdown the Pi when exiting the program
Expand Down

0 comments on commit 45faa29

Please sign in to comment.