# Ipx v3 node red

**URL:** <https://discourse.nodered.org/t/ipx-v3-node-red/9004>\
**Category:** Hardware\
**Created:** [14 March 2019 21:18 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004 "2019-03-14T21:18:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![acd](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@acd](https://discourse.nodered.org/u/acd)\
**Post date:** [14 March 2019 21:18 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/1 "2019-03-14T21:18:35Z")

</div>

hello,

beginner, I trying to read status of relax output from an IPX v3  
Payload command : GetOut1 (for the first relax)  
Message payload :

```auto
* 14/3/2019 22:01:17[node: 3b85a382.bbe724](http://192.168.1.128:1880/#)msg : Object
* object
* _msgid: "85b585e6.1cda68"
* topic: ""
* payload: buffer[11][string](http://192.168.1.128:1880/#)
* GetOut2=1

```

I need to display a color box when GetOut2 = 1

Can you advice me ?  
thanks

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 March 2019 08:23 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/2 "2019-03-15T08:23:01Z")

</div>

I am not entirely sure what that is showing, could you post a screenshot of the debug node output showing that payload please.

---

<div class="post-metadata">

**Author:** ![acd](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@acd](https://discourse.nodered.org/u/acd)\
**Post date:** [16 March 2019 08:40 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/3 "2019-03-16T08:40:21Z")

</div>

![40](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1373c998263dcc6fba98fceb52092bf57eb44f63.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [16 March 2019 09:43 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/4 "2019-03-16T09:43:47Z")

</div>

so the payload is a buffer and you need to change it to a string to be able to use in a `switch` node. One way to do that is to use a function node with something like this:

```auto
// move msg.payload to a variable 'buf'
var buf = msg.payload;
// convert 'buf' to a string
var str = buf.toString();
// move the string back to msg.payload
msg.payload = str;
// return the msg
return msg;

// this is a 'condensed' version
//msg.payload = msg.payload.toString();
//return msg;

```

---

<div class="post-metadata">

**Author:** ![acd](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@acd](https://discourse.nodered.org/u/acd)\
**Post date:** [17 March 2019 15:37 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/5 "2019-03-17T15:37:11Z")

</div>

Hello thanks for your help.  
In my case, str could be GetIn1=0 or GetIn1=1 and I need two different action depending of str

Could you have an exemple ?  
thanks,

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 March 2019 15:40 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/6 "2019-03-17T15:40:41Z")

</div>

If you only care that is is `GetIn1=0` or `GetIn1=1` then use a switch node.

If you need the value then use...

```auto
let v = str.split('=');
let val = v[1];

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [17 March 2019 15:50 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/7 "2019-03-17T15:50:27Z")

</div>

Since it is a string, you can compare for the exact string - I'd use a `switch` node

---

<div class="post-metadata">

**Author:** ![acd](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@acd](https://discourse.nodered.org/u/acd)\
**Post date:** [19 March 2019 20:19 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/8 "2019-03-19T20:19:11Z")

</div>

ok, it works.  
after two days, dpi nodered doesn't start  
19 Mar 21:16:17 - [info] Starting flows  
19 Mar 21:16:17 - [info] Started flows  
19 Mar 21:16:17 - [error] Unable to listen on [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
19 Mar 21:16:17 - [error] Error: port in use

i'm lost

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [19 March 2019 20:45 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/9 "2019-03-19T20:45:01Z")

</div>

Port in use means that something else is using the port 1880. Normally this means Node-RED is already running.

---

<div class="post-metadata">

**Author:** ![acd](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@acd](https://discourse.nodered.org/u/acd)\
**Post date:** [19 March 2019 20:54 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/10 "2019-03-19T20:54:51Z")

</div>

flows are no more available in the web interface

---

<div class="post-metadata">

**Author:** ![acd](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@acd](https://discourse.nodered.org/u/acd)\
**Post date:** [19 March 2019 21:15 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/11 "2019-03-19T21:15:19Z")

</div>

nodered is running again but I have lost my previous flows and dashboard  
Is there a way to retrieve my previous work ?  
thanks,

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 March 2019 21:35 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/12 "2019-03-19T21:35:51Z")

</div>

That probably means you are running flows from a different location, possibly as a different user. What do you see in the terminal if you run

```bash
node-red-stop
node-red-start

```

Copy and paste the result here if possible.

---

<div class="post-metadata">

**Author:** ![acd](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@acd](https://discourse.nodered.org/u/acd)\
**Post date:** [20 March 2019 06:32 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/13 "2019-03-20T06:32:15Z")

</div>

pi@EURON8:~ $ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at [http://192.168.1.128:1880](http://192.168.1.128:1880)  
On Pi Node-RED works better with the Firefox or Chrome browser

Use node-red-stop to stop Node-RED  
Use node-red-start to start Node-RED again  
Use node-red-log to view the recent log output  
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot  
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to [http://flows.nodered.org](http://flows.nodered.org)

# Starting as a systemd service. Started Node-RED graphical event wiring tool. 20 Mar 07:29:55 - [info] Welcome to Node-RED

## 20 Mar 07:29:55 - [info] Node-RED version: v0.18.7 20 Mar 07:29:55 - [info] Node.js version: v10.9.0 20 Mar 07:29:55 - [info] Linux 4.14.52-v7+ arm LE 20 Mar 07:29:56 - [info] Loading palette nodes 20 Mar 07:29:58 - [info] Dashboard version 2.14.0 started at /ui 20 Mar 07:29:59 - [info] Settings file : /home/pi/.node-red/settings.js 20 Mar 07:29:59 - [info] HTTP Static : /home/pi/Pictures 20 Mar 07:29:59 - [info] User directory : /home/pi/.node-red 20 Mar 07:29:59 - [warn] Projects disabled : editorTheme.projects.enabled=false 20 Mar 07:29:59 - [info] Flows file : /home/pi/.node-red/flows\_EURON8.json 20 Mar 07:29:59 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/) 20 Mar 07:29:59 - [warn]

## Your flow credentials file is encrypted using a system-generated key. If the system-generated key is lost for any reason, your credentials file will not be recoverable, you will have to delete it and re-enter your credentials. You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change.

## 20 Mar 07:29:59 - [info] Starting flows 20 Mar 07:29:59 - [info] Started flows

no more flows

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [20 March 2019 07:20 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/14 "2019-03-20T07:20:17Z")

</div>

You are using an old version of Node-RED so after you have fixed your issue it would be worth while updating.

In a terminal cd into /home/pi/.node-red/

list the files that begging with flows using

ls -lart flows\*

what files are listed?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 March 2019 08:06 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/15 "2019-03-20T08:06:14Z")

</div>

Have you recently changed the host name of the pi to EURON8? If so then @ukmoose's suggestion will show the old flow.

---

<div class="post-metadata">

**Author:** ![acd](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@acd](https://discourse.nodered.org/u/acd)\
**Post date:** [20 March 2019 19:21 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/17 "2019-03-20T19:21:11Z")

</div>

**pi@EURON8** : **~/.node-red $** ls -lart flows\*

-rw-r--r-- 1 pi pi 136 sep 9 2018 flows\_PLATE\_cred.json

-rw-r--r-- 1 pi pi 6707 sep 9 2018 flows\_PLATE.json

-rw-r--r-- 1 pi pi 44 mar 19 20:07 flows\_EURON8\_cred.json

-rw-r--r-- 1 pi pi 2 mar 20 18:46 flows\_EURON8.json

**pi@EURON8** : **~/.node-red $**

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [20 March 2019 19:41 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/18 "2019-03-20T19:41:34Z")

</div>

so you have another flow file flows\_PLATE.json  
the documentation explains how to specify which flows file you start Node-RED with

---

<div class="post-metadata">

**Author:** ![acd](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@acd](https://discourse.nodered.org/u/acd)\
**Post date:** [20 March 2019 19:50 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/19 "2019-03-20T19:50:54Z")

</div>

strange because I didm't change the host name of the pi

---

<div class="post-metadata">

**Author:** ![acd](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@acd](https://discourse.nodered.org/u/acd)\
**Post date:** [20 March 2019 20:14 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/20 "2019-03-20T20:14:06Z")

</div>

is the settings.js file used to specify the flow when we start Node-Red ?

---

<div class="post-metadata">

**Author:** ![acd](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@acd](https://discourse.nodered.org/u/acd)\
**Post date:** [20 March 2019 20:31 UTC](https://discourse.nodered.org/t/ipx-v3-node-red/9004/21 "2019-03-20T20:31:16Z")

</div>

I retrieved old flows (september) but not the flows confiture recently.  
I think I will reinstalled the pi  
Thanks for your help
