Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:sw:03-3rd-party:nodered:installation-neuron [2019/02/05 14:27]
jan_kozak [Node-RED on UniPi Neuron]
en:sw:03-3rd-party:nodered:installation-neuron [2021/08/06 07:18] (current)
avsetula
Line 1: Line 1:
-====== Node-RED ​on UniPi Neuron ====== +====== Node-RED ​for Unipi Neuron ====== 
-This step-by-step ​guide will lead you through the complete ​process of installing ​the Node-RED into your UniPi Neuron ​programmable logic controller. +<WRAP group 100%> 
-===== OS installation =====  +<WRAP half column 81%> 
-=== Preparations === +This manual will guide you through the entire ​process of installing Node-RED into your Neuron ​unitBefore ​the installation ​please make sure your unit was delivered undamaged ​and without any visible ​defects
-UniPi Neuron controllers are based on the Raspberry Pi computer using a microSD card as its memory storage. Any software installations thus require a microSD card; in the case of Neuron PLCs, you can purchase the card as a part of the controller’s package. Alternatively,​ the card can be purchased separately or you can use any microSD card you already own. The size of the complete Node-RED + OS package is around** 2.5 GB**. 4GB microSD cards can be used, but it is strongly recommended to use** 8GB** or **16GB** cards with the class of at least Class 10.  +
- +
-The second required component is the **UniPian OS image.** The image is accessible on [[files:​software:​os-images:​00-start|this link]] where you can find the latest release of the image (1.9 at the time of publication of this guide). The image is downloaded as a RAR archive  +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_113.png?​300|}} +
- +
-We also recommend formatting the SD card first by using the [[https://​kb.unipi.technology/​files:​software:​tools:​00-start#​sd_card_formatter|SD Card Formatter]] +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_109.png?​300|}} +
- +
-=== Installing on Windows === +
-Download a program for burning the image onto the SD card. The easiest method is to use the [[https://​sourceforge.net/​projects/​win32diskimager/​|Win32DiskImager]]/​ application. After its download and install, launch it as Administrator.  +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_114.png?​300|}} +
- +
-Launch the app’s installer and follow its instructions. With the installation ​completed, insert the SD card into your computer ​and start the Disk Imager. ​  +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_115.png?​400|}} +
- +
-In the program, select the UniPian file – in the example below, the image is placed on the C:/ drive. In the Device drop-down menu, choose the drive with the microSD (I:/ in the example below) and click on Write for confirmation. ​  +
- +
-<WRAP center round important 60%> +
-WARNING: Make sure you selected the correct drive in the Device menu! A mistake could result in overwriting your computer’s hard drive! +
-</​WRAP> ​  +
- +
-The writing process will create two partitions on the SD card. The only one will be visible ​– the second, hidden partition has the ext4 Linux file format +
- +
-=== Installing on Linux === +
-If you are a Linux user, the installation process uses the "dd“ utility for low-level file copying. It is also possible to use various extensions such as the Image Writer in Ubuntu, but only „dd“ guarantees a 100% functionality. The installation itself is then performed by following these steps +
- +
-  * Extract the UniPian Neuron archive using unzip command ''​unzip UniPian-Neuron-2019-01-07-v1.9.zip''​  +
-  * Run ''​df -h''​ command to return all available partitions. If the SD card is inserted, it will appear either as a ''/​dev/​mmcblk0p1''​ or ''/​dev/​sdd1''​. A specific example can look like this ''/​dev/​mmcblk0p1 7,3G 4,0K 7,3G 1% /​media/​user/​SDcard''​. The last part („p1“ or „1“) represents the directory number. When writing the command it is necessary to describe the whole path to the SD card, not only the directory. The dd command parameter must contain ''​dev/​mmcblk0''​ or''​ /​dev/​sdd''​.  +
- +
-<WRAP center round info 60%> +
-The writing process will create several partitions on the SD card, as the Raspberry Pi has several directories+
 </​WRAP>​ </​WRAP>​
- +<WRAP half column 15%> 
-  * Once you determine the path to the SD card, remove it from the PCif the card contains several directories,​ it is necessary to disconnect them individually through the mount command. The command line must contain the whole identification of the directory, eg. ''​__/​dev/​mmcblk1"0p__''​ or ''/​dev/​sdd1''​. +;;# 
- +<​html><​span class="dev-tag dev-neuron">​Neuron</span><​/html> 
-Now onto the ''​dd''​ command itself. The command has three parameters +;;#
-  * an input file (input file if=) – here, insert the downloaded image: ''​if=UniPian-Neuron-2019-01-07v1.9.omg''​  +
-  * an output file (''​output file of=''​);​ insert the SD card: ''​of=/​dev/​mmcblk0.''​ Bear in mind it is again necessary to state the SD card itself, not only a directory such as //sdds1//, //sddp1// or //​mmcblk0p1//​.  +
-  * A block size (''​block size bs''​). This parameter determines the size of blocks used for writing onto the SD card. The default size is 4 MB – in case of issues, it is also possible to use 1MB size. The resulting command to write data looks like the following:  +
-''​sudo dd bs=4M if=UniPian-Neuron-2019-01-07-v1.9.img of=/dev/mmcblk0'' ​ +
- +
-The "​dd"​ program does not indicate its operation, nor displays any information. Writing onto the SD card may take up to 5 minutesthat said, simply wait until some result will display.  +
- +
-Upon completing the operation, the SD card should display two partitions – you can check using the ''​df -h''​ command. If the process fails for any reason, it might be useful to follow the SD card preparation manual accessible on this [[https://​elinux.org/​RPi_Easy_SD_Card_Setup|this link]].  +
-  +
-=== Editing the SD card directory === +
-If the image was burned successfully,​ the card will load as a boot when inserted to the PC.  +
-Before inserting the card into the controller, it is necessary to create ssh file. The easiest method is to create a .txt file named **ssh.txt** +
- +
-=== Inserting the card === +
-Upon burning the image and adding the ssh file, the card is ready to be inserted into the controller.  +
- +
-<WRAP center round important 60%> +
-Insert the card ONLY with the controller’s power unplugged!+
 </​WRAP>​ </​WRAP>​
-  
-===== Detecting the UniPi Neuron IP address ===== 
-Now, it is necessary to detect the controller’s IP address. You can find it by multiple methods 
- 
-  * Probably the easiest and fastest way is to use a smartphone with the Fing app installed (it is possible to use other similar applications). The app is available on Google Play for Android phones or App Store for iOS  
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_116.png?​400|}} 
-  * using Windows IP address lookup tools or any other IP address lookup tool 
- 
-=== Communication through the SSH using PuTTY === 
- 
-Once the controller’s IP address is found, you can communicate with it through an SSH connection. For this purpose the PuTTY program is needed – while other SSH programs can be used, PuTTY is the most suitable for Windows). The program can be downloaded here.  
- 
-After the download, install the application following the installer instructions. With the program installed, click on the putty.exe file to launch it (the default path is //​C:​\Program Files\PuTTY//​.) When launched, the following window is displayed. Enter the controller’s IP address to the Host Name tab, then click on Open. 
- 
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_118.png?​400|}} 
- 
-A PuTTY Security Alert window will appear. Select „Yes“ option and continue. ​ 
- 
-After clicking Yes, an SSH terminal command prompt will open.  
- 
-<WRAP center round info 60%> 
-The login has a set timeout, after which the login will not be possible! If the time runs out, restart PuTTY and repeat the login. ​ 
 </​WRAP>​ </​WRAP>​
    
-Enter the following login +{{page>​en:sw:03-3rd-party:nodered:​preparation-of-sd-card-hidden}}
-  * Login** pi**  +
-  * Password**raspberry**  ​+
  
-The password text is written as invisible – if the cursor is not moving during the password insertion, it is not an error!  +{{page>en:hw:neuron-flash-hidden}}
-Upon successful login, this screen will appear: +
- +
-With the SSH running, the controller is ready for the upload of remaining parts of the Node-RED setup. +
- +
-{{:en:sw:03-3rd-party:​nodered:​screenshot_119.png?​600|}}  +
- +
-===== Installing EVOK ===== +
-The EVOK install is described in detail on [[https://​github.com/​UniPiTechnology/​evok|this link]]. The link contains a brief description of EVOK and the install guide.  +
- +
-For the purpose of this guide, only several commands will be needed to be entered into the SSH terminal. Bear in mind that it is recommended to paste commands by lines. It is also possible to run several blocks at once, but we strongly recommend to perform the procedure one step at a time. If the UniPian image was used, the EVOK is already contained within it and it is not needed to install it again. It is, however, necessary to check if the latest version is used. All you need to do is to use following commands:  +
- +
-''​sudo su''​+
    
-''​apt-get install evok''​  +{{page>en:files:software:​tools:​advanced-ip-scan-hidden}}
- +
-''​apt-get update''​  +
- +
-''​reboot''​  +
- +
-<WRAP center round info 60%> +
-The Raspbian image can be also used instead of UniPian. This option, however, requires the EVOK to be installed according to the installation manual on GitHub) +
-</​WRAP>​ +
- +
-If everything was done correctly, you can now open a web browser and enter the IP address of your controller. The EVOK user interface will open. +
- +
-{{:en:sw:03-3rd-party:​nodered:​screenshot_120.png?​400|}}+
    
-===== Installation of Node-RED ===== +{{page>​pre-installed-sw-hidden}}
-Now, it is time to install the Node-RED itself. To use Node-RED, the latest EVOK release is required (2.0.7g or higher).  +
-The installation is again performer through the SSH terminal. Enter the first command:+
  
-''​sudo apt-get install build-essential''​ +{{page>​connection-to-plc-hidden}}
-  +
-The installation should run without any further input. Upon its completion, enter the following command: ​+
  
-''​bash <(curl -sL https://​raw.githubusercontent.com/​node-red/​raspbian-deb-package/​master/​resources/​update-nodejs-and-nodered)''​  +{{page>​securing-nodered-hidden}}
- +
-To finish the install, three questions will appear. +
- +
-  - Are you really sure you want to install as root? [y/N]? +
-  - Are you really sure you want to do this? [y/N]? +
-  - Would you like to install the Pi-specific nodes? [y/N]? +
-   +
-Answer them in the following order – Y, Y, N (check the following screenshot for reference)  +
- +
-{{:en:sw:03-3rd-party:nodered:​screenshot_121.png?​600|}} +
-  +
-All steps must be marked with the green tick in order to complete the install. When all steps are marked as completed, the Node-RED is successfully installed.  +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_122.png?​600|}} +
- +
-By default, the ''​node-red''​ command must be used each time to run Node-RED. In order to make things easier, enter one additional command to the SSH terminal: ''​sudo systemctl enable nodered.service''​ +
-  +
-This command will set Node-RED to launch on device startup.  +
- +
-You can now enter the Node-RED user interface. All you need to do is to open a web browser, enter the controller’s IP address and place a: 1880 suffix.  +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_123.png?​400|}} +
- +
-The following user interface will load  +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_124.png?​400|}} +
- +
-===== Preparing the Node-RED ===== +
-With the Node-RED functional, you will need to install nodes required for communication with the controller (nodes are displayed in the left tab). First, click on //Menu// on the right upper corner of your screen  +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_125.png?​400|}} +
- +
-The following menu will appear  +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_126.png?​400|}} +
-  +
-Click on //Manage Palette//. A following list of nodes will appear. Click on //​Install//​.  +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_127.png?​500|}} +
-  +
-You can now install new nodes into Node-RED. You will specifically require two packages. The first one is **@unipitechnology/​node-red-contrib-unipi-evok**. Enter// unipi// search word to find the package. Then click //​Install//​ +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_128.png?​500|}} +
- +
-Two new nodes appeared in the list of available nodes:  +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_129.png?​300|}} +
- +
-Now, install the node-red-dashboard by following the exact same instructions.  +
- +
-===== Node-RED demonstration and its import ===== +
- +
-To understand the connection between UniPi and Node-RED, a demonstration was created. Its import is very easy – click on Menu, hover the cursor over Import and click on Clipboard. +
- +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_130.png?​400|}} +
-  +
-Now just copy and paste the content of the **{{ :​en:​sw:​03-3rd-party:​nodered:​json.txt |demo_flow_1.0.json}}** file added to this manual and click on Import. ​  +
-With the import finished, open the user interface webpage by entering the IP address and adding /ui. as a suffix +
-   +
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_131.png?​400|}}+
  
-When loaded, the page should look like the following screenshot: ​+{{page>​axon-neuron-flow-hidden}}
  
-{{:​en:​sw:​03-3rd-party:​nodered:​screenshot_132.png?​400|}}