Anyone having DSM issues with v3.0.0-beta.2?

I am running backups from a DSM node that works perfectly well on v2.2.2 but is not on v3-b2.
It's a customised version of the backup code found in the DSM examples wiki

Using the node.warn messages, I can see that the init code is being called, but when I trigger the node the status icon turns black and nothing happens.

Thanks

{
    "currentState": "ready",
    "states": {
        "ready": {
            "start": "step2",
            "reset": "ready"
        },
        "step2": {
            "tar": "step3",
            "reset": "ready"
        },
        "step3": {
            "output": "ready",
            "reset": "ready"
        }
    },
    "methods": {
        "init": [
            "node.warn('init');",
            "sm.udir = RED.settings.userDir + '/';",
            "sm.exec = require('child_process').exec;"
        ],
        "start": [
            "node.warn('start');",
            "resume('tar', msg);"
        ],
        "tar": [
            "node.warn('tar');",
            "sm.ts = new Date();",
            "sm.days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];",
            "sm.day = sm.days[sm.ts.getDay()];",
            "sm.file = sm.udir + 'TESTING-NodeRED-' + sm.day + '.tar';",
            "var pre = ' ' + sm.udir;",
            "var cmd = 'tar -czvf';",
            "cmd += ' ' + sm.file;",
            "cmd += pre + 'flows*.json';",
            "cmd += pre + '.config*.json';",
            "cmd += pre + 'settings.js';",
            "cmd += pre + 'package.json';",
            "cmd += pre + 'package-lock.json';",
            "cmd += pre + 'lib/*';",
            "sm.fill = 'yellow';",
            "sm.text = 'Compressing...';",
            "output = false;",
            "sm.exec(cmd, function(error, stdout, stderr) {",
            "   if (error) {",
            "       node.error(error);",
            "   } else {",
            "       resume('output', msg);",
            "   }",
            "});"
        ],
        "output": [
            "node.warn('output');",
            "sm.ts = new Date();",
            "sm.days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];",
            "sm.day = sm.days[sm.ts.getDay()];",
            "sm.file = sm.udir + 'TESTING-NodeRED-' + sm.day + '.tar';",
            "msg.topic = 'Node-RED';",
            "msg.payload = sm.day + ' Backup Complete';",
            "msg.filename = sm.file;",
            "sm.fill = 'green';",
            "sm.text = sm.day;"
        ],
        "reset": [
            "node.warn('reset');",
            "sm.fill = 'grey';",
            "sm.text = 'Reset';",
            "output = false;"
        ],
        "status": {
            "fill": {
                "get": "sm.fill"
            },
            "text": {
                "get": "sm.text"
            },
            "shape": "dot"
        }
    }
}

EDIT, removed extra comma, thanks @cflurin. Still not working tho.

There is an error in your code:

it should be (without comma):

Oops, that was a last minute edit in the copy/paste.
Still doesn't work for me after checking.

Strange, it works for me.
Raspberry Pi, node-red 3.0.0-beta.2

"Monday Backup Complete"

Um, thanks. I'll have another play then.

I was an idiot. When I was using a trigger node to test it, I wasn't setting the topic to "start" and therefore the DSM node didn't know what to do. Doh!

1 Like

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