Hello everybody,
Last week I installed the sensors in my garden and published the data on the different portals. To learn some more I have been trying to configure a custom api. I used the simple data php file:
(data_simple.php from github)
I copied this page on my own website: https://ruitergeo.nl/sensoren/sensorapi.php . In the configuration of the sensor I filled in the location of the page see:
This didn’t work out fine because the logger produces errors:
*## Sending to custom api: *
Request failed with error: -1
Time for Sending (ms): 15461
What did I do wrong?
Can anybody help me with this?
pjg
November 21, 2024, 6:17am
2
Welcome !
Can you firstly try without the https ?
Then try to remove the .php extension.
Then remove the / or try to put it on the Pad line.
I can remember there are such kind of kleinigkeiten…
pjg
November 21, 2024, 6:20am
3
And what happens if you try to post with POSTMAN for example. Does it works ?
Check structure here:
I have read that Wiki more than 10 times but not finding the answer I am looking for.
Below the json, reply from Madavi is 200 +(Sensor: esp8266-xxxxxxx
ok) so should be ok, but actually no data visible in their Figs. (using Postman for testing).
(X-Pin: … not required for Madavi, but I have tried with 0 or 1 but doesn’t work. Not needed to put values between “”).
Headers:
Content-Type: application/json
X-Sensor: esp-xxxxxxx
Body:
{
“software_version”: “test”,
“sensordatavalues”: [
{“…
Hi pjg!
Thanks for your suggestions. I tried all combinations of server and path but did didn’t work out.
I also tried some efforts with postman. For instance:
https://ruitergeo.nl/sensoren/sensorapi.php?temperature=“2”&humidity=“3”&BME280_temperature=“1000”&BME280_humidity=“79”&BME280_pressure=“999”&Sensor=“esp8266-15109343”&HTTPS_SENSOR=“esp8266-15109343”
But the php file doesnot understand the parameters. I have little experience with this environment and hoped that somebody else had a working example.
Do you have another idea?
Hi. Could you try the following in the API-setup:
Serveradres: ruitergeo.nl
Pad: /sensoren/sensorapi.php
Poort: 443
The leading / in Pad is needed and if you want to use HTTPS the port should be set to 443
Hi!
That did the job!
This was the last logging:
Sending to custom api:
Succeeded - ruitergeo.nl
Time for Sending (ms): 2979
Thanks for helping me out!
2 Likes