Open Sebb767 opened 9 years ago
I think the HTTP output plugin needs to be moved to the new architecture seen in recent commits (where the specific plugin inherits from the Output plugin object, which inherits from the Plugin object). I will address this in a future release.
Also worth noting that I have no idea about the final error I'm afraid (Exception happened during processing of request from ('192.168.2.112', 52955)
).
It really looks like the data isn't supplied to the webserver. The second error is defacto the same problem, but I fixed it by using a newly generated date (because I was thinking that only this field is missing).
Rolling back to V1.0 didn't help, which seems quite strange, since issues indicate that the plugin was/is working for others. It's a pretty fresh Raspian install, so I don't think that a tainted system is the cause. I'll do a completly fresh clone soon to exclude my cfg's as the cause.
Have also the same problem with the HTTP Output, on a fresh install of the AirPi software. The error will be: ERROR: Failed to import plugin HTTP: global name 'calibration' is not defined I have no idea where to setup the calibration information. Will it be a good idea to give a small doc file to setup the HTTP plugin .. so we can follow all the same setups to find the error ?
Please see earlier comment - it's just that HTTP hasn't been updated following a change in architecture, i.e. refactoring the Output class and adding abstract methods. This will be fixed in a future release.
All other output plugins have been migrated, so if anyone wants to have a go at fixing, just compare the same output plugin between two commits (take a look at the commit comments to see when each output plugin has been migrated) and make the same set of changes to HTTP.
You can actually fix your error by adding a import calibration
at the top of the file - but all bets are that you will face the same errors I posted above. I'd really like to fix all this, but unfortunatly my time (and python knowledge) is limited :/
Partial fix contained within 6a047b6 - now works as long as calibration
and historyCalibrated
in cfg/outputs.cfg
are set to false
.
If either option is enabled then the problem is the same as that described by @Sebb767 at the end of the initial bug report. I have no idea what the problem with enabling these is, and the HTTP output is a low priority for me because it's very complex and I never use it. Anyone who can offer a fix is welcome to submit a pull request.
Had some time to test again today and noticed something strange - the plugin still crashed despite the fix. This was caused by the JSON/CSV output which used the calibrated option.
It can be easily fixed however by moving the config entrys below the http one to make them load after the http plugin or by disabling them.
Hey there! I'm currently setting up my own AirPi and I'm pretty happy about this fork for having done all the things I'd need to implement myself ;) Thank you!
However, trying to use the http plugin results in serveral errors. They appear in the dev and master branches, my current setup is using the dev branch:
My outputs.cfg (for http)
Trying to simply use the http plugin throws the following error:
I solved that one myself by adding a simple
import calibration
at the start of the file. With that, the http plugin loads, but trying to access the site gives me the following error:This happens no matter if the sampling has actually started or not. I fixed it by replacing
self.server.httpoutput.lastUpdate
with the current time, but this yields the following error:I'm assuming that the sample data isn't send to the http output module, but since my understanding of the projects code (and, well, python) is very shallow, I can't fix this on my own. Any ideas?
I'll maybe try an older commit until this is fixed.
Update: Reverting to commit/version 1.0 didn't fix this :/ (it did fix the import however)