Installation¶
This guide will walk you through installing a fresh copy of PokeAlarm.
Table of Contents
Prerequisites¶
This guide assumes the following:
- Latest version of Python 3.7+ installed.
- Git installed.
- Map’A’Droid, RealDeviceMap, or another supported scanner successfully installed.
- You are using a quality text editor like Notepad++, Nano, Vi(m) or VSCode.
Warning
Do NOT use (or even open) any files with Notepad or TextEdit - they change the encoding on the file and prevent it from loading correctly.
Installing¶
- Prepare your environment - By installing a new Python project, it is
strongly recommended to create an isolated environment to avoid package
conflicts with other Python projects like MAD or RocketMAD. To do so,
install
sudo apt install python3-virtualenvif you still don’t have it. Then create a new environment for PokeAlarm withvirtualenv -p python3 ~/pokealarm_envand enter to it by typingsource ~/pokealarm_env/bin/activate. You must be in this PA env before running any commands starting bypip3orpython3. - Clone a local copy of PokeAlarm - Create a new folder to install
PokeAlarm in. Do not install it in your scanner directory. In a terminal,
run the command
git clone https://github.com/PokeAlarm/PokeAlarm.gitto create a local copy of the project. This will create a folder called ‘PokeAlarm’ that will contain the application. - Install the requirements - In a terminal, navigate into the root folder
of your PA installation. Run
pip3 install -r requirements.txt --upgrade. This will install and update the modules that PokeAlarm needs to run. - Configure PokeAlarm - Next you need to configure PokeAlarm.
- Server Settings let you configure things like host IP, port, language, and more.
- Filters represent which Events trigger notifications. You will need to create a filters file before starting PA.
- Alarms represent where and how notifications. You will need to create an alarms file before starting PA.
Running¶
- Start PokeAlarm - In a terminal, use the command
python3 start_pokealarm.pyto start PokeAlarm and begin listening for information. If successful, you will see the following in the output:
Note
PokeAlarm installs some dependencies on the fly. If you encounter errors when first running a new service, try running as root (with sudo) to ensure it can install the dependency.
Setup Scanner Webhook - Next, configure your scanner to send information to PA’s address.
- For MAD: Configure the webhook types and URL to send info as explained in MAD config.ini.
- For RealDeviceMap: Configure the webhook URL to send info as explained in RealDeviceMap wiki.
Finally, start your scanner. If everything is set up correctly, PA will start logging information about what it is doing to the console.
Updating¶
Warning
Updating PokeAlarm can be complicated if you edit files you aren’t
supposed to. For this reason, we recommend not to edit any files ending in
.py.
- Check the Patch Notes for any big changes that might break your current configuration.
- Open up a command line and change directory to the root folder of your install.
- Run the command
git pull && pip3 install -r requirements.txt --upgradeto update to the latest version.