Using Photon for Wifi-based GPS, need help to POST JSON

Hi, I’m brand new to Particle, it seems really awesome. I’ve noticed that Photon can do Webhooks, but can also POST raw JSON data. I’m trying to figure out which (if either) I can use with FIND which can use WiFi fingerprints to determine positions indoors (full disclosure, I’m the developer of FIND).

Basically I determined the WiFi SSIDs and RSSI values using

WiFiAccessPoint aps[20];
int found = WiFi.scan(aps, 20);

and now I want to send the aps as a JSON in the following format to http://ml.internalpositioning.com/track:

{
   "group":"some group",
   "username":"some user",
   "location":"some place",
   "time":12309123,
   "wifi-fingerprint":[
      {
         "mac":"AA:AA:AA:AA:AA:AA",
         "rssi":-45
      },
      {
         "mac":"BB:BB:BB:BB:BB:BB",
         "rssi":-55
      }
   ]
}

But as of yet I’m totally lost as how to do this. Any help would be greatly appreciated!

There’s a HTTP library available in the Web IDE which might be able to do this. There should be an example included. Take a look :smile:
Using the community search should pop up quite a few topics as well.

Awesome! Thanks, I think I see how to do it!

1 Like

I got it working. I posted the code here: https://github.com/schollz/find/issues/73 if anyone is interested. Photon is so cool!

1 Like