HTTP Trigger node

Hi,
I want to listen data from specific port with path like below
192.168.43.109:8080/io_log

for the above feature how to i configure in the config.toml file.

Have look my sample Config.toml

[gateway]
# Losant Device ID of Agent - EnvVar: DEVICE_ID
id = 'MyGatewayId'

# Losant Access Key for Agent - EnvVar: ACCESS_KEY
key = 'MyAccessKey'

# Losant Access Secret for Agent - EnvVar: ACCESS_SECRET
secret = 'MySecretKey'

[store]
# Path to Agent Persistent Store - EnvVar: STORE_PATH
path = '/data/losant-edge-agent-store.db'

[webserver]
# If webserver should be enabled - EnvVar: WEBSERVER_ENABLED
 enabled = true

# Port to run webserver on - EnvVar: WEBSERVER_PORT
 port = 8080

# Address to run webserver on - EnvVar: WEBSERVER_ADDRESS
# address = '0.0.0.0'

# Basic auth username for webserver - EnvVar: WEBSERVER_USERNAME
# username = ''

# Basic auth password for webserver - EnvVar: WEBSERVER_PASSWORD
# password = ''

I want to listen this url 192.168.43.109:8080/io_log

Kindly share the details.

Thanks,
Sivasankari S

Hi @sivasankari_s1,

I am a bit unclear on this question, what is it that you are trying to accomplish? And what is your end goal?

Thanks!
Julia

Hi julia,
I try to listen data via HTTP trigger node.
My Gateway wifi IP:192.168.43.109
PORT:8080

if i send the data through POSTMAN my Losant Edge Work Flow Triggered and I got data in Losant cloud
POSTMAN URL:POST:http://192.168.43.109:8080.

Data Format :

{
  "data": {
    "voltage":230,
    "power":100
  }
}

For the above mehod I have configured in config.toml only PORT 8080 but
now I want to POST the data using this url :http:192.168.43.109:8080/io_log
How to specify this url in config.toml file.

Thanks,
Sivasankari S

Here’s what you’ll have to do in order to trigger on your specific address / port / path:

  1. Listen on the 192.168.43.109 address, which is configured using the webserver.address field in the config.toml file.
  2. Listen on port 8080, which is configured using the webserver.port field in the config.toml file.
  3. For the /io_log path, this can only be done using a Conditional Node in the workflow and checking {{ data.path }} === '/io_log' after the HTTP Trigger Node.
1 Like