Package: pynetgear-enhanced
pyNetgear_EnhancedpyNetgear_Enhanced provides an easy to use Python API to control your Netgear router. It uses the SOAP-api on modern Netgear routers to communicate. It is built by reverse engineering the requests made by theNETGEAR Genie app.pyNetgear_Enhanced works with Python 3.If you are connected to the network of the Netgear router, a host is optional.
If you are connected via a wired connection to the Netgear router, a password is optional.
The username defaults to admin.
The port defaults to 5000.
The ssl defaults to false.
You can specify url and it will take precedence on host/port/ssl parameters.
This allows the use of HTTPS,https://orbilogin.comfor example.Thanks to:MatMaulfor the original code.gruijterfor additional SOAP endpoints.It currently supports the following operations:loginLogs in to the router. Will return True or False to indicate success.allow_block_deviceAllows user to block/unblock devices from accessing router by specifying mac_addr and new device_status (Block/Allow)Note:In order to use this function, Remote Managementmustbe enabled in the router's admin settings.SERVICE_DEVICE_CONFIG:rebootReboot device.check_new_firmwareReturn a dict containing the Firmware info.set_block_device_enableEnable/Disable Access Control.get_block_device_enable_statusReturn a dict containing the Status of Access Control.get_traffic_meter_statisticsReturn a dict containing the traffic meter information from the router (if enabled in the webinterface).enable_traffic_meterEnable/Disable Traffic Meter.get_traffic_meter_enabledReturn a dict containing the Status of Traffic Meter.get_traffic_meter_optionsReturn a dict containing the Traffic Meter Options.SERVICE_PARENTAL_CONTROL:enable_parental_controlEnable/Disable Parental Control.get_parental_control_enable_statusReturn a dict containing the Status of Parental Control.get_all_mac_addressesReturn a dict containing the MAC Addresses.get_dns_masq_device_idReturn a dict containing the DNS Masq device IDs.SERVICE_DEVICE_INFO:get_infoReturn a dict containing the Router Information.get_support_feature_list_XMLReturn a dict containing the Supported Features.get_attached_devicesReturns a list of named tuples describing the device signal, ip, name, mac, type, link_rate and allow_or_block.get_attached_devices_2Returns a list of named tuples describing the device signal, ip, name, mac, type, link_rate, allow_or_block, device_type, device_model, ssid and conn_ap_mac.This call is slower and probably heavier on the router load.SERVICE_ADVANCED_QOS:set_speed_test_startStarts the Speed Test.get_speed_test_resultReturn a dict containing the Speed Test Results.You will have to wait several seconds following starting the speed test to get the final results.set_qos_enable_statusEnable/Disable QOS.get_qos_enable_statusReturn a dict containing the Status of QOS.get_bandwidth_control_optionsReturn a dict containing the Bandwidth Control Options.SERVICE_WLAN_CONFIGURATION:set_guest_access_enabledEnable/Disable 2.4g Guest WiFi.get_guest_access_enabledReturn a dict containing the Status of 2.4g Guest Wifi.set_guest_access_enabled_2Enable/Disable 2.4g Guest WiFi 2.set_5g_guest_access_enabledEnable/Disable 5g Guest Wifi.get_5g_guest_access_enabledReturn a dict containing the Status of 5g Guest Wifi.get_wpa_security_keysReturn a dict containing the 2.4g WPA Key.get_5g_wpa_security_keysReturn a dict containing the 5g WPA Key.get_2g_infoReturn a dict containing the 2.4g Info.get_5g_infoReturn a dict containing the 5g Info.get_guest_access_network_infoReturn a dict containing the 2.4g Guest Network Info.get_5g_guest_access_network_infoReturn a dict containing the 5g Guest Network Info.InstallationYou can install pyNetgear_Enhanced from PyPi using:pip3 install pynetgear_enhanced.UsageFor a list of commands run from the console:$ python3 -m pynetgear_enhanced -hFor testing append a -t to the command from the console.$ python3 -m pynetgear_enhanced -p='MyEscapedPassword!' --check_fw -tTo use within your Python scripts:frompynetgearimportNetgearnetgear=Netgear(password=mypassword)foriinnetgear.get_attached_devices():printiSupported routersIt has been tested with the Netgear RAX80 router. Previous testing was done with the R6300 and WNDR4500 routers prior to the addition of the advanced options. According to the NETGEAR Genie app description, the following routers should also work:Netgear RAX80Netgear OrbiNetgear R7800Netgear R7500v2Netgear R7000Netgear R6900Netgear R6300Netgear R6250Netgear R6200Netgear R6100Netgear N300 - Model: C3000 (Port 80)Netgear Centria (WNDR4700, WND4720)Netgear WNDR4500Netgear WNDR4300Netgear WNDR4000Netgear WNDR3800Netgear WNDR3700v3Netgear WNDR3700v2Netgear WNDR3400v2Netgear WNR3500Lv2Netgear WNR2200Netgear WNR2000v3Netgear WNR2000v4 (Port 80)Netgear WNR1500Netgear WNR1000v2Netgear WNR1000v3Netgear WNDRMACNetgear WNR612v2