{"id":3446,"date":"2024-09-12T20:53:50","date_gmt":"2024-09-12T19:53:50","guid":{"rendered":"https:\/\/m0aws.co.uk\/?p=3446"},"modified":"2024-10-18T19:51:13","modified_gmt":"2024-10-18T18:51:13","slug":"allstarlink-control-dashboard","status":"publish","type":"post","link":"https:\/\/m0aws.co.uk\/?p=3446","title":{"rendered":"AllStarLink Control Dashboard"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Ever since I built my <a href=\"https:\/\/m0aws.co.uk\/?p=3395\" target=\"_blank\" rel=\"noreferrer noopener\">RaspberryPi\/SHARI AllStarLink node<\/a> I&#8217;ve had to manage connecting\/disconnecting to\/from other nodes using the Allmon2 or Supermon web admin interfaces. These work fairly well albeit, a bit clunky and buggy. It&#8217;s impossible to use from a mobile device though and so I have to get my Macbook out each time I want to connect\/disconnect nodes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Being a Node-RED fanatic I decided that I should put something together that was more portable, mobile friendly and much easier to use. A simple user interface is all that is required and can be achieved very easily using the standard Node-RED dashboard nodes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Initially I started investigating the Linux command-line interface for Asterisk, the VOIP system that underpins AllStarLink (ASL). I very quickly discovered that the ASL node can be very easily controlled directly from the command-line and that this would be an ideal interface to use to enable node management via a Node-RED dashboard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In very little time at all I had an experimental control dashboard working with the ASL node and was able to connect\/disconnect to\/from a single node. All that was required now was to extend this so that I could connect to a number of nodes with nothing more than a push of a button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/M0AWS-ASL-Dashboard-flow.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1615\" height=\"1285\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/M0AWS-ASL-Dashboard-flow.png\" alt=\"AllStarLink Control Dashboard - Node-RED Flow\" class=\"wp-image-3450\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/M0AWS-ASL-Dashboard-flow.png 1615w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/M0AWS-ASL-Dashboard-flow-300x239.png 300w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/M0AWS-ASL-Dashboard-flow-768x611.png 768w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/M0AWS-ASL-Dashboard-flow-1536x1222.png 1536w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption class=\"wp-element-caption\">Completed v1.0 AllStarLink Control Dashboard &#8211; Node-RED Flow<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The resultant flow consists of 3 sections, <em>Connect\/Disconnect Main Flow<\/em>, <em>Manage Node Subflow<\/em> and \/<em>var\/log\/asterisk\/connectlog Subflow<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <em>Connect\/Disconnect Main Flow<\/em> handles all the input from the buttons on the dashboard and the communication to the underlying Asterisk VOIP system.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The button status is denoted by 3 colours, green (Ready to connect), orange (Transitioning to\/from connect) and red (Connected). Each button is updated automatically by the button refresh function that is triggered every 2 seconds.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <em>Manage Node Subflow<\/em> provides a simple interface to restart the Asterisk VOIP system, reboot the RaspberryPi and shutdown the RaspberryPi. The node status is automatically updated every 45 seconds and will show when the Asterisk subsystem is being restarted or the node is being rebooted or shutdown.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally the <em>var\/log\/asterisk\/connectlog Subflow<\/em> monitors the Asterisk connectlog looking for connect\/disconnect messages so that it can signal to update each button status.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"608\" height=\"1260\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/M0AWS-ASL-Dashboard-4.png\" alt=\"Node-RED AllStarLink Dashboard\" class=\"wp-image-3455\" style=\"width:240px;height:auto\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/M0AWS-ASL-Dashboard-4.png 608w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/M0AWS-ASL-Dashboard-4-145x300.png 145w\" sizes=\"auto, (max-width: 608px) 100vw, 608px\" \/><figcaption class=\"wp-element-caption\">Node-RED AllStarLink Dashboard<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Each section of the dashboard can be collapsed\/opened by touching\/clicking the little blue arrows on the right of the dashboard. The dashboard works fine on Android, iOS, Windows, MacOS and Linux.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re not familiar with Node-RED and haven&#8217;t yet installed it to your PC, take a look at the <a href=\"https:\/\/nodered.org\/docs\/getting-started\/\">Node-RED Getting Started Page<\/a>. The information takes you through installing Node-RED onto a multitude of devices including PC and RaspberryPi devices.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have Node-RED installed all you need to do is download the AllStarLink Control  Dashboard Flow and import it to your Node-RED flow editor.<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-12dbd6c2-5876-415b-aadc-910dfc5c83bf\" href=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/10\/AllStarLink-Dashboard-v1-2.zip\">AllStarLink-Dashboard-v1-2<\/a><a href=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/10\/AllStarLink-Dashboard-v1-2.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-12dbd6c2-5876-415b-aadc-910dfc5c83bf\">Download<\/a><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Note: The link above is now for v1.2 of the flow which includes some critical bug fixes. You can read about the bug fixes in the <a href=\"https:\/\/m0aws.co.uk\/?p=3539\" target=\"_blank\" rel=\"noreferrer noopener\">v1.2 release article<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once downloaded, select <em>Import<\/em> from the <em>burger<\/em> menu icon on the right-hand side of the flow editor as shown below and import the flow file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"310\" height=\"603\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/Node-RED-Import-Flow-Menu-Screenshot.png\" alt=\"Node-RED Flow Editor import Menu Item\" class=\"wp-image-3464\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/Node-RED-Import-Flow-Menu-Screenshot.png 310w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/Node-RED-Import-Flow-Menu-Screenshot-154x300.png 154w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><figcaption class=\"wp-element-caption\">Node-RED Flow Editor import Menu Item<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once imported you will find that some of the nodes in the flow are not available. This is because you need to add them to the flow editor palette before being able to deploy the flow.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Drop down the same menu as shown above but, this time select <em>Manage Palette<\/em>. This will open another window where you will need to select the <em>Install<\/em> tab as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/Node-RED-Flow-Editor-Pallete-Install.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1034\" height=\"761\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/Node-RED-Flow-Editor-Pallete-Install.png\" alt=\"Node-RED Flow Editor Palette Install Tab\" class=\"wp-image-3468\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/Node-RED-Flow-Editor-Pallete-Install.png 1034w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/Node-RED-Flow-Editor-Pallete-Install-300x221.png 300w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/Node-RED-Flow-Editor-Pallete-Install-768x565.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption class=\"wp-element-caption\">Node-RED Flow Editor Palette Install Tab<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You need to install two node sets to complete the flow, <em>node-red-contrib-bigssh<\/em> and <em>node-red-dashboard<\/em>. Type in the name of each package one at a time in the search bar and then click the <em>Install<\/em> button. <br>Once the two packages are installed you then need to configure the credentials for logging into your RaspberryPi. This is simply done by double clicking the blue <em>Send Command to ASL <\/em>node at the top of the main flow and then clicking the <em>Pencil<\/em> button at the end of the Credentials field. This will open another window where you will need to type in the IP Address of your ASL RaspberryPi into the <em>Host<\/em> field, then enter 22 into the <em>port<\/em> field, add <em>repeater<\/em> into the Username field (repeater is the default username, if you have changed this then you will need to add the new username name in instead) and then the password associated with the repeater login into the <em>Password<\/em> field. (Normally allstarlink)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once this is done, do the same on the other blue nodes, namely &#8220;<em>Get Node Uptime<\/em>&#8220;, &#8220;<em>Command =&gt;&gt; RaspberryPi&#8221; <\/em>and &#8220;<em>Tail ConnectLog&#8221;<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The final thing to setup is the dashboard size. Click on the downward pointing <em>triangle<\/em> at the top right of the menu bar (under the <em>burger<\/em> menu) and select <em>dashboard<\/em>. Check that the <em>sizes<\/em> are set the same as in the image below. For some reason, these settings aren&#8217;t always imported (Possible bug?) so, if your dashboard layout isn&#8217;t like shown above it will be because these settings failed to import.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"676\" height=\"1202\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/ASL-Dashboard-Settings.png\" alt=\"ASL Dashboard Settings\" class=\"wp-image-3489\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/ASL-Dashboard-Settings.png 676w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2024\/09\/ASL-Dashboard-Settings-169x300.png 169w\" sizes=\"auto, (max-width: 676px) 100vw, 676px\" \/><figcaption class=\"wp-element-caption\">ASL Dashboard Settings<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You are now ready to deploy your AllStarLink Control Dashboard! <br>Press the red <em>Deploy<\/em> button at the top of the flow editor window.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To access the dashboard from any device, open your favourite web browser and enter the following URL:  <a href=\"http:\/\/nodered-2.dmz.local:1880\/ui\/#!\/0?socketid=AXh7mU7n8p-O1pj8AACU\">http:\/\/IP-Address-of-Node-RED-Computer:1880\/ui<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, if you want to change the nodes that each button connects\/disconnects you will need to edit the <em>set flow var&#8217;s<\/em> function at the top of the main flow. All you will need to do is replace the existing node numbers taking care not to alter the rest of the code in any way otherwise, it could stop the flow from working. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you&#8217;ve edited the node numbers, double click on the associated button node and change its <em>Label<\/em> to show the new node name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once your changes are complete, <em>Deploy<\/em> the flow again and your changes will be live.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is version 1 of the ASL Dashboard, I already have ideas for version 2 that will also have the ability to enter a node number into a field and connect to it without the need to program it into a button.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">More soon &#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever since I built my RaspberryPi\/SHARI AllStarLink node I&#8217;ve had to manage connecting\/disconnecting to\/from other nodes using the Allmon2 or Supermon web admin interfaces. These work fairly well albeit, a bit clunky and buggy. It&#8217;s impossible to use from a mobile device though and so I have to get my Macbook out each time I &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/m0aws.co.uk\/?p=3446\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;AllStarLink Control Dashboard&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[362,332,270,356,36,287,180,334,189,184,4,273,162,161,178,183,171,38,41,40,56,179,186,135,37,134,122,351,346,349,299,302],"tags":[],"class_list":["post-3446","post","type-post","status-publish","format-standard","hentry","category-362","category-allstarlink","category-android","category-asterisk","category-code","category-commandline","category-dashboard","category-dv","category-floweditor","category-flows","category-ham-radio","category-ios","category-ipad","category-iphone","category-javascript","category-json","category-kubuntu","category-linux","category-logging","category-logs","category-macos","category-nodered","category-nodes","category-opensource","category-programming","category-projects","category-raspberrypi","category-raspbian","category-sa818","category-shari","category-sourcecode","category-webbrowser"],"_links":{"self":[{"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/3446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3446"}],"version-history":[{"count":42,"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/3446\/revisions"}],"predecessor-version":[{"id":3557,"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/3446\/revisions\/3557"}],"wp:attachment":[{"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}