Jacques44 / node-red-contrib-bigssh

remote command using ssh big node
Apache License 2.0
8 stars 12 forks source link

sending command line args #14

Closed spanout closed 5 years ago

spanout commented 5 years ago

Excuse this issue if I am being stupid. I am executing a remote python script on a pi. I can do this really well with BIG SSH but I want to add args after the script name. If I put this in the command line, it works, I want to get the args from mqtt and I have tried to add them as payload but this gives me "TypeError: Cannot read property 'replace' of undefined" I also tried to put them in a template. What is the correct way to do this.

thanks for your help and this is a great Node !

Jacques44 commented 5 years ago

Hello,

no question is stupid :-)

You have a checkbox: « payload is an argument » . If checked, the node takes any incoming message as an argument for your command

thanks and Regards

Le 11 juil. 2019 à 18:26, Tim Spanoudakis notifications@github.com a écrit :

Excuse this issue if I am being stupid. I am executing a remote python script on a pi. I can do this really well with BIG SSH but I want to add args after the script name. If I put this in the command line, it works, I want to get the args from mqtt and I have tried to add them as payload but this gives me "TypeError: Cannot read property 'replace' of undefined" I also tried to put them in a template. What is the correct way to do this.

thanks for your help and this is a great Node !

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Jacques44/node-red-contrib-bigssh/issues/14?email_source=notifications&email_token=AEKS6M2PG7FQXBDNMFRVRILP65NKZA5CNFSM4IBM2UP2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G6VXL6Q, or mute the thread https://github.com/notifications/unsubscribe-auth/AEKS6M2YF5REXNKF54KZP6DP65NKZANCNFSM4IBM2UPQ.

spanout commented 5 years ago

Thanks for your prompt reply. This is exactly what I thought, but I am getting "TypeError: Cannot read property 'replace' of undefined"

The node is configured like the attachments BIG SSH

A debug on the msg.payload prior to the bigSSH node is:

"#0000ff #0000ff"

so I would expect 2 arguments to go through... is that correct?

spanout commented 5 years ago

OK, figured it out, remove the # of the html colour codes and all works, so not an issue