Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when triggering a "command" containing double-quotes #111

Open
DavidPower opened this issue Feb 3, 2018 · 0 comments
Open

Error when triggering a "command" containing double-quotes #111

DavidPower opened this issue Feb 3, 2018 · 0 comments

Comments

@DavidPower
Copy link

DavidPower commented Feb 3, 2018

@maddox,

*** Update ***
I've tried putting the mosquitto_pub command in a bash script and calling the script (per below) from dasher as follows:

sudo bash /home/pi/scripts/script_name.sh

Still no go. Dasher gives me a "There was an error:"

*** End Update ***

Dasher installs and runs fine for me.

However, I'm attempting to run a mosquitto_pub command containing double-quotes around key names. Here's a sample config.json line:

"cmd" : "mosquitto_pub -d -t mytopic -m {"key1":100,"key2":200,"key3":300}"

This runs fine from the bash command line without the exterior quotes.

*NB: When I replace the "cmd" line with a "url", it works fine which leads me to believe the problem isn't with some other aspect of the config.json file.)

I've tried escaping the double-quotes with slashes, hex values, and others but nothing seems to work... dasher reports:

There was an error:

But no explanation as to the nature of the error.

Any thoughts?

OR... is there a better way to publish an MQTT message from dasher?

Thanks,
dp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant