Collos Location

Thanks for your response.
I did the HTTP integration to my test server and on that server i get payload data with latitude and longitude. But this coordinates are of my gateway not my device.
Did you mean something like that?
I do not understand what exactly you would like to explain to me here :confused:

If you are able to get coordinates from TTN, Collos integration is might not be configured properly. Did you follow those steps ?

I think u didn’t get me right or do you know what my question is?. Yeah I followed these steps and integretion is working OK. I get the location with Collos of my device. But now i want to parse these numbers (latitude & longitude) to somewhere (file or something like that). And i dont know how to do that :confused:

Is it working or not ? On your previous post you said you only get gateway’s coordinates. So yes, I do not get it :slight_smile:
If so what does mean "I did the HTTP integration to my test server and on that server i get payload data with latitude and longitude. " ?

I wrote some thing a little bit confused xD Yes it is working OK. In my console i see the location of my device.
So there is see coordinates of my device shown be side the map. So my main question is how to store or parse or something like that coordinates which are shown be side the map?

I think I should not even mention the HTTP integration because there is no connection here. Let’s just leave that behind.

I really hope that you understand me now?

Hi,

Seems that some confusion abounds…

What I understand is that

  1. you see GW coordinates in the uplinks from the GWs
  2. Collos integration is working and you see the device on the map in the console
  3. you would now like to subscribe to a feed of the device location directly.

I am not sure if you can/how to do that. But will look into it.

The Collos integration can forward said coordinates formatted as a GPS device to any Cayenne integration that you have though.
:slight_smile:

Hi Rich,
First of all thanks a lot Rich.
exactly as they mentioned all those things in 1,2,3.

Ok i will try to do Cayenne integration and I hope this will help me.
If you get any other ways to solve this problem can you please let me know?

One more thing Rich.
Can you please explain some things a little bit more to me?

  1. How TTN and integration with Collos + Cayenne really works ??

Does TTN calls Collos, etc.?
Does TTN calls Cayenne or Collos calls Cayenne?
What kind of data is transmitted, etc.?

And if it would be possible that Http Intgration payload would include (+ GW) DEVICE COORDINATES ?

Thanks a lot.

Only Cayenne?? Or any Webhook? (like IFTTT)

Actually it is pretty simple right now…

  1. TTN receives the uplink from one or more GWs and instead of throwing away duplicates it keeps the meta-data from each one (primarily that is RSSI and SNR plus TOA if it is available).

  2. If you have a payload that included WiFi sniff data for example then a payload script can be used to create the WiFi query format for WiFi base location.

  3. TTN then forms a query with all the meta-data plus andy WiFi data that is available.

  4. The Query is posted to the endpoint in Collos that you specify and Collos responds with a location.

  5. TTN console then looks at the locations coming back and, if there are multiple, it posts the most accurate one to the console location.

  6. The Cayenne integration is pretty dumb- firstly you need to add a Cayenne integration to the app (for the rest of the data such as the payload and signal strength etc.) Secondly, when you define the integration you get the option to specify a Cayenne channel number. It will quite simply, place the location returned from that particular endpoint in Collos to Cayenne to mimic a GPS device on the channel number that you specify in the integration.

I dont think we can specify any other Webhook right now, although… of course… that would be our desire… :wink:

@DenisStenkler, @DannyE : once TTN has queried Collos it coordinates in metadata:{latitude, longitude} fields of the payload.

{
  "app_id":"",
  "dev_id":"",
  "metadata":{
    "time":"2018-05-16T17:25:30.632668968Z",
    "gateways":[
      ...
    ],
    "latitude":45.184284,
    "longitude":5.7182016,
    "location_source":"registry"
  }
}

You can get the payload by MQTT or HTTP, use TTN’s storage or any other integration

1 Like

@Oliv & @RichL

Well you guys solved my problem :smiley: Thanks a lot. Now I see the location in my payload. Thanks again :smiley:

1 Like

Thank you @Oliv. Sorry for the delay but I’ve been working on other stuff - now want to finish this up. I ensured the configuration matched yours. I did eventually get the results I expected and you got - the location near Boston corresponding to Skyhook’s test vector. It did not work immediately however - to get the end-to-end location working I had to delete the device in Cayenne and create a new one.

There is some sort of caching going on somewhere in the chain. Now, I have replaced the Skyhook data with real data, that has worked before with Skyhook’s location system. What I’m seeing is that the ‘Metadata’ shown in the Console’s Application Data reports the old Skyhook test data location. See the screen shot below.

Anyways, all I know is that the TTN console still thinks the device is in ‘Needham Heights’. Somebody is caching this old location?

image

I have a working node with Collos in the backend and it works.Tested the payload decoder with the sample data and also returns valid data.
What I would like to do next is actually upload ssid payload but I am struggling with the the encoding side.
Does anyone have a an example of an arduino sketch that shows that part and is willing to share?

1 Like

@RichL @Oliv

Guys, me again :slight_smile:

Having one problem. Can someone explain how does really Collos work beacuse now i am a little bit confused??

My device see only 2 gateways. So Collos returns the location of one of the gateways (the one the device is closer), but not the correct location of my device. So does Collos works on “triangulation” method or how does it work? Where is the problem here?

Thanks a lot.

Hi there,

there are a number of perspectives that one can take when for a location. On one hand, a location of any kind, even if it is simply the closest gateway is desired where others might prefer a location that is based on less than 3 gateways to be suppressed. Right now, the TDOA will suppress anything less than 3 GW and the RSSI will always try to return something.

We are very close releasing a decent improvement to this though!

In the new version, the return codes will include the type of fix attained along with the number of GW that it is based on. This will mean that if you supply 4GW receptions but one of them gets discarded then it will tell you that it received 4GW but only used 3. There are a number of reasons why a GW reception might get discarded which includes noise and interference. Since TDOA algorithm could also potentially fall back to RSSI based then an indication flagging that fact should also be useful.

This means that the solvers will likely try to always return a location but give enough information to allow the requester to determine if they wish to make use of it or not.

On your original question, a packet received by 2 GW only should yield a result someone along the line between the two. A packet received by only 1GW will yield a result that is close to the GW location (with some random noise added).

Rich

1 Like

Did it eventually pull through @firmwareguru?
I have seen some confusing caching in the past and I am not 100% sure who is doing what.
R.

Hi Rich - well I can’t say for certain that it is all working at any given time - it does not yet seem to behave deterministic - but I did get it working at least once :slight_smile: So I wrote up a project describing what I did in case anyone wants to repro it for themselves. See the Hackster.io project.

Allow me to contribute, I have wifi location working on a wemos D1 mini.
For that you need this firmware:


and the following payload decoder:

var hexChar = ["0", "1", "2", "3", "4", "5", "6", "7","8", "9", "A", "B", "C", "D", "E", "F"];

 

function byteToHex(b) {

 return hexChar[(b >> 4) & 0x0f] + hexChar[b & 0x0f];

}

function hexToInt(hex) {

 var num=hex;

 if (num>0x7F) {

   num=num-0x100;

 }

 return num;

}

function Decoder(bytes) {

 var mac1="";

 for (i = 0; i < 6; i++) {

   mac1 += byteToHex(bytes[i]);

   if (i<5) { mac1+=':';}

}

var rssi1=hexToInt(bytes[6]);

 var mac2="";

 for (i = 0; i < 6; i++) {

   mac2 += byteToHex(bytes[i+7]);

   if (i<5) { mac2+=':';}

}

var rssi2=hexToInt(bytes[13]);

return {
  "access_points": [
    {
      "bssid": mac1,
      "rssi": rssi1
    },
    {
      "bssid": mac2,
      "rssi": rssi2
    }

  ]

}


}
2 Likes