-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send data to self hosted API #152
Comments
Okay, I found out that it is a simple POST. However, when I try to just send it to my server, it says Connection refused. Do is this option Send data to custom API even works? |
This option is working. Is the sensor in the same network as this server or in a guest wifi? |
Hello, the sensor is within my home network, while the API is on my webserver. if I execute the URL via the browser it logs the activity, but no attempts if I try it via the sensor. |
So your webserver is in your local network (192.168.234.1)? |
No, my server is not in my local network. It is an outside network |
Then please enter the correct IP of the server (192.168.234.1 is your router I think) or the hostname in the field "server". |
Oh, you got it from the initial screenshot. That's the configuration before me editing it. |
remove the http:// at the start f the line. the protocol is choosen by port. There must be only the server name or IP in this field. |
Really? |
is there anything else I can try. Still don't receive any data from the sensor to my server |
@umnibot can you send me the hostname and script path to rajko (at) sensor.community? So I can have a look at that. |
The server is forwarding to https. Could you please activate https for this API and check again? It's possible that the firmware isn't following the 30x redirect but also doesn't show an error (http error codes are greater or equal 400). |
Just tried with https and got the connection refused |
Our firmware only supports the following ciphers (minimum set of ciphers): Your server supports the following ciphers:
|
So, the only option, if I cant support these ciphers, would be to make it HTTP:. Right? |
Just activated TLS_RSA_WITH_AES_128_CBC_SHA256 but still can't make it work |
At the moment: yes. |
Okay, I will set the folder to http to see if it will work. |
The measurements "samples", "min_micro" and "max_micro" are used to check the overall performance of the firmware. "samples" is the count of loops the main() function was running, "min_micro" and "max_micro" are the minimum and the maximum time the main() loop was running (in microseconds). To the screenshot: Only the last errors are shown, not the result of the lastest transmission. So the "read timeout" was only a one time failure. See the difference between "number of measurements" and "data send". |
Regarding the problem with HTTPS: Please check your server at https://www.ssllabs.com/ssltest/analyze.html . As you can see the ciphers needed aren't supported yet. |
Hallo, es hat mich grade leider einige Zeit gekostet rauszufinden, was mit meinem Feinstaubsensor los war. Auch bei mir lags am "zu modernen SSL Profil" am empfangenden Webserver meiner Custom API welches serverseitig zwischendurch mal aktiviert wurde. Leider hat das Logging im Feinstaub Sensor garnicht geholfen. Es stand (max Info) immer nur dran: Sending Custom API (nach den öffentlichen APIs natürlich;-) ) Im "Fehler" modus des log dasselbe. Allerdings auch kein "success" oder so. Es wäre klasse, wenn das Logging für solche Verbindungsprobleme zB den Return Code oder sowas ins Log schreiben würde. Bei mir Firmware NRZ-2020-133/DE vom Nov 29 2020 hab ich es nicht geschafft die Verbindung zur Custom API damit zu debuggen. Erst diese Diskussion hier brachte mich auf den richtigen Weg. Besten Dank dafür! |
Hi Rajko. It seems like with firmware update NRZ-2020-133 the sensor stopped sending info to the custom server. Now looking at my server log it seems that the last was data sent on 2020-12-14 16:13:43 Nothing on the server was changed nor on the sensor (using http not https). ws: root ...
|
Please check that the SSL certificate is max. 2048 bit. And that the supported ciphers contain one of the following: |
Do I need SSL for HTTP only ? |
Also just checked that we have TLS_RSA_WITH_AES_128_CBC_SHA256 |
SSL isn't needed. But in most cases the SSL cert and the missing ciphers are the cause for the not working self hosted API. |
It doesnt working with or without SSL. and in the server logs there is no evidence of an attempt for trying to connect. |
The problem is sending the data to a custom endpoint that was working before and not working now. So no idea how Madavi and SC server values can help me here. I already know what to expect and can see my values https://data.sensor.community/airrohr/v1/sensor/40205/ The sensor just not sending the data to my endpoint. I wrote a simple PHP script that listens to POST requests and get its data$post = file_get_contents('php://input'); $post = json_encode($post); file_put_contents('values.php', $post);Even if the request is empty it should log the current timestamp to the values.php file which is not the case. |
There wasn't any change to the release firmware in the last months. So this shouldn't be the cause of the problem. |
Hi Rajko, |
I have tried to find information about sending the data to my own API, but cannot find information on what request to expect, so I can build my logic.
Is there any documentation as of what the data,php should look like? Or at least is the request GET or POST
Thanks
The text was updated successfully, but these errors were encountered: