Skip to content

Commit f7138f4

Browse files
committed
updated docs
1 parent 7bc8bb9 commit f7138f4

File tree

10 files changed

+357
-54
lines changed

10 files changed

+357
-54
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include README.rst
1+
include README.md
22
include LICENSE.txt
33
include requirements.txt
44
include aprsd_slack_plugin/py.typed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ help: # Help for the Makefile
1717
dev: venv ## Create the virtualenv with all the requirements installed
1818

1919
docs: build
20-
cp README.rst docs/readme.rst
21-
cp Changelog docs/changelog.rst
20+
cp README.md docs/readme.md
21+
cp ChangeLog docs/changelog.rst
2222
tox -edocs
2323

2424
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

README.md

Lines changed: 298 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,298 @@
1+
# aprsd_slack_plugin
2+
3+
[![Python CI](https://github.com/hemna/aprsd-slack-plugin/workflows/python/badge.svg)](https://github.com/hemna/aprsd-slack-plugin/actions)
4+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://black.readthedocs.io/en/stable/)
5+
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://timothycrosley.github.io/isort/)
6+
7+
This project is a Python plugin for the [APRSD server daemon](https://github.com/craigerl/aprsd) written by Craig Lamparter. The plugin provides integration with Slack, allowing APRS messages and location data to be forwarded to Slack channels.
8+
9+
## Features
10+
11+
The plugin includes three main components:
12+
13+
1. **Location Plugin** - Reports APRS location data to Slack channels with weather information
14+
2. **Message Plugin** - Forwards APRS messages to Slack channels
15+
3. **Notify Plugin** - Sends notifications when watched callsigns appear on APRS
16+
17+
## Requirements
18+
19+
- Python 3.11+
20+
- [APRSD](https://github.com/craigerl/aprsd) - APRS daemon server
21+
- Slack Bot Token and Signing Secret (see setup instructions below)
22+
23+
## Installation
24+
25+
Install the plugin using pip:
26+
27+
```bash
28+
pip install aprsd-slack-plugin
29+
```
30+
31+
Or install from source:
32+
33+
```bash
34+
git clone https://github.com/hemna/aprsd-slack-plugin.git
35+
cd aprsd-slack-plugin
36+
pip install -e .
37+
```
38+
39+
## Slack Bot Setup
40+
41+
Before configuring the plugin, you need to create a Slack bot application:
42+
43+
1. Go to [api.slack.com](https://api.slack.com/apps) and create a new app
44+
2. A good guide for creating the app, tokens, and permissions can be found at:
45+
[https://api.slack.com/start/building/bolt-python](https://api.slack.com/start/building/bolt-python)
46+
47+
3. You will need:
48+
- **Signing Secret**: Found in "Basic Information" → "App Credentials"
49+
- **Bot User OAuth Token**: Found in "OAuth & Permissions" → "OAuth Tokens for Your Team" → "Bot User OAuth Access Token"
50+
51+
4. Required Bot Token Scopes:
52+
- `chat:write` - To post messages to channels
53+
- `channels:read` (optional) - To read channel information
54+
55+
5. Install the app/bot into your workspace
56+
57+
## Configuration
58+
59+
Add the following section to your APRSD configuration file (typically `~/.config/aprsd/aprsd.conf` or `~/.config/aprsd/aprsd.yml`):
60+
61+
### YAML Configuration Format
62+
63+
```yaml
64+
aprsd_slack_plugin:
65+
signing_secret: "your_slack_signing_secret_here"
66+
bot_token: "xoxb-your-bot-token-here"
67+
channels:
68+
- "#general"
69+
- "#aprs"
70+
- "#hamradio"
71+
```
72+
73+
### INI Configuration Format
74+
75+
```ini
76+
[aprsd_slack_plugin]
77+
signing_secret = your_slack_signing_secret_here
78+
bot_token = xoxb-your-bot-token-here
79+
channels = #general,#aprs,#hamradio
80+
```
81+
82+
### Configuration Options
83+
84+
- **`signing_secret`** (required): Your Slack app's signing secret from the App Credentials page
85+
- **`bot_token`** (required): Your Slack bot's OAuth token (starts with `xoxb-`)
86+
- **`channels`** (required): List of Slack channel names (with or without `#` prefix) where messages will be posted
87+
88+
## Usage
89+
90+
Once configured, the plugin will automatically integrate with APRSD. The plugins respond to specific APRS message commands:
91+
92+
### Location Plugin
93+
94+
The Location Plugin responds to messages starting with `L` or `l` and reports the location of a callsign to Slack.
95+
96+
**Command Format:**
97+
```
98+
L [callsign]
99+
```
100+
101+
**Examples:**
102+
103+
1. Get your own location:
104+
```
105+
L
106+
```
107+
108+
2. Get location for a specific callsign:
109+
```
110+
L N0CALL
111+
```
112+
113+
**Slack Output:**
114+
The plugin will post a formatted message to your configured Slack channels with:
115+
- Callsign with link to aprs.fi
116+
- Location description (from weather.gov if in US)
117+
- Map link to aprs.fi
118+
- Altitude in feet
119+
- Time since last update
120+
121+
**Example Slack Message:**
122+
```
123+
APRSD - Slack Location Plugin
124+
📍 N0CALL - Location
125+
126+
Location: Downtown Denver, CO
127+
Map Location: http://aprs.fi/...
128+
Altitude: 5280 ft
129+
Time: 2.3 h ago
130+
```
131+
132+
### Message Plugin
133+
134+
The Message Plugin forwards APRS messages to Slack channels.
135+
136+
**Command Format:**
137+
```
138+
s <message>
139+
slack <message>
140+
```
141+
142+
**Examples:**
143+
144+
1. Send a simple message:
145+
```
146+
s Hello from APRS!
147+
```
148+
149+
2. Send a longer message:
150+
```
151+
slack Testing the Slack integration
152+
```
153+
154+
**Slack Output:**
155+
The plugin will post a message showing the callsign and message content:
156+
157+
```
158+
APRSD - Slack Message Plugin
159+
📡 N0CALL says s Hello from APRS!
160+
```
161+
162+
### Notify Plugin
163+
164+
The Notify Plugin automatically sends notifications when callsigns on your watchlist appear on APRS.
165+
166+
**Setup:**
167+
Add callsigns to your APRSD watchlist configuration. When those callsigns appear on APRS, the plugin will automatically notify your Slack channels.
168+
169+
**Slack Output:**
170+
```
171+
APRSD - Slack Notification Plugin
172+
📡 N0CALL - Is now on APRS
173+
```
174+
175+
## Example Interactions
176+
177+
### Example 1: Checking Your Location
178+
179+
**APRS Message:**
180+
```
181+
L
182+
```
183+
184+
**Slack Output:**
185+
```
186+
APRSD - Slack Location Plugin
187+
📍 N0CALL - Location
188+
189+
Location: Mountain View, CA
190+
Map Location: http://aprs.fi/#!mt=roadmap&z=15&lat=37.4056&lng=-122.0775
191+
Altitude: 150 ft
192+
Time: 0.5 h ago
193+
```
194+
195+
### Example 2: Checking Another Station's Location
196+
197+
**APRS Message:**
198+
```
199+
L W1AW
200+
```
201+
202+
**Slack Output:**
203+
```
204+
APRSD - Slack Location Plugin
205+
📍 W1AW - Location
206+
207+
Location: Newington, CT
208+
Map Location: http://aprs.fi/#!mt=roadmap&z=15&lat=41.6875&lng=-72.7278
209+
Altitude: 200 ft
210+
Time: 1.2 h ago
211+
```
212+
213+
### Example 3: Sending a Message to Slack
214+
215+
**APRS Message:**
216+
```
217+
s Just finished a QSO on 2m!
218+
```
219+
220+
**Slack Output:**
221+
```
222+
APRSD - Slack Message Plugin
223+
📡 N0CALL says s Just finished a QSO on 2m!
224+
```
225+
226+
### Example 4: Watchlist Notification
227+
228+
When a callsign on your watchlist appears on APRS, you'll automatically receive:
229+
230+
**Slack Output:**
231+
```
232+
APRSD - Slack Notification Plugin
233+
📡 W1AW - Is now on APRS
234+
```
235+
236+
## Troubleshooting
237+
238+
### Plugin Not Responding
239+
240+
1. Check that the plugin is enabled in your APRSD configuration
241+
2. Verify your Slack credentials are correct:
242+
- `signing_secret` matches your app's signing secret
243+
- `bot_token` is valid and starts with `xoxb-`
244+
3. Ensure the bot is installed in your Slack workspace
245+
4. Check APRSD logs for error messages
246+
247+
### Messages Not Appearing in Slack
248+
249+
1. Verify the channel names are correct (case-sensitive)
250+
2. Ensure the bot has been invited to the channels (if they're private)
251+
3. Check that the bot has `chat:write` scope
252+
4. Verify the bot token hasn't expired
253+
254+
### Location Plugin Not Working
255+
256+
1. Ensure you have an `aprs_fi.apiKey` configured in APRSD
257+
2. Check that the callsign exists on aprs.fi
258+
3. Verify network connectivity to aprs.fi and weather.gov
259+
260+
## Development
261+
262+
### Running Tests
263+
264+
```bash
265+
tox
266+
```
267+
268+
Or run specific test environments:
269+
270+
```bash
271+
tox -e py311 # Run Python 3.11 tests
272+
tox -e lint # Run linting with ruff
273+
tox -e type-check # Run type checking with mypy
274+
```
275+
276+
### Code Style
277+
278+
This project uses:
279+
- [black](https://black.readthedocs.io/) for code formatting
280+
- [ruff](https://docs.astral.sh/ruff/) for linting
281+
- [isort](https://pycqa.github.io/isort/) for import sorting
282+
283+
## License
284+
285+
Licensed under the Apache License, Version 2.0. See LICENSE.txt for details.
286+
287+
## Contributing
288+
289+
Contributions are welcome! Please feel free to submit a Pull Request.
290+
291+
## Support
292+
293+
For issues and questions:
294+
- GitHub Issues: [https://github.com/hemna/aprsd-slack-plugin/issues](https://github.com/hemna/aprsd-slack-plugin/issues)
295+
296+
## Related Projects
297+
298+
- [APRSD](https://github.com/craigerl/aprsd) - The APRS daemon this plugin extends

aprsd_slack_plugin/base_plugin.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import aprsd_slack_plugin
77

8-
98
CONF = cfg.CONF
109
LOG = logging.getLogger("APRSD")
1110

@@ -18,23 +17,22 @@ class SlackPluginBase:
1817
that location string to the configured slack channel.
1918
2019
To use this:
21-
Create a slack bot for your workspace at api.slack.com.
22-
A good source of information on how to create the app
23-
and the tokens and permissions and install the app in your
24-
workspace is here:
2520
26-
https://api.slack.com/start/building/bolt-python
21+
1. Create a slack bot for your workspace at api.slack.com.
22+
A good source of information is here:
23+
https://api.slack.com/start/building/bolt-python
24+
25+
2. You will need the signing secret from the Basic Information ->
26+
App Credentials form.
2727
28+
3. You will also need the Bot User OAuth Access Token from
29+
OAuth & Permissions -> OAuth Tokens for Your Team ->
30+
Bot User OAuth Access Token.
2831
29-
You will need the signing secret from the
30-
Basic Information -> App Credentials form.
31-
You will also need the Bot User OAuth Access Token from
32-
OAuth & Permissions -> OAuth Tokens for Your Team ->
33-
Bot User OAuth Access Token.
32+
4. Install the app/bot into your workspace.
3433
35-
Install the app/bot into your workspace.
34+
5. Edit your ~/.config/aprsd/aprsd.yml and add the section::
3635
37-
Edit your ~/.config/aprsd/aprsd.yml and add the section
3836
slack:
3937
signing_secret: <signing secret token here>
4038
bot_token: <Bot User OAuth Access Token here>

0 commit comments

Comments
 (0)