I’m trying to push data from a PMS-5003 with my own code. When I try to POST the data, the server responds with code 301. Here is a sample data payload:
{
“software_version”: “myfirmware”,
“sensordatavalues”: [
{
“value_type”: “P2”,
“value”: “15.0”
}
]
}
Even after I changed it to SDS_P2, my data didn’t show up until I sent all 3 values, SDS_P0, SDS_P1 and SDS_P2. If you leave any of them out, it ignores the sample!
Do we need to upload to both servers, or is it enough to just upload to SC? I am not sure what the madavi API is used for besides grafana.
Also, what update interval is preferred for SC API?
Hi,
Madavi is used for debugging. @ricki-z Do he really have to send to Madavi as well ?
Please use 5 minutes interval. And if some holes appear in the curves reduce a bit.
After I added PM1 and PM10, it shows on the map and grafana. So the map needs more than just PM2.5 in order to for a sensor to show up. This is a peculiar requirement. I don’t usually bother with anything besides PM2.5, because the PM1 & PM10 estimates tend to be inaccurate.
I am not sending data to the Madavi API, so I guess it isn’t required.
Hello @lincomatic
you need to use your chipID at Madavi (grafana) , not the ID generated by our main database.
And you should change your user agent in the POST request to something unique. Generic requests might be blocked as those are normally made by crawlers which won’t post any data.
Please also change the request URL to /v1/push-sensor-data/ (with the slash at the end). This will generate only one instead of two requests.
@ricki-z,
Yes, I’ve been doing exactly what you asked. The strange thing is just that I had to add PM10, or my sensor wouldn’t show up on the map. Thanks for the reply.