maddox/dasher

Error when triggering a "command" containing double-quotes

DavidPower opened this issue · 0 comments

@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