Closed matthes0815 closed 8 years ago
Hi Matthias,
I am not sure what causes this. Can you execute this on the command line (with or without user name depending on whether you have a user name setup) and post the contents of api.log
here? Replace PASSWORD
with the password you use to access your FRITZ!Box.
python -c "import fritzconnection as fc; fc.print_api(password='PASSWORD')" > api.log
python -c "import fritzconnection as fc; fc.print_api(password='PASSWORD',user='USER')" > api.log
Best regards Joseph
Hey Joseph,
thank you for your answer. I'm using a 7490 with Fritz!OS 6.60. api.log attached as api.txt api.txt
Regards Matthias
This is exactly the same model, OS version and API as I have, which is bad, because I can not reproduce your error. Do you have any entries in your phonebook? Do you get this error if you execute the python script directly (in the MMM-FRITZ-Box-Callmonitor
folder)?
python fritz_access.py -p PASSWORD -u USER
If so, can you add a print result
after line 22 of the script and see what the output looks like?
Yes, there are about 30 entries in the phonebook. Executing the script directly leads to the same error, the print returns
{}
followed by the error message
Traceback (most recent call last): File "fritz_access.py", line 75, in <module> main(args) File "fritz_access.py", line 61, in main handle.download_phone_book() File "fritz_access.py", line 24, in download_phone_book for phonebook_id in result["NewPhonebookList"]: KeyError: 'NewPhonebookList'
I have been able to reach the error you describe, if I use a user without the rights to access the Phonebooks. Does this fit your case? Please make sure your user has the right to access FRITZ!Box settings.
German screenshot below:
oh damn... I checked the box but unchecked "Smart Home" and didn't notice that this removes the tick from the first box as well. I'm sorry for wasting your time! Thanks for your help!
No problem, glad it works now!
Hey,
I just installed your module and it doesn't work, it displays "unknown error". These are the logged lines:
MMM-FRITZ-Box-Callmonitor error while accessing FRITZ!Box: Traceback (most recent call last): File "/home/pi/MagicMirror/modules/MMM-FRITZ-Box-Callmonitor/fritz_access.py", line 74, in
main(args)
File "/home/pi/MagicMirror/modules/MMM-FRITZ-Box-Callmonitor/fritz_access.py", line 60, in main
handle.download_phone_book()
File "/home/pi/MagicMirror/modules/MMM-FRITZ-Box-Callmonitor/fritz_access.py", line 23, in download_phone_book
for phonebook_id in result["NewPhonebookList"]:
KeyError: 'NewPhonebookList'
Regards Matthias