Skip to content

Commit

Permalink
Merge branch 'development' of github.com:peted-davis/WeatherFlow_PiCo…
Browse files Browse the repository at this point in the history
…nsole into development
  • Loading branch information
peted-davis committed Mar 17, 2019
2 parents 2d44c69 + d3db190 commit c24ab16
Showing 1 changed file with 68 additions and 165 deletions.
233 changes: 68 additions & 165 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,179 +14,48 @@ International License.
http://weatherflow.com/smart-home-weather-stations/
https://community.weatherflow.com/

## Update Instructions

Follow these instructions to update an existing installation of the WeatherFlow
PiConsole. These instructions assume you have installed the PiConsole in the
default directory (~/wfpiconsole/). If you have installed the PiConsole in a
different location, I assume you know what you are doing! The update process
will delete all files associated with the currently installed version except the
.ini file, and will then download and install the updated version in its place.

```
cd ~/wfpiconsole/
rm -rf !("wfpiconsole.ini")
wget https://api.github.com/repos/peted-davis/WeatherFlow_PiConsole/tarball -O wfpiconsole.tar.gz
tar -xvf wfpiconsole.tar.gz --strip 1
rm wfpiconsole.tar.gz
python3 main.py
```

If you are have the console setup to auto run using the .service file, copy the
new .service file into /etc/systemd/system and renable:
## Contents

```
sudo cp wfpiconsole.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable wfpiconsole.service
```

## Auto-Run Instructions

If you want to enable the console to auto-run when the Raspberry Pi powers up,
copy the wfpiconsole.service file into /etc/systemd/system/. This .service file
assumes you have installed the PiConsole in the default directory
(~/wfpiconsole/) and are using the default 'Pi' username. If you have installed
the PiConsole in a different location, or are using a different username, I
assume you know what you are doing and can edit the .service file appropriately.

```
cd ~/wfpiconsole/
sudo cp wfpiconsole.service /etc/systemd/system/
```

Start the service using

```
sudo systemctl start wfpiconsole.service
```

If the console boots and everything is working, stop the console and set the
service to start automatically at reboot

```
sudo systemctl stop wfpiconsole.service
sudo systemctl enable wfpiconsole.service
```

Reboot your Raspberry Pi and the console should come up automatically

```
sudo reboot now
```

If you are going to use the auto-start method, it is highly recommended that you
can SSH into your Raspberry Pi, as the console can only be stopped using the
stop command above and not ctrl-c on the keyboard.
**[Installation Instructions](#installation-instructions)**<br>
**[Update Instructions](#update-instructions)**<br>
**[Auto-Start Instructions](#auto-start-instructions)**<br>

## Installation Instructions

Follow these instructions to setup a new installation of the WeatherFlow
PiConsole on your Raspberry Pi Official 7 inch touch screen. This initial
installation should take ~1 hour.
The installation of the WeatherFlow PiConsole is fully automated, and can
be started from the terminal with a single command. The initial installation
should take ~1 hour.

The instructions assume you have already sucesfully setup your Raspberry Pi and
installed Raspbian Stretch with Desktop, have attached the touch screen, and
have either a keyboard and mouse attached directly to the Pi, or you can access
the Pi through SSH/VNC. If you are starting from scratch, some of these links
may help get you started:
The automated installer assumes you have already sucesfully setup your Raspberry
Pi and have installed Raspbian Stretch with Desktop. You should have also attached
the touch screen, and have either a keyboard and mouse attached directly to the Pi,
or have accessesd the Pi remotely through SSH/VNC. If you are starting from
scratch, some of these links may help get you started:

* https://www.raspberrypi.org/downloads/raspbian/
* https://www.raspberrypi.org/documentation/configuration/security.md
* https://www.raspberrypi.org/documentation/remote-access/ssh/
* https://www.raspberrypi.org/documentation/remote-access/vnc/

### Step 1: Make sure your Raspberry Pi is fully up to date

```
sudo apt-get update && sudo apt-get dist-upgrade
```

### Step 2: Upgrade the Python 3 version of Pip

```
python3 -m pip install --upgrade pip
```

### Step 3: Confirm current user is in "input" and "video" groups
### One-Step Automated Install

The WeatherFlow PiConsole can be installed quickly and conveniently with the following
command:
```
sudo usermod -a -G input,video $(whoami)
curl -sSL https://peted-davis.github.io/wfpiconsole | bash
```
Piping a command directly to ```bash``` is controversial, as it prevents you from
reading code that is about to run on your system. If you are worried about the contents
of the installer, please examine the [first](https://raw.githubusercontent.com/peted-davis/peted-davis.github.io/master/wfpiconsole)
and second install files in the Git repository before running the install command.

### Step 4: Install required dependencies

`sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev pkg-config libgl1-mesa-dev libgles2-mesa-dev python-setuptools libgstreamer1.0-dev git-core gstreamer1.0-plugins-{bad,base,good,ugly} gstreamer1.0-{omx,alsa} python-dev libmtdev-dev xclip xsel libatlas-base-dev`

```
y (confirms you want to install dependencies)
[press enter]
```
### Configure and Run WeatherFlow PiConsole

### Step 5: Install required Python modules

```
sudo python3 -m pip install autobahn[twisted] pytz pyasn1-modules service_identity geopy ephem Cython numpy packaging
```

### Step 6: Install Kivy Python library - this make take some time

```
sudo python3 -m pip install git+https://github.com/kivy/kivy.git@master
```

### Step 7: Configure Kivy for Raspberry Pi touchscreen

Run Kivy for the first time to generate configuration files:

```
python3 -c "import kivy"
```

Open file ".Kivy/config.ini" in Nano:

```
nano ~/.kivy/config.ini
```

Delete everything in the [input] section. Add this:

```
mouse = mouse
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput
```

Save changes in Nano:

```
ctrl-x
y (confirms you want to save changes)
[press enter]
```

Reboot the system:

```
sudo reboot now
```

### Step 8: Download WeatherFlow PiConsole source code

```
cd && mkdir wfpiconsole && cd wfpiconsole
wget https://api.github.com/repos/peted-davis/WeatherFlow_PiConsole/tarball -O PiConsole.tar.gz
tar -xvf PiConsole.tar.gz --strip 1
rm PiConsole.tar.gz
```

### Step 9: Configure and Run WeatherFlow PiConsole

To get the WeatherFlow PiConsole up and running, you need to register for a
number of API keys. One API key is needed determine the the station location
(country) from its latitude/longitude, one needed to download an apppropriate
weather forecast, and one needed to download the closest METAR information to
your station location.
As this will be the first time you have run the console, you'll be asked to enter
a number of API keys required by the console to run. One API key is needed
determine the the station location (country) from its latitude/longitude,
one needed to download an apppropriate weather forecast for your location,
and one needed to download the closest METAR information for your location.

First, go to http://www.geonames.org/login and register for a new account. Once
you have registered, go to your account (http://www.geonames.org/manageaccount)
Expand All @@ -209,17 +78,51 @@ Once you have registered for the required API keys, go ahead and run the console
for the first time using:

```
python3 main.py
wfpiconsole start
```

As this is the first run, you'll be asked to enter the API keys you have just
signed-up for above, as well as information about your station. This includes
your station ID and device ID for your outdoor Air and Sky modules. To find this
information either open the WeatherFlow app or view your station page in a web
browser. Click on the gear icon -> Stations -> [Station name] -> Status.
You'll be asked to enter the API keys you have just signed-up for above, as well
as information about your station. This includes your station ID and device ID
for your outdoor Air and Sky modules. To find this information either open the
WeatherFlow app or view your station page in a web browser. Click on the gear icon
-> Stations -> [Station name] -> Status.

If all goes smoothly the console should automatically add the extra information
it needs to your configuration file and then start running.
it needs to your configuration file and then start running. You should not need
to enter this information again.

Congratulations, you have installed the Raspberry Pi Python console for the
Weather Flow Smart Home Weather Station.
Weather Flow Smart Home Weather Station.

## Update Instructions

The WeatherFlow PiConsole can be updated quickly and easily with the following
command:
```
wfpiconsole update
```
The update process will retain your existing user settings, but may prompt for
input from time to time in order to add new functionality. Once the update has
finished, restart the console using
```
wfpiconsole start
```

## Auto-Start Instructions

The WeatherFlow PiConsole can be configured to run automatically when the
Raspberry Pi powers up. To enable the console to start automatically, run
```
wfpiconsole autostart-enable
```
To stop the WeatherFlow PiConsole from starting automatically, run
```
wfpiconsole autostart-disable
```
If you are going to use the auto-start method, it is highly recommended that you
can SSH into your Raspberry Pi, as the console can only be stopped using the
stop command
```
wfpiconsole stop
```
or by a hard power down

0 comments on commit c24ab16

Please sign in to comment.