nibi79 / synologysurveillancestation

Synology Surveillancestation Binding
45 stars 5 forks source link

Continuous move/zoom #40

Closed mschmieder closed 4 years ago

mschmieder commented 5 years ago

Hey nibi79,

I did try to use you plugin but eventually had to figure out that with my Reolink cameras the PTZ functionality is not working. Doing some debugging on the surveillance station API with Postman I figured out, that at least my cameras won't work with the API Version '1' and will need to have the moveType query parameter.

I saw that you already mentioned this in your source code, so I took the liberty to patch the sources to also accept the continuous motion parameter for PTZ, adding START/<COMMAND>, STOP\<COMMAND> commands.

Unfortunately I was not able to build the binding for testing - I could not figure out how make it work even in an openhab environment using Eclipse. (I'm not a java developer...)

The problem seems to be that the 2.5-SNAPSHOT artefact could not be resolved.

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] 'groupId' is missing. @ line 3, column 106
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project [unknown-group-id]:org.openhab.binding.synologysurveillancestation:2.5.0-SNAPSHOT (/Users/mschmieder/git/github/synologysurveillancestation/pom.xml) has 1 error
[ERROR]     'groupId' is missing. @ line 3, column 106
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

If you can tell me how to setup the project correctly so I can test the binding - I'll gladly do so

Best, Matthias

Pavion commented 5 years ago

Last time OH changed its IDE setup, I wasn't able to run it either. So I can't give you any advice today. I must take some time for clean reinstall, reintegration, fixing POMs etc. myself. It would be nice if you could check it yourself. I'm no big fan of maven, pom and such and have to spend hours after each OH release tuning those :(

mschmieder commented 5 years ago

@Pavion I did refactor the pom.xml file and adapted it the the current openhab2 bindings. I also added some static-code-analysis and fixed some of the warnings.

The binding builds successfully by errors out with a nullptr exception at least within my current openhab 2.5.0.M2 installation. I was not yet able to look into how to debug it - since the pom file is now working again, would you be able to help out?

Best

Pavion commented 5 years ago

I'm still trying to setup my IDE (it already took about 4 hours). After that I'll try to retrace your refactoring and then your pull request. Where do you need help? If you have it all done, you should be able to run your fork?

Pavion commented 5 years ago

I've managed to get the binding compiled - thanks for your help! - but I still unable to run the IDE environment at all :( And there are still tons of warnings to be fixed. Gonna get some sleep and try again later.

mschmieder commented 5 years ago

I was able to setup the IDE environment for Eclipse using the following approach. https://community.openhab.org/t/solved-add-openhab-to-existing-eclipse-setup/44070

I was not yet able to debug into it though, but did not find a lot of time to figure it out on how to do it...

Maybe this helps you somehow...

Pavion commented 5 years ago

Thanks for the info! I'm still on it and trying to get help from OH gurus from forum. If you're sure your code is OK, you can just compile your fork using

mvn install

in the root folder of the binding and then test the resulting JAR against clean OH setup. It should work as intended.

If you want to debug your code instead, you have to:

mschmieder commented 5 years ago

I did do that already and ended up with a jar file that I was able to integrate into OH (2.4 and 2.5M2) still I got some errors (unresolved dependencies on OH2.4 and Nullptr exceptions on OH2.5) so I think it would be good to be able to debug it for myself.

Thanks for the link. It would be great if you could give a more detailed explanation on how to integrate the plugin into the OH context - maybe even add it to the README.md. I'd be happy to test it out and add the necessary documentation...

mschmieder commented 5 years ago

I did add some docs that consolidate all the information we have at this point. Furthermore I took the liberty to add

https://travis-ci.org/mschmieder/synologysurveillancestation

Pavion commented 5 years ago

I've got it running. That was the solution: https://github.com/openhab/openhab-distro/issues/927#issuecomment-527541722

mschmieder commented 5 years ago

How do you like to merge these two changes - do you have a branch that I can re-integrate, or will you do the integration work?

Pavion commented 5 years ago

As for integration: I haven't got time to review or test your changes yet and I'd like to. Just don't have time nowadays :( Also don't know much about those flashy GitHub features like merging 😄

mschmieder commented 5 years ago

Seems like we are both learning something :) I added all your changes. The build seems to succeed on the CI as well.

Pavion commented 5 years ago

If you're willing to participate here, you're welcome. In this case, I'll try to review this fast so you can branch and work on other things. Be warned: this project is being kept low as we don't have much time to participate.

If it's just this feature you've wanted all the time and nothing more, then I'll review your code and release a new version eventually.

Your decision :)

mschmieder commented 5 years ago

If you're willing to participate here, you're welcome. In this case, I'll try to review this fast so you can branch and work on other things. Be warned: this project is being kept low as we don't have much time to participate.

If it's just this feature you've wanted all the time and nothing more, then I'll review your code and release a new version eventually.

Your decision :)

This is at least for now what I'm looking for - since I'm not done with the setup yet I don't know if there is more coming up. I'd love to support if I can. But for now it would be great to have this plugin up and running as it is...

Pavion commented 5 years ago

Thanks for replying, I'll gladly help where I can. Have to go to work first though :) Till evening!

Pavion commented 5 years ago

Hi and sorry for not responding for a long time. I've merged your PR into a new branch: https://github.com/nibi79/synologysurveillancestation/tree/move-pr-branch I could not retrace your POM changes so I've reverted and reworked it, changing to new project structure. Please check the newest release here: https://github.com/nibi79/synologysurveillancestation/releases/tag/2.5.0.201909280734 and confirm your zoom changes are working. Thanks! Pav