Set up Node-RED Nodes
First, install Remote-RED in Node-RED. Use “Manage Palette” within the Node-RED Editor and install the package
The access node allows you to access a website locally or remotely from the app. Usually this is your dashboard or a page of the UI Builder.
Create a node of type “remote access” for each page you want to access. Besides the name, this node contains only one config node. The configuration is outsourced to the config node, as these settings are also used for other functions like push notifications.
For each Access Node you create a corresponding Config Node. In this Config Node you define with which host, port and URL the connection will be established. The default values shows the dashboard as an example. It is also possible to configure other pages from the local network, as long as the Node-RED server can access them.
- Name: With this title the page will be displayed later in the app.
- Serving Host: The local IP of the host whose website is to be shared. “localhost” uses the Node-RED server on which the Access Node is running.
- Protocol: The protocol used by the web server. For Node-RED this is normally http, but can be changed to https via the settings.js.
- Serving Port: The port that will be forwarded. For Node-RED this is usually 1880, for other websites usually 80.
- Base URL: The initial page to be called.
You can only edit the “Server location” once. Here you can specify in which corner of the world the server is located, which will be used for routing your website. For a fast connection choose the location that is closest to you.
Once you have defined these settings and installed the iOS or Android app, you can connect to an app by clicking the “Connect Remote-RED App” button. More about this in the connect app section.
With this node you can send a push notification to the devices connected to the selected config node. Select a config node that you already use in an access node. You can use the same config node in several notification nodes.
Configure the title and the text of the notification. The default values assume that the payload of the incoming notification contains the strings “title” and “body”. You can also enter fixed texts or use flow or global variables.
Whenever a message arrives at the notification node, a notification is sent to your devices.
With this node you can send a question through a push notification to the devices connected to the selected config node. Select a config node that you already use in an access node. You can use the same config node in several question nodes.
It is important that the confg node points to your local Node-RED computer and that an access node is active with it. The base URL is irrelevant.
Configure the title and the text of the notification. The default values assume that the payload of the incoming message contains the strings “title” and “body”. You can also enter fixed texts or use flow or global variables.
You can specify up to three answers. The text of the answers can be entered directly as an string or taken from the incoming message. If the text is empty, the answer is not displayed. You can use the value to specify what the node outputs in msg.payload when you select this answer.
Whenever a message arrives at the question node, a notification is sent to your devices.
Install and connect app
You can install the apps from the Apple AppStore or the Google PlayStore. The app will ask you for the permission to send you push notifications after the first start. Allow this if you want to use the notification function.
Within the app, the term Node-RED instances are used. An instance is the connection to a config node of Node-RED. Within the app you can add multiple instances, i.e. local pages.
As long as the app is not connected to at least one config node, you can’t do much with it.
When you connect an app it transfers certificates to access to your local site. The configuration is transferred as well. For subsequent changes to these fields, the instance in the app must be deleted and reconnected.
Open in Node-RED the config node you want to connect. Press the button “Connect Remote-RED App”. The config node now connects to one of the Remote-RED servers and shortly after that it displays a QR Code.
Within the app use the function “Connect Node-RED Instance” and scan the QR Code. The app should now be connected. To connect other apps (e.g. on another mobile phone), press the button again and generate another QR Code.
It is very important that you leave the config node with “Add” or “Update” and then save the changes with “Deploy”.
Network Error inside Node-RED
The computer on which the Remote-RED Access-Node is installed within Node-RED needs internet access of course. If you get a ‘Network Error’ when connecting an app, your Node-RED machine most likely can’t reach my servers. If you use a firewall, the following paths must be allowed:
Server location ‘America (USA)’:
- Outgoing port 443 to contact-us.remote-red.com / 220.127.116.11 / 2605:a140:3006:3078::1 for adding new instances
- Outgoing port 443 to api-nodered03.remote-red.com / 18.104.22.168 / 2605:a140:3006:3078::1 for API communication
- Outgoing port range 50000-60000 to proxy-nodered03.remote-red.com / 22.214.171.124 / 2605:a140:3006:3078::1 for the SSH tunnel
Server location ‘Europe (Germany)’:
- Outgoing port 443 to contact-de.remote-red.com / 126.96.36.199 / 2a02:c207:3006:3079::1 for adding new instances
- Outgoing port 443 to api-nodered02.remote-red.com / 188.8.131.52 / 2a02:c207:3006:3079::1 for API communication
- Outgoing port range 50000-60000 to proxy-nodered02.remote-red.com / 184.108.40.206 / 2a02:c207:3006:3079::1 for the SSH tunnel