I am trying to send commands to my TinyG and Arduino Uno simultaneously using a custom widget in chilipeppr. I watched @jlauer video about this, which helped tremendously, but am now stuck. My issue is that I am not sure what syntax to use when sending the commands from JS.
When I have my arduino uno selected in the Chilipeppr workspace I can send the basic text command “2” as a string from JS and it works:
var cmd = “2”;
chilipeppr.publish("/com-chilipeppr-widget-serialport/send", cmd);
It also works when I send the text command from the spconsole widget.
When I have my TinyG selected, the command “send /dev/ACM0 2”
works in the spconsole and serial port widgets, however, I am not sure what string or command to send from the javascript in my widget to control the Arduino when my TinyG is selected as default. I am very new to JS and JSON syntax so any help is appreciated!
Sounds like an interesting use case. You can use the chilipeppr.publish("/com-chilipeppr-widget-serialport/send", cmd); for whatever is the default (green) port that is selected in the serial port widget. If you are going to actually specify which port, you need to use a lower level call. There are some example macros that show this. You can also look in the pubsub dialog box for the serial port widget. The command would be: chilipeppr.publish("/com-chilipeppr-widget-serialport/ws/send", “send /dev/ttyACM0 2\n”);
The spindle widget is looking good. I just don’t have a spindle setup like that to test/use it. Anyway you could show us all a video of how it works? That voice control widget is exciting too (even though you said ignore).
@jlauer Sorry for the late response. Yeah, I’ve been wanting to work on a voice control widget for a while for tedious tasks like homing the machine or resetting the work coordinates.
I haven’t touched it in a while but hope to get back to it soon.
On that note, I just took some training at work where we were incorporating speech recognition tools into websites. We were using a node.js server through Cloud Foundry I believe.
Are there any technical issues with trying to incorporate similar type tools/ APIs into a Chilipeppr workspace?
@jlauer Sounds good John!
The one issue I am having now is allowing access to my mic in Chilipeppr on Chrome. Apparently Chrome requires HTTPS certificates for Mic and Camera access. I can’t seem to find a workaround.
Any suggestions?