-
Notifications
You must be signed in to change notification settings - Fork 21
nodejs poolController dashPanel setup and configuration on a Raspberry Pi for the novice
There are several steps in order for the new user to reach the “end-state”, where the node.js-poolController/dashPanel is installed and operational on the Raspberry Pi. The steps are summarized below and explained in further detail within each step below the summarization.
Note: If you have zero experience with a Raspberry Pi, I would highly recommend the Official Raspberry Pi Beginner’s Guide The Official Raspberry Pi Beginner's Guide v2 before you get started. It’s not particularly necessary, but it did really help me to get “off the ground” initially and I continue to use it as a reference guide, as I continue to explore and experiment with different Raspberry Pi’s and their configurations.
- Format the microSD Card and Download/Install Raspberry Pi Operating System (OS).
Note: This step is NOT necessary if you purchased a microSD card with NOOBS pre-installed.
-
Raspberry Pi Initial Setup and Start-up.
-
Update the RPi operating system (OS) / Upgrade the RPi Firmware / Install Essential Packages.
-
Perform two (2) “git clone” command procedures within the home/directory for the nodejs-poolController and the nodejs-poolController-dashPanel packages.
-
Perform Package Installation and Start commands. First in the (nodejs-poolController) sub-directory and then in the (nodejs-poolController-dashPanel) sub-directory.
-
Test the nodejs-poolController-dashPanel Client (Pool Control Dashboard).
-
Configure poolController Settings > Connections
-
Create and Save the Start-up Script.
1. Format the microSD Card and Download/Install Raspberry Pi Operating System (OS)
Note: This step is NOT necessary if you purchased a microSD card with NOOBS pre-installed. If so, then skip to step 7. B. below.
(a) Insert your microSD card in a microSD card slot reader on your computer (desktop/laptop) or in a USB microSD card adapter and insert that adapter into a USB port on your computer (desktop/laptop).
(b) Click on the following link to utilize the Raspberry Pi Imager, in order to format/image the blank microSD Card for use with the RPi. (www.raspberrypi.org)
(c) On the downloads page, click on the applicable link depending if you are using a Windows computer or a Mac to perform this task.
- If using a Windows computer, click on the: Raspberry Pi Imager for Windows link.
(1) Save imager.exe file.
(2) Navigate to your downloads folder and double click on the imager.exe file to open. Click the “INSTALL” button.
(3) It will install the file. When complete, Click “Finish” button.
(4) The app will open. Click on the “CHOOSE OS” button and select the Raspberry Pi OS (32-bit) option in the pull-down menu.
(5) Click on the “CHOOSE SD CARD” and find the applicable Card Reader Media (the microSD Card) and click on it.
(6) Click on the “WRITE” button and confirm you want to continue.
(7) Your microSD Card will then be formatted/imaged with the Raspberry Pi OS (32-BIT).
Note: This process can take anywhere between 5 to 15 minutes depending on the speed and power of your computer and your internet speed.
- Upon successful completion of this process, you should then receive a “Write Successful” pop-up window. Click the CONTINUE button and remove the microSD Card from your microSD Card reader and keep handy, as you will require it in step 7. B. below.
(8) Close the Raspberry Pi window.
- If using a Mac, click on the: Raspberry Pi Imager for macOS link.
(1) Save the imager.dmg file in the downloads folder.
(2) Open the downloads folder and double-click the imager.dmg file.
(3) Drag and drop the Raspberry Pi Imager.app to your applications folder.
(4) Open launchpad and locate and open the Raspberry Pi Imager app.
(5) Click on the “CHOOSE OS” button and select the Raspberry Pi OS (32-bit) option in the pull-down menu.
(6) Click on the “CHOOSE SD CARD” and find the applicable Card Reader Media (the microSD Card).
(7) Click on the “WRITE” button and confirm you want to continue.
Note: Your Mac may ask you to enter your password to confirm that the Raspberry Pi Imager can make changes.
(8) Your microSD Card will then be formatted/imaged with the Raspberry Pi OS (32-BIT).
Note: This process can take anywhere between 2 to 5 minutes depending on the speed and power of your Mac and your internet speed.
(9) Upon successful completion of this process, you should then receive a “Write Successful” pop-up window. Click the CONTINUE button and remove the microSD Card from your microSD Card reader and keep handy, as you will require it in step 7. B. below.
(10) Close the Raspberry Pi imager window or quit the Raspberry Pi Imager app.
2. Raspberry Pi Initial Setup and Start-up
![](https://user-images.githubusercontent.com/52094163/93140714-c5f6c580-f697-11ea-9638-9745ebd50a46.jpg)
(a) Install the microSD card in the Raspberry Pi computer - Turn the RPi over face down and carefully slide the card into the microSD slot with the label facing you and the card contacts facing down as shown in the illustration.
![](https://user-images.githubusercontent.com/52094163/93140070-add27680-f696-11ea-85e0-a535f3ac2ad2.jpg)
(b) Connect a wired or wireless (USB) keyboard and mouse in any of the USB ports.
(c) Connect a monitor to one of the micro HDMI ports.
(d) Connect a network cable into the RPi ethernet port. This cable should be connected to your local area network (LAN) via a network hub, switch or router.
Note: This step will not be necessary if Wi-Fi is your preferred method of connecting your RPi to your LAN.
(e) Connect a suitable power supply (5v, 3A) to the USB Type-C power port. (f) Lastly, plug the power supply into a suitable electrical receptacle and switch on the power supply power button or switch (if applicable).
(g) You will initially see a red power light next to the USB Type-C power port and a green activity light next to the red light. All good signs. The boot up process should take about 30 seconds to a minute. You should then see the Raspbian Desktop/Welcome Screen upon bootup.
-
It is recommended that you click through and complete the wizard in order to realize the options available (some of which are important).
-
If you change the default username / password, don’t forget to note it somewhere as you will need it later.
-
You may skip the wireless network /Wi-Fi Setup screen if you are not using Wi-Fi to connect your RPi to your LAN.
-
Update the software. This will take approximately 1 minute to complete.
-
Once you complete the setup options, you will then receive a “Setup Complete window” and restart query. Click the “Restart” button to save the wizard settings.
-
Once the RPi has restarted, you may want to take some time to explore some of the software and configuration menus in the Raspbian GUI interface for familiarization purposes.
Note: If you plan on using RealVNC to remote desktop to your RPi, this is a good time to navigate to the applications menu > preferences > Raspberry Pi Configuration > Interfaces menu and click the VNC “Enable” radio button and click the “OK” button.
3. Update the RPi Operating System (OS) / Upgrade the RPi Firmware / Install Essential Packages
![](https://user-images.githubusercontent.com/52094163/93143079-1112d780-f69c-11ea-8b36-98dfa761a884.jpg)
In the steps found in this section and subsequent steps, you will utilize the command-line interface (CLI) or LXTerminal found on the Application Launch Bar at the top of the Raspbian Desktop.
Note: All of the following Linux commands are case sensitive. Any extra or deleted characters will not work. Also, within the command line-interface or terminal window, the mouse does not always work the same as you might be used to when using GUI interfaces. You may find that using the arrow keys to navigate around the CLI, will work if you need to scroll for some reason.
Note: You can merely copy/paste the necessary commands within the RPi CLI/LXT. You can do this if you are already controlling your RPi via a desktop remote software application or you can open the Chromium browser on the RPi desktop, navigate to this thread on TFP and open a CLI/LXT window there instead. You may find this method more user friendly. When copying, don’t pick up any extra spaces or characters. Just the commands indicated in bolded/Italic font should be copy/pasted within the command-line.
(a) Open a CLI / LXT window.
(b) # At the command prompt, type or copy/paste: sudo apt update #Tap the Enter/Return key. This command will update the RPi operating system (OS).
(c) # At the next command prompt, type or copy/paste: sudo apt upgrade #Tap the Enter/Return key. This command will upgrade the RPi firmware.
(d) # At the next command prompt, type or copy/paste: sudo apt install build-essential #Tap the Enter/Return key. This command will install essential packages.
- Note: When steps (1) through (4) above have been completed, the CLI window should resemble the screen capture below.
(e) # At the next command prompt, type or copy/paste: bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) #Tap the Enter/Return key.
NOTE: Answer yes ( y ) – Enter/Return key), to all of the questions.
- Note: This script will remove versions of Node.js prior to version 7.x, and Node-RED and if necessary replace them with Node.js 12.x LTS (erbium) and the latest Node-RED from Npm. It also moves any Node-RED nodes that are globally installed into your user ~/.node-red/node_modules directory, and adds them to your package.json, so that you can manage them with the palette manager. In addition, it also tries to run 'npm rebuild' to refresh any extra nodes you have installed that may have a native binary component.
**Note: In plain language, this script will essentially remove old versions of Node-Red and Node.js and re-install the correct versions. Node-RED is explained in further detail in section 10. B. below.
Note: When step (5) above is complete, the CLI window should resemble the screen capture below.
4. Perform two (2) “git clone” command procedures from within the home directory for the nodejs-poolController and the nodejs-poolController-dashPanel packages
Note: “git clone” is a git command which creates a clone/copy of an existing repository into a new directory. It is also used to create remote-tracking branches for each branch in the cloned repository. It is the most common command which allows users to obtain a development copy of an existing central repository.
(a) #At the next command prompt, type or copy/paste: https://github.com/tagyoureit/nodejs-poolController #Tap the Enter/Return key. This command will create the /home/nodejs-poolController directory and will also download the poolController package within that directory. (b) #At the next command prompt, type or copy/paste: https://github.com/rstrouse/nodejs-poolController-dashPanel #Tap the Enter/Return key. This command will create the /home/nodejs-poolController-dashPanel directory and will also download the dashPanel package within that directory.
(c) #At the next command prompt, Type: dir #Tap the Enter/Return key. This command will list all directories within the home directory so that you can confirm the above two directory creations.
Note: When steps (1) through (3) above have been completed, the CLI window should resemble the screen capture below.
5. Perform Package Installation and Start Commands - First in the (nodejs-poolController) sub-directory and then in the (nodejs-poolController-dashPanel) sub-directory, according to the steps listed below.
(a) # At the command prompt, type or copy/paste: cd nodejs-poolController # Tap the Enter/Return key. This is a “change directory” command and you will now be in the nodejs-poolController sub-directory.
(b) # At the next command prompt, type or copy/paste: npm i # Tap the Enter/Return key. This command will install the poolController package.
Note: When steps (a) through (b) above have been completed, the CLI window should resemble the screen capture below.
![](https://user-images.githubusercontent.com/52094163/93144990-2a1d8780-f6a0-11ea-87dd-98fbb3bd9287.jpeg)
NOTE: The USB to RS485 adapter MUST be connected correctly to the IntelliCenter or *Touch RS485 bus (com port) and then installed in one of the RPi USB ports, prior to the execution of the next command if it is not already installed. Otherwise the nodejs-poolController package will continue to error in a loop, as it continues to search for the IntelliCenter or *Touch system.
See Section 6. D.) above, for USB to RS485 adapter connection/pin-out guidance.
(c) # At the next prompt, type or copy/paste: npm start& # Tap the Enter/Return key. This command will start the poolController application. Wait until it states “Configuration Complete” and hit the Enter/Return key. You should be back at the RPi command prompt. This procedure takes approximately two minutes to complete.
Note: When step (3) above is complete, the CLI window should resemble the screen capture below.
![](https://user-images.githubusercontent.com/52094163/93145295-d3647d80-f6a0-11ea-8caf-2f35b4779788.jpg)
Note: Don’t worry about any “failed” type messages that you see. Those are normal. They are merely indicating “collisions” on the RS485 bus. All of the pool equipment connected to the RS485 bus cannot read and write on the bus at the same time. But when it happens, then the equipment needs to resend the command and that collision is shown as an error.
(d) # At the next command prompt, type or copy/paste: cd ../nodejs-poolController-dashPanel Tap the Enter/Return key. This command will change the directory to the nodejs-poolController-dashPanel sub-directory.
(e) # At the next command prompt, type or copy/paste: npm i # Tap the Enter/Return key. This command will install the poolController-dashPanel package. Wait until complete.
(f) # At the next command prompt, type or copy/paste: npm start& # Tap the Enter/Return key. This command will start the poolController-dashPanel application. Tap the Enter/Return key. You should be back at the command prompt.
Note: The user will not be required to perform the start& procedures noted in step E. (2) and step E. (5) above, each time the Raspberry Pi is re-started or re-booted, once the “start script is created and saved. The steps to create and save the start-up script are outlined in step G. below.
Note: When steps (d) through (f) above have been completed, the CLI window should resemble the screen capture below.
![](https://user-images.githubusercontent.com/52094163/93685657-bf849700-fa65-11ea-99e8-ce471886fdc2.jpg)
6. Test the nodejs-poolController-dashPanel Client (Pool Control Dashboard) Open a “Chromium” browser window (the chromium browser icon is located on the Raspian Applications Launch Bar). Enter" '''http://:5150''' in the address/URL window of the browser.
Note: The IP address needed here is the ip address for your Raspberry pi. If you’re not sure what the IP address of your RPi is, then open a command-line editor window and type: ifconfig #You should find it shown to the right of “inet” on the 2nd line after the command prompt.
CONGRATULATIONS!!… Assuming all of the instructions in the section above were followed correctly and there are no issues with the physical RS485 connection between the RPi and the IntelliCenter or *Touch RS485 (Serial COM Port), then you should see something that appears similar to the screen capture below, in the Chromium browser on your RPi.
![](https://user-images.githubusercontent.com/52094163/93685705-1db17a00-fa66-11ea-80c0-7e49d3c436fc.jpg)
Note: However, if you see the Pool Control Dashboard but it says "UNKNOWN MODEL” where it should say IntelliCenter i****, then one of the two steps outlined in 7. G below, should be performed.
7. Configure poolController Settings > Connections
There are two methods to configure the dashPanel so that it finds the server address of the nodejs-poolController. The first method which configures and utilizes "SSDP" (step 7. G. (1) ), is preferable but requires a bit more work. In addition, the "SSDP" method must be used if the "apply" button is greyed out.
Note: SSDP is a network protocol that allows for dashPanel discovery of the nodejs-poolController from any device within your network (LAN).
The second method (step 7. G. (2) ) is a bit simpler but will NOT provide overall flexibility for the dashPanel to find the poolController server address in the long run from various devices within your network.
nbsp; (a) Configure for SSDP in the config.json file
(1) On your RPi or from your remote desktop app and click on the "File Manager" icon located on the Raspian Applications Launch Bar.
(2) Double click on the "nodejs-poolController-next" folder.
(3) Double click on the "config.json" file.
(4) In the file manager menu bar, click "Search > find" and enter "ssdp" in the pop-up text box.
(5) Replace the word "false" with the word "true". DO NOT PRESS ENTER AND DO NOT ADD ANY EXTRA CHARACTERS HERE.
(6) In the file manager menu bar, click file > save.
(7) Click the "raspberry" icon (applications menu) in the Raspian Applications Launch Bar and navigate to Shutdown > Reboot.
(8) Once the RPi reboots, open a “Chromium” browser window on the RPi. Enter" ''http://:5150'' in the address/URL window of the browser.
(9) Click on the 3-bar menu icon in the upper RH corner. Click on the "Connections" tab.
(10) Click on the Server pull-down arrow and click the applicable protocol. Most will use the "http" protocol here. However, if you don't want someone on your network to "sniff" the fact that you are activating the "Spa Circuit Group", at 1:30 in the morning, then feel free to use the "https:" protocol instead.
(11) Click on the "Find Server" button. The "Find Pool Controller" pop-up window should appear indicating that the nodejs-poolController server(s) found.
(12) "X" out of that window. Click somewhere on the Pool Control Dashboard which will cause the Settings box to disappear.
You can now use the nodejs-poolController-dashPanel on any device on your network and not have to worry about re-entering your RPi address in the IP window of the Pool Controller Dashboard in the future.
Note: I believe that there is a method to utilize the CLI and Linux commands to configure SSDP as well. Currently, I do not know the commands. However, I will attempt to obtain them and then I will post them here alongside the "GUI" method outlined above.
(b) Change the IP address within the Pool Control Dashboard. The following steps can be used to configure the IP address within the Pool Control Dashboard. I have experienced long term connectivity issues using this method.
In the browser/dashPanel on the RPi, navigate to the Settings > Connections window and change the IP address in the window and click apply. DO NOT change the port setting of (4200) however.
8. Create and Save the Start-up Script
The nodejs-PoolController-dashPanel wouldn’t be as much fun, if every time that you Logout > Shutdown or Reboot, you had to navigate back to those two sub-directories that you created and individually perform a npm start& command in the command-line editor.
Although, once everything is configured correctly, you really shouldn’t need to power down your RPi very often at all. But still, it sure would be handy if both components of the Pool Control Dashboard, just started up automatically upon RPi power-up.
There are a couple of methods to perform this task but the following certainly seems to be the most user-friendly. Credit: cmc0619
(a) Open a command-line interface (CLI) window.
(b) # Type or copy/paste: sudo nano /etc/rc.local #Tap the Enter/Return key. This command will open a GNU text editor on the RPi desktop.
(c) # Arrow down to between the “exit 0” and the “fi”, Type or copy/paste the following script within the GNU text editing field, between the “exit 0” and the “fi”:
cd ~pi/nodejs-poolController
npm start&
cd ~pi/nodejs-poolController-dashPanel
npm start&
Note: When steps (1) through (3) above have been completed, the CLI window should resemble the screen capture below.
(d) Then tap CNTL X to exit.
(e) Answer Yes by tapping the Y key.
(f) At the “File Name to Write: /etc/rc.local” prompt, tap the Enter/Return key.
(g) The GNU text editing window will close and you will be returned back to the Linux command prompt.
(h) Lastly, on your Raspian desktop (GUI), navigate to your applications menu (RPi icon, top left corner) > Logout > Reboot.
(i) Once your Raspberry Pi completely reboots, open a browser window anywhere (RPi, Desktop/Laptop, Mobile app) and enter: http://:5150 #Your Pool Control Dashboard should open up.
* It should be noted that the Pool Control Dashboard has been tested for compatibility on the following browsers: Mozilla Firefox, Google Chrome, Apple Safari and Microsoft Edge. The URL of your Pool Control Dashboard can be bookmarked in any of your favorite browsers. Then you can easily open up your Pool Control Dashboard with a simple click.
* In addition and while using Apple Safari, the Pool Control Dashboard has been tested on an Apple iPad and iPhone. The Pool Control Dashboard looks outstanding on an iPad.
* When using the Pool Control Dashboard on an Apple iPhone, the following steps are necessary to optimize the page size window for the Pool Control Dashboard.
* In the address window of Safari, click the Safari options button indicated by the “aA” symbol in the Safari address bar.
* Reduce the font size to 50%.
* Turn the iPhone sideways (landscape) to see the entire Pool Control Dashboard