diff --git a/README.md b/README.md index 3642788cdfb8b08557020a2f26276b83a8066562..46069a57cf84ea7c2285445ad84d6f71a6975a06 100644 --- a/README.md +++ b/README.md @@ -54,24 +54,7 @@ The start-up procedure is needed both after bootstrapping and after a system reb make start elk-configure-host ``` -The software devices start in an OFF state, after bootstrap or reboot. To boot the devices, go to Jupyter (port 8888), start a new notebook, and run: - -``` -# start boot device -boot.initialise() -boot.on() - -# this should report as DevState.ON -boot.status() - -# boot station -boot.initialise_station() - -# wait until this reports the initialisation is done (or was stopped half way): -print(f"Still initialising: {boot.initialising_station_R}. Completeness: {boot.initialisation_progress_R}%. State: {boot.initialisation_status_R}") -``` - -Then, in Grafana (port 3000), you should see the devices reaching the ON state. +The software devices start in an OFF state, after bootstrap or reboot. To boot the devices, go to Jupyter (replace "localhost" with the hostname of your installation, if required): http://localhost:8888/notebooks/Home.ipynb . Then, in Grafana (http://localhost:3000), you should see the devices reaching the ON state. # Remote Interfaces diff --git a/jupyter-notebooks/Home.ipynb b/jupyter-notebooks/Home.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..fdc993d374fe9b757580af20d3750de065bc010f --- /dev/null +++ b/jupyter-notebooks/Home.ipynb @@ -0,0 +1,114 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "d3ffb821", + "metadata": {}, + "source": [ + "# Welcome to your LOFAR2.0 station!\n", + "\n", + "The following interfaces are available to you, on the same host as this notebook, but on different ports:\n", + "\n", + "|Interface |Subsystem |Port|Credentials |\n", + "|----------|----------|----|--------------|\n", + "|Scripting |Jupyter |8888| |\n", + "|Monitoring|Grafana |3000|admin/admin |\n", + "|Logs |Kibana |5601| |\n", + "|ReST |tango-rest|8080|tango-cs/tango|\n", + "\n", + "Below are codes to manage the station at high level." + ] + }, + { + "cell_type": "markdown", + "id": "70a5de26", + "metadata": {}, + "source": [ + "## (Re)boot station\n", + "The code below is used to:\n", + "* Reboot all station software\n", + "* Reset the hardware configuration" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "57263a16", + "metadata": {}, + "outputs": [], + "source": [ + "# Restart boot device itself\n", + "boot.off()\n", + "assert boot.state() == DevState.OFF, boot.state()\n", + "\n", + "boot.initialise()\n", + "assert boot.state() == DevState.STANDBY, boot.state()\n", + "\n", + "boot.on()\n", + "assert boot.state() == DevState.ON, boot.state()" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "64f33a76", + "metadata": {}, + "outputs": [], + "source": [ + "# Request to reinitialise the station.\n", + "#\n", + "# WARNING: This will reset settings across the station!\n", + "boot.initialise_station()\n", + "assert boot.state() != DevState.FAULT" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "714b7f0b", + "metadata": {}, + "outputs": [], + "source": [ + "import time\n", + "\n", + "while boot.initialising_station_R:\n", + " print(f\"Still initialising station. {boot.initialisation_progress_R}% complete. State: {boot.initialisation_status_R}\")\n", + " time.sleep(1)\n", + "\n", + "if boot.initialisation_progress_R == 100:\n", + " print(\"Done initialising station.\")\n", + "else:\n", + " print(f\"Failed to initialise station: {boot.initialisation_status_R}\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "299b0ceb", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "StationControl", + "language": "python", + "name": "stationcontrol" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}