Embedding snips ASR in node process


Hey there,

I’m currently trying to perform a super hacky operation, consisting of the following step in a Node.JS script:

  • stop the default snips ASR service
  • start the node script, that listens on the default Snips MQTT and we start a partial MQTT server using https://www.npmjs.com/package/mqtt-connection on port 1884
  • then we start a snips-asr process using spawn child_process in Node, we connect it to our own Node MQTT server (not localhost:1883, but localhost:1884)
  • we act as a bridge between the snips MQTT and our own MQTT server/ASR process

Now the problem seems to be with connecting to my own MQTT server, because connecting the child process to localhost:1883 seems to be working fine.
All code and the output can be found here: https://gist.github.com/svenvdvoort/f4c69af899b9d061c238635610041b70 (the code is not yet complete)

I really hope that someone could take a look at my code, because I don’t really have a clue how to debug this situation.
Thanks in advance!


Hack and slay dude. Cool.
I’ve wondered about taking this approach to the Snips ASR in integrating into https://github.com/syntithenai/hermod for Raspberry Pi.

It’d work. I imagine proxying Internet based services onto the local mqtt bus.
But for a local solution it’s not ideal.

Also worth mentioning that I found there are undocumented preconditions to fire up the ASR. I had to kick a dialog, cancel it and then start again in developing https://github.com/syntithenai/opensnips/blob/master/snips-react-satellite/README.md

What would be nice is a streaming http API. I thought I remembered a forum post or changelog that mentioned the Snips ASR supporting direct HTTP. Haven’t seen any docs.
Can anyone in the team enlighten me there ?