- Git installed
- Python 3.10+ installed
- An MQTT broker reachable from your machine
- Repo root must contain
ADaMpy/(that is how the commands below work)
cd $HOME
git clone https://github.com/PubInv/ADaM.git
cd ADaMcd ~
git clone https://github.com/PubInv/ADaM.git
cd ADaMVerify you are in the correct folder.
You must see ADaMpy/ in the listing.
Windows
dirmacOS
lspy -m venv .venv
.\.venv\Scripts\Activate.ps1
python --versionIf PowerShell blocks activation:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
.\.venv\Scripts\Activate.ps1py -m venv .venv
.\.venv\Scripts\activate.bat
python --versionpython3 -m venv .venv
source .venv/bin/activate
python --versionpython -m pip install --upgrade pip
python -m pip install paho-mqttHow to check if it worked
python -m pip show paho-mqtt
Edit:
ADaMpy/config/adam_config.json
Minimum things you must set correctly:
- broker_host, broker_port
- username, password (or use env vars below)
- alarm_topic
- ack_topic
- annunciators (must contain at least one annunciator topic)
Sanity check:
If annunciators is empty, nothing will ever display in Krake.
If you removed username and password from ADaMpy/config/adam_config.json, set them locally before running ADaM.
Environment variables to set:
ADAM_MQTT_USERNAMEADAM_MQTT_PASSWORD
Note: These variables only matter if the ADaM scripts read them. If the code does not read env vars, setting them will have no effect.
$env:ADAM_MQTT_USERNAME = "public"
$env:ADAM_MQTT_PASSWORD = "public"Verify:
echo $env:ADAM_MQTT_USERNAME[Environment]::SetEnvironmentVariable("ADAM_MQTT_USERNAME", "public", "User")
[Environment]::SetEnvironmentVariable("ADAM_MQTT_PASSWORD", "public", "User")Close and reopen PowerShell, then verify:
echo $env:ADAM_MQTT_USERNAMEset ADAM_MQTT_USERNAME=public
set ADAM_MQTT_PASSWORD=publicVerify:
echo %ADAM_MQTT_USERNAME%setx ADAM_MQTT_USERNAME "public"
setx ADAM_MQTT_PASSWORD "public"Close and reopen cmd to apply.
export ADAM_MQTT_USERNAME="public"
export ADAM_MQTT_PASSWORD="public"Verify:
echo $ADAM_MQTT_USERNAMEAdd these lines to your shell profile:
zsh → ~/.zshrc
bash → ~/.bashrc
export ADAM_MQTT_USERNAME="public"
export ADAM_MQTT_PASSWORD="public"Reload:
source ~/.zshrcIf you want this to be usable when removing creds from the config, the code must read these env vars.
Open three terminals. In each terminal:
- cd to repo root (folder that contains ADaMpy/)
- activate the venv
- run the command
Windows (PowerShell)
cd path\to\ADaM
.\.venv\Scripts\Activate.ps1
python -m ADaMpy.ADaMServermacOS
cd /path/to/ADaM
source .venv/bin/activate
python -m ADaMpy.ADaMServerDefault annunciator:
python -m ADaMpy.Krake_SimulatorSpecific annunciator topic:
python -m ADaMpy.Krake_Simulator "adam/out/LEBANON-5"Option A:
python -m ADaMpy.simulators.alarm_generatorOption B:
python -m ADaMpy.simulators.manual_alarm_test- You are running from repo root (folder containing ADaMpy/)
- Your venv is activated
- ADaMpy/config/adam_config.json exists and broker creds are correct
- annunciators[] is not empty
- You are not using placeholder broker credentials