I’ve written some simple code to subscribe to an event, and i’m creating the events using postman to POST to the https://api.particle.io/v1/devices/events end point. I can see the published events clearly in https://dashboard.particle.io/user/logs but when i examine them in my p0 and then publish an event containing the data, i see gibberish. For example:
here’s the code:
#include <string.h>
// Log message to cloud
void debug(String message) {
Particle.publish("DEBUG", message.c_str(), PRIVATE);
}
void setup(void)
{
/* Register a particle.function so that we can receive events */
Particle.subscribe("displayScreenOutsideTemperature", updateOutsideTemperature);
debug("setup done");
}
void loop(void)
{
}
void updateOutsideTemperature(const char *topic, const char *data)
{
debug("updateOutsideTemperature: received event");
char msg[100];
sprintf(msg, "Topic received %s : %s", topic, data);
debug(msg); // this shows up as "Topic received " and then gibberish
}