Total meltdown - All Node-red work lost

I prefer to spend months working out how to use software from YouTube videos and websites like this one - but I am stuck. All deployed on Synology DS213j

  1. Installed node-red, developed 15 flows had a great time!
  2. Installation stopped - so backed up all folders
  3. Re-installed node-red using: sudo npm install -g --unsafe-perm node-red
  4. Restarted - using "./node-red-ip"
  5. Try to connect to Mosquitto MQTT (running on Synology - no problem) - getting "Syntax error:Invalid regular expression:......(lines of numbers etc.....and then "missing broker configuration"
  6. Deleted all the files and reinstalled about 5 times - tried loads of different routes over the last 4 days.
  7. Just cannot find the answer - very frustrated - as I still need to rebuild all my flows and nothing in the house can be controlled - thought about OpenHAB - but can't let go of Node-Red!
  8. removed and reinstalled Mosquitto - just to check there are no settings I have forgotten about!
    Any help greatly received.

J

Show us that exact error you are getting. I presume it is in the node-red log so post that here, right from the start of the log.

Hi,

Sorry for your frustration.

Try starting Node-RED with the '--safe' command line switch to see if that works. Does not automatically run your previous flow so sometimes you can see what is wrong with it.

Cheers,

Paul

Colin,

28/05/2020, 18:12:38node: MQTTmsg : error

"SyntaxError: Invalid regular expression: /(?:^|(?<=\s))(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(?=\s|$)/: Invalid group"

28/05/2020, 18:12:38node: d8094590.6f06d8msg : string[28]

"missing broker configuration"

I think the problem is that I fiddled and fiddled and fiddled to get it installed and working - then I have forgotten a crucial step. I have some notes - but I have done something fundamentally stupid. I thought a clean install - reinstalling Mosquitto and then simply configuring the MQTT service would work. The MQTT is simply 192.168.1.29:1883...I've installed the Tasmota nodes. I thought doing a total reinstall would work!
Thanks for helping

Paul - Thanks for the suggestion. If I have re-installed and cleaned out the prior installation - do the previous flows still exist. I just checked with the bathroom light 10 min timer and that doesn't kick in anymore. I think i lost all my old flows.

Thanks

Why should you have lost them, you said you had them backed up.
You haven't shown us the startup log, that is the most important data you can provide.

Hi,

Multiple things here.

I wanted you to start node-red in 'safe' mode to see if it WOULD start - at all. Separating out 'is it a node-red issue' vs. 'is it an issue with my flow / project'. Did --safe option work? Does node-red start ?

Errors in the console (especially on startup) & debug window are important to figure this out - like 'Colin' says.

'backed up all folders' - there is a specific list of folders you need to backup to ensure a flow / project works - google will give you the list based on which OS you are running. looks like you are on Linux...

I'm pretty sure you have not deleted / reinstalled everything correctly yet.

You can delete it all (last time) and start node-red in it's 'clean' state, then copy your Flow or Project back to correct location then open it in node-red. This will prompt you to install only the required node dependencies. See if your app runs then.

Mostly: don't give up! I've had frustrations but the end result / payback is worth it.

Cheers,

Paul

Paul/Colin

This is me going into PuTTy - login into synology and starting node-red ....this is the method I took from "Maru"...from a blog that is several years old.....I opened the copy of the flows file I made before I reinstalled using Virtual Studio Code and it had nothing much in it...maybe when I get this working again I can find the old flows - but it would probably make sense to go round the whole loop from scratch - and write down what i do....I didn't back the flows up when they were in Node-red - by exporting them - because I was only 3mths along the path.

I tried to start Node-red in safe mode. But it gave me a command not know ...I used "./node-red-pi --safe" The issue is I am slightly beyond my capabilities...I learn each bit of the process - and daisy chain the parts together - repeat and repeat until I succeed - but never learn the basics or how Putty works...it means I have difficulty doing anything I can't copy from the internet.. When i backed up I just copied the node-red and npm folders (presumed that would be good enough)...I'll start again tomorrow - and at least I'll be able to have a few beers in the evening to cheer myself up.

I really really don't want to give up - but I don't want to waste your goodwill. I am a very basic technology person - I can flash tasmota and was rewiring the house, going great guns until this mess caught me out. Have a good evening - thanks

Hi Jonoffun - thanks for sharing the information. One of the most important files LOOKS like it still exists: 'flows_synology.json' This is where node-red thinks your flow is/was. We can see that you were not using the 'Projects' feature which makes this even more likely.

After you get the error message what do you get when you try to go to the node-red GUI?

Usually '127.0.0.1:1880' from a web browser would bring it up... and that is where it looks like things should be - try 'localhost:1880' as well.

A comment about connecting to the node-red instance: you can do it directly from the Synology desktop if there is one (open up the desktop, open a browser, type in 'localhost:1880') OR from a separate machine like a laptop that can connect to the Synology machine. In that case use ''192.168.1.29:1880'.

Make sure you can ping the 192.168.1.29 machine (from your laptop etc.) to verify they can see each other.

Cheers,
Paul

This is because the command node-red-pi is specifically to show the whole startup thing that starts the service, which starts Node-RED. But the --safe argument is meant for the node-red binary itself. Try starting it as node-red --safe instead, and see if that helps.

The regex problem is due to a "too old" version of node.js - I think you need 8.11 or better... 8.17.0 is the latest/last 8.x version.
(Ideally you should move to 10.x or 12.x - but that may cause you other issues... so one step at a time.)

Paul,
managed to port all IoT to openHAB - so I don't have to move to switch the lights on! - Yeah. The node-red runs on Synology - I access it from a PC. Interestingly (this may be part of the problem) - my desktop shortcut fails to connect (goes to https - so I must have sorted that out somehow in the past). If I type 192.168.1.29:1880 - node-red works instantly (http). All my kit sees the synology MQTT (mosquitto-on 1883) and I can control them through Tasmota - and I see them operate through "console". I can connect via browser ie 192.168.1.159 (Tasmota main menu - for Study lights). The error messages occur when I open Node-Red, then drag a Tasmota node, or Mqtt in/out node....try to set up the MQTT broker using 192.168.1.29:1883...deploy and get "syntax error.....invalid group" and "missing broker configuration". I will try the other two suggestions from afelix and dceejay. I think if any of you were in the room - you would spot the error in seconds - I bet I am doing something really basic. Synology is also running openHAB and a webserver - it is old and slow - but still has a gb free!

btw - I backed up the wrong set of files - synology /homes not synology/home - or vice versa almost certain I lost the flows. I can recreate them in a few days - but not if node-red is broken.

Again - thanks for the advice and suggestions.

Worst case happy to do a full delete and re-install - but will need to know the key lines to use in Putty. Maybe as you mentioned I didn't actually fully delete it and the current system is trying to connect to the "GUI" interface - the dashboard that doesn't exist anymore in this instance!

Jon-no-fun !

dceejay,

Thanks I will action this. A quick question - if i want to do a total uninstall and re-install of node-red via Putty - can you let me know what the code is...ie sudo....I know how to uninstall node.js from synology, then download the version you mentioned and re-install manually selecting the downloaded file.

Looking at the folders - should I physically delete ,node-gyp, .node-red, npm, node_modules - from Synology/homes/admin and synology/home ....I didn't realise it was in homes/admin before. Ideally I want to start from ground zero and document each step of the rebuild as if it was 3mths ago.

Thanks for the advice.

J

homes_admin

I can't immediately explain the missing group error, but have you ensured that you are indeed running an MQTT broker on the same Synology device, accessible over port 1883? As for "missing broker configuration", when adding the mqtt in/out nodes, check which broker they're configured too, and most of all make sure that it is configured correctly. Try running an MQTT Client such as MQTT Explorer on your PC and try to access it that way with the same details.

oops - they are different views of the same folders - that's embarrassing

afelix,

I am honestly really an end-user...person. I am constantly trying to learn and evolve beyond my current ability. I only follow what I see on threads. I am pretty sure that Mosquitto is operating properly and the "console" /tasmota is using it. If I switch it off - all the plugs start blinking and the console loses the connection. That's my level - one step forward, test test test, check, test, break, rebuild, retest - then have a beer to celebrate.

J

I've got MQTT.fx v1.7.1 - opened it and it filled up instantly. I bet if we resolve this - it's going to be an "ahh" moment - I get those all the time... can't wind the windows in the car down ...ahhh-need to turn the car on.

Have you updated nodejs to a supported version? All bets are off till you do that.

Colin,
I've been busy. So, 1) uninstalled Node.js_v8 2) installed v12...3) restarted Synology 4) Tried to load node-red, using " sudo npm install -g --unsafe-perm node-red" - got loads of errors and didn't work - it kept reporting "can't go that far back" or similar 4) Tried using sudo apt install build-essential git - but got "apt command not recognised" - so 5) Tried ```
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) - got another error .

putty-fail

..6) uninstalled v12 7) installed node-red using " sudo npm install -g --unsafe-perm node-red" 8) restarted by going to correct folder /volume1/@appstore/Node.js_v8/usr/local/lib/node_modules/node-red/bin 9) restarted using ./node-red-pi 10) got the exact same error on restart. Sadly I do not think Node-Red is for people who can't do the basics. When I get it running it is absolutely amazing and I am gutted that I can't use it. I love the interface, it's pretty simple to create flows, it's fun, the UI seems straight forward, and I can see how I can cascade flows and stick items into multiple flows....but it is not "retail" install. The synology is linux - I read the instructions - and - I fail. I have a rasberry pi on virtualbox that I use for flashing tasmota onto plugs and Blitzwolf smart switches. I keep it saved exactly ready to use for flashing. - I'll create a copy and fire that up - see if that will connect to the MQTT server. It's only a question of time before I stumble across the answer or someone creates a youtube video.

Thanks for helping

J

(disclaimer - I havent read all of this thead)

While there is some truth in that - what you're doing isnt exactly basic.

That script wont work on the stripped down OS of a synology NAS (as you have found out) - pretty sure the NAS OS is NOT debian based.

Have you tried searching for "install apt on synology" or "install nodejs on synology" on your favorite search engine?

Lastly, doesnt synology have a docker like environment? If so, you could try that (sure i've seen seveal synology related posts around - search the forum)

1 Like