Home Forum Software How to upload to uRadmonitor from (Arduino) ESP32? Reply To: How to upload to uRadmonitor from (Arduino) ESP32?

#28856
DonZalmrol
Participant

minor update, the fully outprinted json is this:

11:28:49.410 -> }GET /data.uradmonitor.com/api/v1/upload/exp/01/X-User-id:%s
11:28:49.410 -> X-User-hash:%s
11:28:49.410 -> X-Device-id:%08lX
11:28:49.410 -> XXXYYYZZZ{
11:28:49.458 ->   "id": "0",
11:28:49.458 ->   "latitude": "50.989699",
11:28:49.458 ->   "longitude": "3.503907",
11:28:49.458 ->   "altitude": "12",
11:28:49.458 ->   "city": "Deinze",
11:28:49.458 ->   "country": "BE",
11:28:49.458 ->   "detector": "SI22G",
11:28:49.458 ->   "factor": "0.001714",
11:28:49.458 ->   "timefirst": 1621416528,
11:28:49.458 ->   "cpm": 72,
11:28:49.458 ->   "temperature": 22.3,
11:28:49.458 ->   "humidity": 48,
11:28:49.458 ->   "voltage": 406.395
11:28:49.458 -> }

It looks like my user-id (XXX), user-key (YYY) and device-id (ZZZ) are printed directly under the correct fields.
Probably has to do with this part of my code where it forces %s\r\n and %8081\r\n:

// Place get and json in string pointer to upload to platform
 String ptr = "GET /data.uradmonitor.com/api/v1/upload/exp/01/";
 ptr += "X-User-id:<strong>%s\r\n</strong>X-User-hash:<strong>%s\r\n</strong>X-Device-id:<strong>%08lX\r\n</strong>";
 ptr += USER_ID;
 ptr += USER_KEY;
 ptr += "0"; // device ID