kbr / fritzconnection

Python-Tool to communicate with the AVM Fritz!Box by the TR-064 protocol and the AHA-HTTP-Interface
MIT License
304 stars 59 forks source link

Fritzconnection and continuous poll #31

Closed lmarceg closed 4 years ago

lmarceg commented 4 years ago

Hi I will soon buy a FritzBox and I would like to use it to detect home presence. To do so, I would like to use fritzconnection and polling the router every 30 seconds. Most probably, rather than running the fritzconnection.py every 30s, I think I'd better establish the connection with the router just once and do the poll every 30s with a python program: am I correct? I wonder if this continuous 24/7 polling would kill the router or if this is a perfectly safe procedure I can use. Any experience about that? Thanks for your suggestion!

da-dindi commented 4 years ago

Hi I am actually doing this for some time now. My polling time is 45 seconds and I am not experiencing any issues (with my FritzBox 7590). My script starts and stops motion detection depending on devices found on the network. Sounds like what you're about to do. Perhaps my script is a good starting point for you. You can find it here: https://github.com/ccrisan/motioneye/issues/1479

Would like to see your script when it is ready.

kbr commented 4 years ago

Instantiating FritzConnection cost about 20-30 request on current router models. Reusing an instance will save this overhead, doing some requests from time to time will not kill the router. Thermal overheating because of physical misplacement may be something to keep in mind. As this is more like a forum posting than an issue I close this thread. In case of a real issue please feel free to reopen again.

Firesphere commented 3 years ago

I have done a similar thing, which you can find here: https://github.com/Firesphere/motioneye-fritz-home

I took @da-dindi 's script and made it a bit more readable to me, and fully shut down MotionEye, instead of just pausing Motion. As this saves up a lot of resources.