Nh-holly

From Nottinghack Wiki
Jump to navigation Jump to search

Description

nh-holly is the MQTT IRC bot running on holly that is resident in #nottinghack on Freenode. The bot itself does very little - only maintaining a connection to IRC and Mosquitto, and forwarding messages between the two.

Usage - MQTT

All messages in the #nottinghack IRC channel are published to the MQTT topic nh/irc/rx/nottinghack/<nick>, and any PMs the bot receives are published to nh/irc/rx/pm/<nick> (yes, this means the bot won’t work correctly if it ever tried to join #pm).

Any messages published to either nh/irc/tx or nh/irc/tx/nottinghack will be output to the IRC channel; any messages published to nh/irc/tx/pm/<nick> will be sent as a private message to that IRC user.

Usage - IRC

At present, there are a few parts of the HackSpace Instrumentation project using nh-holly:

  • Gatekeeper - Announces every time the door is opened/closed, and includes the handle of the member opening the door when known. GateKeeper also announces when the door bell is rang or the last-man-out switch is changed.
  • nh-matrix - The message on the LED Matrix and Mini-matrix display can be updated by saying "!display <msg>" in #nottinghack.
  • nh-gk-if - This talks to a USB I/O board; say "!bell" in #nottinghack to ring a bell next to Holly. long gone.
  • nh-irccat - there are a few scripts (stolen from London Hackspace) than can be used (prefixed with ?, unlike ! for other commands)
  • nh-temperature - report the temperature currently reported by various sensors in the Hackspace

Say "!help" to get a list of commands the bot will act on (note the responses to "!help" come from the apps that will take the action, so, for example, if nh-matrix isn't running, "!display" would not appear on the list).

Configuration / maintenance

nh-holly is started at boot using an upstart script, and can be stopped/started at any time by running “stop nh-holly” or “start nh-holly” as root. nh-holly's configuration file is in "/home/instrumentation/conf/nh-irc.conf", and can be used to set the IRC server, MQTT broker address, IRC nick, etc. The log file is in "/home/instrumentation/logs/", and includes a log of all chat message in the channel, along with all MQTT messages sent/received.

Source

Source on Github.

TODO: Further details, building, configuring, etc.