How to start actions from a script

Revision as of 17:13, 23 May 2024 by Registered User

1. How to start some actions from an external script

1.1. Introduction

STM32CubeMonitor provides the environment to create flows to build dashboard or manage some action. Thanks to Finite State Machine provided in node-RED ecosystem, it is possible to build complex automatized process for your dashboards or to drive some action on STM32 devices. It is also possible to execute some "command line" action with the exec node. So most of the time, STM32CubeMonitor will manage your measurements automatically.

Some users need to drive the actions from an external script ( .bat, .sh, ....) or external tools. In this case, interacting with the graphical UI of STM32CubeMonitor is not efficient. This page will explain how it is possible to use the http node to allow a script or external application to trig actions in the STM32CubeMonitor flow.

1.2. The concept

As soon as STM32CubeMonitor is started, the flow are running. Even if the dashboard page is not open, flows are working in background. The solution is to add in the flow some http nodes to catch requests from user script and perform the actions requested. The command curl can be used easily in command line or script to send the request to STM32CubeMonitor. When the action is finished, the result is sent back in the http response.

Interaction between script and STM32CubeMonitor


1.3. The HTTP node

Explain here how to configure the node and curl command

1.4. The basic implementation

Show a very simple interaction between a script and a flow . Put the basic example

1.5. Example : Toggling Nucleo LED from a command line

Put the LED example here and explain how it is working

No categories assignedEdit