Jump to content
Electronics-Lab.com Community

Recommended Posts

Posted

With the rapid development of Internet of Things (IoT) technology, efficient and stable development platforms have become key to driving project success. iMX6UL series processors, with high performance, low power consumption, and compact size, have become the ideal choice for many IoT applications. Combined with the Linux 4.1.15 operating system, we provide developers with a complete technical solution designed to help you easily install and use Node-RED on the iMX6UL series, thereby accelerating the development of IoT projects.

Node-RED is a flow-based flashing tool that offers a browser-based flow editor. Users can create automation tasks and applications by dragging and dropping nodes and connecting them. It features a rich library of nodes, supports various protocol conversions, and allows users to create custom nodes to extend functionality. It is particularly suitable for building and deploying IoT applications, enabling easy integration of various hardware devices and sensors.

Installation Steps:

1. Install Node.js

Node.js is the foundational environment for running Node-RED. Here are the detailed installation steps:

1.1 Download the source code:

Download link: https://registry.npmmirror.com/binary.html?path=node/v11.1.0/

Version:node-v11.1.0-linux-armv7l.tar.gz

1.2 Copy the file:

Copy the downloaded source package to the iMX6UL development board and extract it:

$ cp /run/media/sda1/node-v11.1.0-linux-armv7l.tar.gz ./
$ tar -xvf node-v11.1.0-linux-armv7l.tar.gz
$ mv node-v11.1.0-linux-armv7l nodejs

1.3 Create symbolic links:

To facilitate global access, create symbolic links for Node.js and npm:

$ ln -s /home/root/nodejs/bin/node /usr/bin/
$ ln -s /home/root/nodejs/bin/npm /usr/bin/

1.4 Check the version:

Verify if Node.js and npm are installed successfully:

node -v
npm -v

If the version numbers are printed, the environment setup is correct.

f_65e09712bce37227b623431d47b94d12&t=png

Otherwise, please set the executable permissions and check again.

chmod 777 nodejs/bin/*

chmod 777 nodejs/bin/*

2. Install Node-RED

2.1 Install Node-RED:

Ensure the development board can access the internet normally, then enter the following command to install Node-RED:

npm install -g --unsafe-perm node-red

If you encounter the following error:

f_2a485c661f0b8103d589d6d82e1a03cf&t=png

please execute:

npm config set strict-ssl false

Then try the installation again.

npm install -g --unsafe-perm node-red

If it gets stuck at this point:

f_9560dfaad96436cbea32cd16d7c0f9b0&t=png

please execute:

npm install -g node-gyp

Then try the installation again.

npm install -g --unsafe-perm node-red

2.2 Install pm2:

pm2 is a powerful process management tool for Node.js applications, which can help you better manage the Node-RED service. The installation command is as follows:

npm install -g pm2

2.3 Set a symbolic link:

For ease of use, you can create a symbolic link for pm2 (path subject to actual conditions).

ln -s /home/root/nodejs/bin/pm2 /usr/bin

2.4 Manage and start Node-RED:

Use pm2 to start the Node-RED service and set it to start automatically on boot:

pm2 start /home/root/nodejs/bin/node-red -- -v
pm2 save
pm2 startup

Use Node-RED

After installation, you can access the Node-RED user interface via a browser at http://:1880. Node-RED provides a rich library of nodes, supporting functions such as data acquisition, device control, event handling, etc. By dragging and connecting nodes, you can easily build complex IoT application flows.

Notes:

  • This technical solution is primarily applicable to the Forlinx MCU FETMX6ULL and FETMX6UL platforms with the Linux 4.1.15 operating system. For other platforms, please refer to the corresponding documentation for modification;
  • If you encounter any issues during installation, please check network connectivity, file permissions, and other settings;
  • Node-RED's node library is continuously updated, so it is recommended to regularly visit the official website for the latest nodes and examples.

Conclusion

With this technical solution, developers can easily install and use Node-RED on the iMX6UL series processors, thus accelerating the development of IoT projects. The high performance and low power consumption of the iMX6UL series, combined with the stability of the Linux 4.1.15 operating system and the ease of use of Node-RED, provide powerful technical support for IoT applications. We look forward to exploring the limitless possibilities of IoT with developers!


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...