Skip to content

Latest commit

 

History

History
88 lines (57 loc) · 3.21 KB

README.md

File metadata and controls

88 lines (57 loc) · 3.21 KB

GoCD/cctray.xml Raspberry Pi + Unicorn HAT Monitor

show GoCD/cctray.xml status on a Raspberry Pi + a Unicorn HAT (HD)

Build Status

LEDs

Prerequisites

Unicorn HAT Usage

sudo python poll.py <cctray.xml_url> <poll_wait_s>
  • the cctray.xml URL can include basic authentication
  • if the number of status entries exceeds the number of LEDs on the LED matrix (64, here), only the top level entries will be used.
  • after the number of top level exceeds the number of LEDs, the input will be trimmed

quick feedback

Unicorn HAT HD Usage

sudo python poll_hd.py <poll_wait_s> <cctray.xml_url_1> <cctray.xml_url_2> .. <cctray.xml_url_n>
  • same visualization logic as with for the HAT

quick feedback

If you don't use GoCD / can't access cctray.xml

currently, not for the HD HAT. Contribute if necessary

Use a small HTTP server (based on Flask) listening to incoming arrays of status:

sudo python server.py

push status i.e. with httpie:

http post http://127.0.0.1:5500/update status:='["NONE","BUILDING","OK","ERROR","NONE","WHAT?"]' --auth ...

or write your own polling script taking poll.py as an example.

Valid status strings: NONE, BUILDING, ERROR, OK, UNKNOWN

Running as a systemd Service

  • customize install_as_service.sh
  • sudo ./install_as_service.sh
  • reboot or sudo systemctl start cctray_poller.service
  • to uninstall: sudo ./uninstall_service.sh
  • current limitation: the LEDs won't be turned off on signal (service stop): #1

GoCD pipeline as code

The project can be built on GoCD using the new feature: pipeline configuration from source control #1133. For this, use:

  • the gocd yaml config plugin
  • this repository as primary material and as the pipeline definition

The pipeline configuration can be seen in ci.gocd.yaml

The GoCD XML config needs the following addition:

  <config-repos>
    <config-repo plugin="yaml.config.plugin">
      <git url="https://github.com/d-led/gocd-rpi-unicorn-hat-monitor.git" />
    </config-repo>
  </config-repos>