-
Notifications
You must be signed in to change notification settings - Fork 124
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
Get live data from HTTP server with active aggregation #609
Comments
the server serves data from which is populated with data from just after aggregation: Line 166 in df03cf6
i'm not sure how much changes would be needed to serve non-aggregated data. |
During aggregation it seems that both Push Server and MQTT Data is updated. Lines 136 to 147 in df03cf6
Is it possible to add this code section also during aggregation? Lines 163 to 168 in df03cf6
|
why don't you just try it, worst case it will crash...
i'm not so familiar with the MQTT integration, but i think it publishes BOTH the raw and aggregated values. |
@indus: |
@r00t- I used to use to compile from source on an arm SoC and switched to a docker container recently with a transition to amd64 hardware. I probably could test I guess it should be easy to let the Dockerfile check-out a branch. |
(i find it irritating to see a long listing of mostly boilerplate code in an obscure language that this project does not use posted here.) |
sorry - i deleted it (my idea was that it may have helped others to build a workaround in a similar situation) |
sorry, i didn't mean you have to delete it. the reference to the push option was very valid, as it provides a way to extract the un-aggregated data. actually, now that i read the code for "push" in vzlogger, it has a problem similar to mqtt, => #687 |
No problem - and I understand your objection. I think I found a compromise for my deleted post:
Deno Code Exampleimport { Hono } from 'npm:hono';
const app = new Hono();
app.post("/", async (c) => {
const body = await c.req.json();
for (const channel of body.data) {
if (channel.uuid === UUID) {
// business logic
}
}
// respond with a JSON or the push sever throws an error
return c.json({}, 200);
})
Deno.serve({ port: SERVER_PORT }, app.fetch); |
i still think your example would be much more useful if it would show the format of the data, i.e. with a debug printf, |
I'm really not good at PHP (nor C++), but I had a look at the official code, and it seems to me it is doing something very similar. To my understanding it recreates the channel data here (with the difference that it may be and sends it back here: I don't know why the official code does so, but sending the whole body back comes close and shoudn't be more excessive. What I really don't understand is what the push server does with the information? I think the relevant code is in this check here: Lines 174 to 191 in ae0372d
But its purpose? 😶 I have no idea! |
vzlogger only stores the response-body to dump it in case of an error:
|
ok - but it also expects some data if the http_code is in fact 200, otherwise it throws an error itself. and the middleware seems to always send it not only in case of an error. Nevertheless I've changed my example to respond with an empty object |
The HTTP server seems not to provide realtime readings, but only the aggregated values.
This delivers exactly the same, but should be different, as my aggregation time is 600s.
http://localhost/middleware.php/data.json?options=raw&from=now&uuid[]=1111-2222-3333
http://localhost:8081/1111-2222-3333
Is there a way to get the live data over HTTP? The push server is working, as I can see the live data in the middleware.
The text was updated successfully, but these errors were encountered: