allebb / pirrot

A radio repeater controller (supporting both simplex and duplex operation modes) for the RaspberryPi.
https://pirrot.hallinet.com
57 stars 13 forks source link

Implement a new "tripwire" feature (HTTP webhooks on COS) #31

Closed allebb closed 4 years ago

allebb commented 4 years ago

This new feature will enable the user to configure an internet-connected Pirrot repeater to automatically send a HTTP JSON payload to a web URL when the COS is tripped.

This will have many potential use cases including the following:

1) Recording repeater activity (when the repeater is used and how long for) 2) Ability to build apps to alert repeater users that "operators are online" and they may like to join too. 3) Provide data to generate repeater usage graphs on a club website etc.

Additional settings should be added ot the Pirrot configuration file to allow for a user-configurable "ignored interval" this will ensure that during long two-way radio transmissions that there is not masses of HTTP requests being generated. I will implement the functionality so that, by default HTTP requests are sent to a configurable endpoint once every 5 minutes - The user can reduce or increase this interval in the settings if they wish.

This HTTP request should be pushed to a backend thread to ensure that the HTTP request lifecycle does not impact the main Pirrot processes (audio recording and re-transmission of radio messages).

allebb commented 4 years ago

This has now been implemented and tested. This will be released in Pirrot v2.0.0.