Delay node not working - Lost connection to server

A while ago I updated my system and all seems well but I recently discovered the following error:
My delay node isn't functioning anymore. It's getting started but then no respons and I notice the following error: Lost connection to server

Hereby some log info and I noticed some errors and warning:

22 May 10:40:20 - [info]

Welcome to Node-RED

22 May 10:40:20 - [info] Node-RED version: v1.3.4
22 May 10:40:20 - [info] Node.js version: v12.22.1
22 May 10:40:20 - [info] Linux 5.10.17-v7+ arm LE
22 May 10:40:22 - [info] Loading palette nodes
22 May 10:40:33 - [info] Settings file : /home/pi/.node-red/settings.js
22 May 10:40:33 - [info] Context store : 'default' [module=memory]
22 May 10:40:33 - [info] User directory : /home/pi/.node-red
22 May 10:40:33 - [warn] Projects disabled : editorTheme.projects.enabled=false
22 May 10:40:33 - [info] Flows file : /home/pi/.node-red/flows_rpi-3b-plus.json
22 May 10:40:33 - [info] Server now running at
22 May 10:40:33 - [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.

22 May 10:40:33 - [info] Starting flows
22 May 10:40:34 - [info] Started flows
22 May 10:40:34 - [info] [mqtt-broker:Domotics Master] Connected to broker: mqtt://
22 May 10:40:34 - [info] [mqtt-broker:89bfc099.8b73e] Connected to broker: mqtt://
22 May 10:40:35 - [error] [json:e418fc5c.ebf6a] Unexpected token O in JSON at position 0
22 May 10:40:35 - [error] [json:46673cd2.da5ba4] Unexpected token O in JSON at position 0
22 May 10:40:35 - [info] nora: connected, uid: ExGw6LLolKYPJfqw1EYQfIKmKLE2
22 May 10:40:41 - [info] nora: synced 6 device(s), group:

I would investigate those errors first. You should also see those in the debug pane and clicking on the node id there should take you to the node. Then attach a debug node showing what is going into the json node should show you what the problem is. Do that for the two json nodes.

It isn't the Delay node that is not working, it is whatever is feeding the bad data to the json nodes.

Edit, if the messages don't appear in the debug pane then use the Search feature (CTRL+F) to search for the node ids (eg e418fc5c.ebf6a).

This could be a retained mqtt msg that is being sent when NR first connects to the broker. I suspect the mqtt node is trying to convert the msg Towson but it is not in that format.

If you use something like mqtt explores, you could take a look and see if there are any retained messages.

Seems like LWT message with not well formatted payload. Contains string "Online" or "Offline" . Even it is valid JSON string, it is not valid JSON object. So the parsing fails.
Easiest will be to catch that error
And then with split node still get correct payload from the LWT message

If it is not LWT, you still can figure out what it is and do what ever is needed with that kind of messages

@hotNipi : I believe you're right and it's a LWT problem. I'm gonna try to fix it

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.