I have successfully setup (and moved) a workflow that does the following; -
- Uses HTTP node to obtained bearer token
- Queries device API and successfully returns information
When I make this exact same workflow as an Edge workflow the payload is undefined. I think the conatiner may not allow the GEA to query the API which resides on the same device as docker and its container.
Tried using local IP address.
Hi @CyberJMC66 and welcome to the Losant forums!
This likely has to do with how Docker handles networking. See documentation here on how to connect from a container to a service on the host:
In the HTTP Node, if you specify
host.docker.internal as the domain name for the URL Template, it should resolve to the internal IP address used by the host when executed on your edge device.
Please give this a look and let us know how it goes!
Tried it - still getting undefined payload back in debug.
I have also tried the following;
Where HOSTIP is the host of the container.
Still getting “undefined” returned from HTTP Node request to Host device
If you’re seeing
undefined in the Debug Node Output, it means that the Payload Property field set in the associated Debug Node is undefined.
You can leave the Payload Property field blank, and it will display the entirety of the payload. Otherwise, I would check to ensure that this path is defined upstream in your HTTP Node, either as the Payload Path to Store Response or the Payload Path to Store Error Response (if applicable).
Once you have the Debug message, if you’re still having problems connecting back to the host machine, please post the error here and we will review.