Allow2010

_FB_Tools - manage your FritzBox from Autoit

40 posts in this topic

#1 ·  Posted (edited)

_FB_Tools

The German company AVM (http://en.avm.de/) sells a router with many extra functions. This router is called FritzBox and comes in different models.

Some models have more features than others, but all have a web-interface to control the features. _FB_Tools allows to control this web-interface by reading settings from the generated webpages and settings functions based on those settings. But as the web-interface changes from model to model and from firmware version to firmware version _FB_Tools needs to be constantly modified to work with the latest firmware.

Currently I only use the FritzBox model 7490 http://en.avm.de/products/fritzbox/fritzbox-7490/ and i only test with this model. Other models may or may not work out of the box, but if a functions does not work, it is in most cases easy to modify the code to read and send commands for your model.

 _FB_Tools can help with home automation tasks, like switching WLAN, GuestWLAN, or GuestLAN functions, or DECT (wireless phones) functions.

You can also dial numbers or work with phone-books, change settings of an answering machine or upload audio files to it.

The ZIP also includes a simple test and demo tool.

gui.jpg

_FB_Tools_old.zip

_FB_Tools_1.636-31656.zip

Edited by Allow2010
1 person likes this

Share this post


Link to post
Share on other sites



Probably only users from Germany and around will know the Fritz.Box made by AVM.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

i am still wondering: almost 230 downloads and still no reply...is it tooo easy or too complicated?

Anyone interested in an update?

Share this post


Link to post
Share on other sites

added version 1.2 with support for new fritzOS 5.50 (yet untested as i do not yet have a box running in 5.50)

Share this post


Link to post
Share on other sites

@Allow2010

Thank you, great work.

Downloaded it, made a litte change to the example script (toggle answering machine on / off).

But there is an error: nowriteaccess

What can I do? (Fritz!Box 7390, FRITZ!OS 05.50, IP 192.168.1.1)

LeMayne

_FB_Tools.ini:

[box]

password = "xxx"

use_lua_login=2

localfritzbox_ip_or_name = "192.168.1.1"

Logfile:

08.01.2013-10:55:49: Init OK

08.01.2013-10:55:49: This is a LUA page: /login_sid.lua?sid=0000000000000000

08.01.2013-10:55:49: 1 fields found, adding query to request

08.01.2013-10:55:49: Query was built: sid=0000000000000000

08.01.2013-10:55:49: Challenge found: 1492a178

08.01.2013-10:55:49: Response calculated: 1492a178-9fd18e0619cefc6e580bf1ef2a4acf39

08.01.2013-10:55:49: This is a LUA page: /login_sid.lua?sid=0000000000000000

08.01.2013-10:55:49: 2 fields found, adding query to request

08.01.2013-10:55:49: Query was built: login:command/response=1492a178-9fd18e0619cefc6e580bf1ef2a4acf39&response=1492a178-9fd18e0619cefc6e580bf1ef2a4acf39

08.01.2013-10:55:50: Error: Login failed - no writeaccess

08.01.2013-10:55:50: Login with LUA page failed - now we try HTML login

08.01.2013-10:55:50: This is a FORM page: /cgi-bin/webcm

08.01.2013-10:55:50: 2 fields found, adding query to request

08.01.2013-10:55:50: Query was built: getpage=../html/login_sid.xml&sid=0000000000000000

08.01.2013-10:55:50: Error: SessionInfo was not found

08.01.2013-10:55:50: Challenge found: Challenge

08.01.2013-10:55:50: Response calculated: Challenge-489325baa2ab726b8274472007be3159

08.01.2013-10:55:50: This is a FORM page: /cgi-bin/webcm

08.01.2013-10:55:50: 3 fields found, adding query to request

08.01.2013-10:55:50: Query was built: getpage=../html/login_sid.xml&login:command/response=Challenge-489325baa2ab726b8274472007be3159&response=Challenge-489325baa2ab726b8274472007be3159

08.01.2013-10:55:50: Error: SessionInfo was not found

08.01.2013-10:55:50: Error: Login failed - no writeaccess

08.01.2013-10:55:50: Login failed

Share this post


Link to post
Share on other sites

sorry, as mentioned it is untested with current Firmware...as soon as i can find the time i will try to get a FB with latest FW

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Version 1.3

- fixed new login functions for Fritz OS 5.50 and above
    - synced with changes in the php version
    - seperated post and get functions to be more like the php version (easier to maintain)
    - modified a lot of functions to work with older and newer FritzOS versions
    - split in two includes, one for the basics (valid for all devices) and on for specific funktions
    - updated to new winhttp udf 1.6.2.8
    - a lot of small changes and corrections
    - Important: the API works fine with FritzOS 5.50 and older versions (5.20, 5.22, end even older version without LUA login), but not all tools are updates to work with 5.50
 

Edited by Allow2010

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

just tested and it also works fine with lates labor FRITZ!OS 05.55-25188 BETA

Edited by Allow2010

Share this post


Link to post
Share on other sites

Version 1.4 added

in future i will only support latest version of FritzOS and all functions for old versions will be removed.

If you need to control a Box with old FritzOS, you need to use older _FB_Tools version, or you need to edit current version to fit your needs.

Note: Diversity functions does not yet work with latest FritzOS

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

removed

Edited by Allow2010

Share this post


Link to post
Share on other sites

    1.5 17.05.2013
    - code cleanup
    - bugfixes
    - https now works with Windows 8
    - you can now use the https certificate of your fritzbox to make communication over the Internet more secure
    - new function _FB_SetBoxname
    - new function _FB_UnBlacklist
    - enhanced _FB_Blacklist
    - _FB_SetDiversity still not working with lates FOS 5.50 (easy, just time consuming)
    - new function _FB_BoxReady

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Suggestion: Rename _FB_BoxReady to _FB_Ready.

Edited by CFIHS

Share this post


Link to post
Share on other sites

CFIHS,

Could you please make your posts a little less cryptic. For example, is the one above a suggestion, a requirement or what? ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

@CFIHS

Ahh i see, thank you...but some more text would have been helpful.-)

Edited by Allow2010

Share this post


Link to post
Share on other sites

added this (yet untestet and not yet on the files in post 1)

;ping the box to see if we can contact it
Func _FB_BoxReady()
    Return _FB_Ready()
EndFunc   ;==>_FB_BoxReady

Func _FB_Ready()
    $result = Ping($fritzbox_ip_or_name)
    If @error Then
        Return 0
    Else
        Return 1
    EndIf
EndFunc   ;==>_FB_BoxReady

Func _FB_GetFWVersion()
    $aSS = StringSplit(_WinHttpSimpleRequest($hConnect, "GET", "/cgi-bin/system_status"), "-")
    $sFirmwareversion = StringTrimLeft($aSS[8], 2)
    Return $sFirmwareversion
EndFunc


Func _FB_IsLUA ()
    $sFirmwareversion= _FB_GetFWVersion()
    If $sFirmwareversion > 0522 Then
        Return 1 
    Else
        Return 0
    EndIf 
EndFunc   ;==>_FB_IsLUA

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

Hello,

its a very nice script. Thanks alot.

Is there a possibility to change the settings of port forwarding? I want to add some ports and sometimes I want to edit some entries. How can I do this?

I think you can use md5 crypted passwords in the ini file. So you make the script secure.

Can you fix it in a newer version?

Can you also add a list with all tested boxes? I'm using fritzbox 7312 with FRITZ!OS 05.51 and firmware-version: 117.05.51  . The standard example-script runs successfully on this box.

Edited by reeky

Share this post


Link to post
Share on other sites

Hello...very interesting!

Thanks a lot!

I tried to get the current connected devices on my Fritz Box (6360): sth. like:  net/network_user_devices.lua

Can you help me?

Thanks a lot

Reinhold

Share this post


Link to post
Share on other sites

I love your script!

Do you have an idea how to get the support information file?

The GUI way would be to call

http://fritz.box/support.lua

and then hit the button to create that info file.

It takes some time to download but in there is all the information I would need to get the information of my boxes.

I tried to understand your libraries, but did not succeed  :wacko:

Any help would be great. THANKS

Sputnik089

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now