Hi, I’m trying to replicate the ‘Hands on Particle Photon Weather Station in Azure’
My photon is connected. It is correctly reading the temperature and humidity. The webhook is created. By subscribing to the webhook, I can tell that the JSON payload is formed incorrectly.
An example is below. My JSON is Montclair and the correct one is Houston. Notice that mine is missing the name of the organization, the value of the humidity, and the location.
{"name":"ConnectTheDots","data":"{ \"s\":\"wthr\", \"u\":\"%\",\"l\":\"Houston, TX\",\"m\":\"Humidity\",\"o\":\"DXHackers\",\"v\": 34.000000,\"d\":\"Paul Bedroom\" }","ttl":"60","published_at":"2015-08-7T16:14:49.440Z","coreid":"53ff70066678505528451467"}{"name":"ConnectTheDots","data":"{ \"s\":\"wthr\", \"u\":\"%\",\"l\":\"Montclair, NJ\",\"m\":\"Humidity\",\"o\":\"P","ttl":"60","published_at":"2015-08-07T16:14:51.649Z","coreid":"2b0041000547343138333038"}
The code I am using is the same as in the lab.
//Above the void setup() line
char Org[] = "Particle.io";
char Disp[] = "Office";
char Locn[] = "Montclair, NJ";
//insde the void loop()
char payload[255];
snprintf(payload, sizeof(payload), "{ \"s\":\"wthr\", \"u\":\"%%\",\"l\":\"%s\",\"m\":\"Humidity\",\"o\":\"%s\",\"v\": %f,\"d\":\"%s\" }", Locn, Org, h, Disp);
Spark.publish("ConnectTheDots", payload);
I have the same issue when I try to create the JSON payload with temperature. Can someone please help me correct the problem.
Thanks