I send GPS coordinates from the device, but it doesn’t get included in the webhook json.
Device type: Photon
Firmware version: 0.7.0-rc3
Firmware flashed from: Build/OTA
Relevant bits of code and status messages along the way:
String lat = "1";
String lon = "1";
float alt = 1;
Insert GPS data:
lat = gga.latitude;
lon = gga.longitude;
alt = gga.altitude;
Package up the event:
String data = String::format(
"{ \"lat\":%s, \"lon\":%s, \"alt\":%f, \"UVindex\":%f }", lat.c_str(), lon.c_str(), alt, UVindex);
Serial.println(data);
Particle.publish("Burst", data, PRIVATE);
In the event log I can see that all the data is there, so the publish()
call should be correctly formed (?):
{
"name": "Burst",
"data": "{ \"lat\":5922.5274, \"lon\":01805.2055, \"alt\":30.600000, \"UVindex\":0.000000 }",
"ttl": 60,
"published_at": "2017-09-07T06:18:26.889Z",
"coreid": "330043000c47XXXXXXXXXXXXX"
}
.
In the “raw body” from requestb.in it just doesn’t show up (same in production environment):
{"metrics":[{"value":"","metric":"UVindex"}],"long":"","lat":"","alt":"1","apitoken":"ffeecef0-3d01-457c-a801-XXXXXXXXXXXX","dtype":"Particle","dmodel":"Photon","daddress":"330043000cXXXXXXXXXXXXXX"}
The fields are just empty, and oddly enough alt
contains the value it was initialised with (in setup()
). Not sure what to try next?
Set up CLI (install nodejs etc) and flash with a previous version of the firmware? Thought I could easily change back to an earlier version in Build as I think I’ve done that previously (?) but not possible (?) now. Looks like an error in the json building process though…
Happy to provide more info as needed