Hello, I am trying to send commands to my TinyG and Arduino Uno simultaneously

Hello,

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!

Correction: “send /dev/ttyACM0 2” does not work from the spconsole" only the serialport widget

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”);

@jlauer Thanks John, that did the trick. This is for my auto tool change system, hopefully I can share it in the near future.

Also, if you get a second, you should check out my updated Spindle speed control widget. I’ve made a lot of progress since the last time you saw it.
ID com-chilipeppr-widget-spindlecontrol
Standalone URL http://raw.githubusercontent.com/reecem7/widget-spindlecontrol/master/auto-generated-widget.html
http://chilipeppr.com/darkg
(please ignore some of the other tabs/widgets still under dev)

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?

You should be able to easily incorporate voice reco tools into a widget. It’s all just client-side Javascript.

@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?

I think there’s a command line switch for Chrome that lets you do mic/cam access without https.