Is it possible to run shell commands from applications created with the Cloud IDE?

I have the Tinkerboard/ROS-Core2 environment. I would like to run system shell commands.

Here’s a simple example. It compiles with no errors. The system command works on the command line.
The IDE allowed the system function. Is there’s a different syntax I need to use ?

If system shell commands work I will eventually configure festival for speech synthesis.

#include
#include
#include “hFramework.h”
#include “hCloudClient.h”
uint16_t v_int;

void send()
{
for (;:wink:
{
platform.printf(“asd %d\r\n”, sys.getRefTime());
sys.delay(1000);
}
}

void cfgHandler()
{
auto l = platform.ui.label(“l1”);
l.setText(“label1”);
auto b = platform.ui.button(“btn1”);
b.setText(“button1”);
b.setLocation(100, 100);
platform.ui.video.enable();
}

void onConsoleWrite(hId id, const char* msg)
{
}

void onKeyEvent(KeyEventType type, KeyCode code)
{
LED3.toggle();
UiButton b = platform.ui.button(“btn1”);
if (code == KeyCode::Up)
{
b.setLocation(20, 20);
}
else if (code == KeyCode::Down)
{
b.setLocation(20, 70);
}
}

void onButtonEvent(hId id, ButtonEventType type)
{
static int cnt = 0;
if (id == “btn1”)
{
UiButton b = platform.ui.button(“btn1”);
if (type == ButtonEventType::Pressed)
{
b.setText(“pressed %u”, cnt++);
}
else
{
b.setText(“released %u”, cnt++);
}
LED3.toggle();
}
}

void cloudTask() {
sys.delay(5000); //necessary to boot CORE2-ROS (with ASUS Tinker Board), for CORE2 can be commented
platform.begin(&RPi);

platform.ui.setProjectId("@@@PROJECT_ID@@@");
platform.ui.configHandler = cfgHandler;
platform.ui.onKeyEvent = onKeyEvent;
platform.ui.onButtonEvent = onButtonEvent;
platform.ui.onConsoleWrite = onConsoleWrite;
// UiButton b = platform.ui.button("btn1");
hSens1.pin1.enableADC();

sys.taskCreate(send);

while(1) {
	sys.delay(500);
	LED3.toggle();
// platform.ui.label("l1").setText("uptime %u", (unsigned int)sys.getRefTime());
 v_int = hSens2.pin1.analogReadRaw();
 platform.ui.label("l1").setText("Sensor raw output = %d\r\n", v_int);
}

}

void hMain()
{
sys.taskCreate(cloudTask);

for (;;)
{
    sys.delay(500);
    LED1.toggle();
    if ( v_int > 1200 )
    {
    system ("/usr/bin/mpg123 /home/husarion/Sound/announce/front-left-sensor.mpg");
    }
}

}

Hi Jerry, I see several solutions to your problem:
a) connect ASUS Tinker Board using microUSB cable to CORE2 micro USB Serial port and write through it strings to the Tinker Board. On Tinker Board run a script that executes strings from CORE2 in a Linux shell.
b) The same as before, but you don’t send strings with Linux shell commands, but a single letter - for each received letter a script running on Linux will play another voice.
c) use ROS - Tinker Board will subscribe to a topic waiting for voice ID etc. CORE2 will publish to this topic. In ROS you have ready to use nodes that could be useful in your project.

Thanks! For fast prototyping I will use solution a. For the actual application I will use ROS. Sorry for the late reply. I’ve been busy getting my r/c aircraft ready for this years flying season.
One of the airplanes I’m building is 3d printed. 49" wingspan, Piper Pawnee Cub. Around 100 printed panels.
The project to a bit longer than expected. I started printing the parts in mid February. Plus motors, electronics and servos take several weeks when you order from Hobby King.

Thank you very much for the reply.