Web hooks and the Expression Element

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Web hooks and the Expression Element

924 Views
jaycanteenwala
NXP Employee
NXP Employee

Re. Thread & modular IoT gateway:

 

All I want is for the Rapid IoT device (in response to various triggers) to send a POST message via an HTTP API to a web service on a local LAN. I want to do this using the NXP studio via the WebUI.

What is the simplest way to do this? Or what are my options? I don’t see anything in the Element Toolbox of the Embedded view to allow me to send a web hook. That can only be done (it seems) via the Application view. I know I can use BLE to send data to the mobile app and send the web hook from there. I want to do it directly from the Embedded App because a mobile phone won’t be nearby but a WiFi network will.

 

Speaking of Application view. 

I am confused about how the “Expression” element is used. I thought this was using the syntax of Regular Expressions but the documentation for this element is unclear. There are also no examples on how it is to be used.

 

In my simple app, I am trying to compare the readData string value (which displays on a label as “true" and “false”) with the string “true” but it doesn’t seem to work. I’ve tried various combination with no luck. I’ve attached the .atmo project for reference. Specifically, what should the ‘expression’ filed look like?

Labels (1)
0 Kudos
1 Reply

796 Views
theophileleroy
NXP Employee
NXP Employee

For your demo, the easiest way will be to utilize IP stack of Thread network to send COAP message using GET/POST method over your local area network. Currently, only Thread connection to Volansys Gateway is supported on online IDE. We will release new features in upcoming weeks where you can add your own custom embedded element to NXP Rapid-IoT firmware embedded view.

Regarding your remark:

I am confused about how the “Expression” element is used. I thought this was using the syntax of Regular Expressions but the documentation for this element is unclear. There are also no examples on how it is to be used.

The expression element is a block that you can use with a regular conditional expression like in C, for example:

pastedImage_2.png

Where X, Y, and Z were assigned on the trigger to this bloc using the syntax described in the documentation: {X:readData}. Please find attached an example project utilizing these features.

0 Kudos