Getting gps coordinates of an Agent


(Andreiiz) #1

Hello what is the best way to get the gps coordinates of an Agent? I would like to use this information for trigger some operations in my microservice.


#2

You can get this from the GET /agent/config method on controller.

Or, you can run iofogctl describe AGENTNAME from cli on a remote host

Or, on the agent node, you can run iofog-agent info


(Andreiiz) #3

Thank you for the reply. The first method is the one I am trying to exploit. At the moment my setup is local deployment of the getting started tutorial, just to try the controller rest API.
The problem is that i’m unable to run the GET /agent/config cause i get
{ "name": "AuthenticationError", "message": "authorization failed" } even if i’m using the right accessToken. I can perform the others API without problems so there is something weird happening.

I think i can’t use iofogctl because I need to automate the process of obtaining coordinates via microservice, so rest calls would be ideal for that.

Edit: Maybe i can use /iofog-list and then iofog/uuid to get info about my agent position. I think it’s the same result of /agent/config, do you agree?
I have another question here: checking the position i get with this calls, it is not exactly correct. There is a difference of several km, any motivation?


(Serge Radinovich) #4

Can you please provide the exact series of commands that you are running against the Controller API?