NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
vtburtonra
Feb 14, 2023Aspirant
access the list of attached devices via URL with json output
I have an Orbi RBR850 and two RBS850's. In combination, they provide excellent WiFi coverage to my house. The RBS's are connected back to the RBR via Ethernet. I have "a bunch" of IOT devices conn...
- Feb 16, 2023
CrimpOn wrote:I found the READ.ME less helpful than I would have wanted, especially in terms of how to enter the commands.
Plus, it spewed a bunch of warnings about "certificate verification" which did not affect the results, but annoyed me a lot.
Loaded on Linux Mint 20.3 using pip3.
Set environment variables:
PYNETGEAR_PASSWORD="<router password>"
HOST=192.168.1.1
USER="admin"
URL="192.168.1.1"
command python3 -m pynetgear_enhanced attached_devices2 >dev.txt
I got it to work, but had to do this:
python3 -m pynetgear_enhanced --url 'https://routerlogin.net' --host "192.168.1.1" --user "admin" --password "<router password>" attached_devices2 >dev.txt 2>&1
The https in the URL did the trick. It did not seem to pay attention to the PYNETGEAR_PASSWORD, HOST, USER and URL variables. I tried setting them within a bash script and also exporting them. The command worked for me on OpenSUSE, Ubuntu, Fedora, Mint, Rasbian, and Debian.
This uncovered another problem. I have an RBR850 and two RBS850s. When I log into the RBR, and go to attached devices, it only shows 1 device from one of the two RBSs, but that RBS has 10 devices attached to it. When I log into the RBS directly, and select Connected Devices, it shows all 10 devices, but the IP address field is "-" for all except 1 device, and that's the 1 device that shows up in the RBR. The pynetgear_ehnanced program shows the same, but expected given that logging directly into the RBB shows this.
The other RBS shows everything correctly, including IP addresses. All 3 are running the latest firmware (4.6.14.3).
Note that all 10 of those devices are working fine - I can ping them. Even pinging them doesn't cause the RBS to start showing their IP addresses. I'm guessing this RBS is fubar and needs a reboot. I'll do that and I'm assuming that will fix it.
I really do appreciate your help and suggestions on this.
Randy
vtburtonra
Feb 14, 2023Aspirant
Posted.
CrimpOn
Feb 14, 2023Guru - Experienced User
vtburtonra , please check your private messages. (click on the envelop in the upper right part of the screen.
- CrimpOnFeb 14, 2023Guru - Experienced User
Netgear uses the Simple Object Access Protocol (SOAP) as the communications link between the router and apps (Orbi app, Nighthawk app, etc.) https://en.wikipedia.org/wiki/SOAP . The list of routers using SOAP is extensive:
https://www.routeripaddress.com/search/netgear+router+soap+api/*/*/
In addition to the Excel spreadsheet mentioned above, there are examples on the internet which use various programming languages to access and control Netgear routers using SOAP. One for Python is pyNetgear_Enhanced
https://github.com/roblandry/pynetgear_enhanced . There's one for Go https://github.com/DRuggeri/netgear_client
Javascript; https://www.npmjs.com/package/netgear
A common complaint is that each of these projects was limited because Netgear does not publish specifications for the SOAP interface and each developer had to scrape the parameters from observing the Nighthawk or Orbi app communications.
If someone had a Fortran or C language library, I'd be all over this.
- CrimpOnFeb 14, 2023Guru - Experienced User
Python pyNetgear_Enhanced https://github.com/roblandry/pynetgear_enhanced may be exactly what you are looking for.
When run against my Orbi, it produces a complete list of all devices currently on the network with this format:
{
"name": "Family Room Speaker",
"ip": "192.168.1.22",
"mac": "48:A6:B8:D4:xx:8E",
"type": "5GHz",
"signal": 0,
"link_rate": "0",
"allow_or_block": "Allow",
"device_type": 23,
"device_model": "Sonos One",
"ssid": "MY-Orbi-SSID",
"conn_ap_mac": "3C:37:86:43:xx:1C"
}There are options for other output formats (which I did not explore).
Unlike the Excel spreadsheet, it is obvious that this implementation does not fetch signal or Link Rate correctly.
Installing this script on Windows totally beat me. (Python for Windows is not my friend!) Did get it to work on Linux Mint.
- vtburtonraFeb 15, 2023Aspirant
CrimpOn wrote:Python pyNetgear_Enhanced https://github.com/roblandry/pynetgear_enhanced
I've tried this on OpenSUSE Leap 15.4, Raspbian v10 (Buster) , Debian 11 (Bullseye), and Mint 20.3... all get the same results. The requests ultimately time out. I haven't tried it on other *nix systems (RedHat Fedora, Ubuntu, OpenSUSE Tunmbleweed, etc.) but since all 3 of these systems give the exact same results, I suspect it isn't an issue with the *nix system.
I've tried this commands:
python3 -m pynetgear_enhanced login
Watching this in Wireshare, I see the standard TCP handshake, followed by Unix sending this:
GET /soap/server_sa/HTTP/1.1 Host:routerlogin.net:5000 Use-Agent: pynetgear Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive SOAPAction: urn :NETGEAR-ROUTER: service: Test:1#test Cache-Control: no-cache Content-Type: multipart/form-data
and then the Orbi responds with a TCP ACK and then:
HTTP/1.1 404 Not Found Content-Type text/html Connection: close Content-Length 134 Server: Ubuntu/bionic UPnP/1.1 MiniUPnPd/2.2.2 Ext: <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested URL was not found on this server </BODY></HTML>
This is then followed by a TLSv1.3 handshake and session setup (SYN; SYN ACK; ACK; Client Hello; ACK; Server Hello, Change Ciper Spec; ACK;, then a few packets of data going back and forth, followed by a RST, FIN ACK, RST
This is then followed by the same SOAP requests, but instead of going to port 5000, it's going to port 80, with the same SOAP Test call, which is then followed by an HTTP 400 Bad Request.
On Unix, this is what I see:
Connection error: HTTPSConnectionPool(host='routerlogin.net', port=5000): Read timed out. (read timeout=30)
I also tried these commands:
python3 -m pynetgear_enhanced --user admin --password <mypassword> login
python3 -m pynetgear_enhanced --login-v2 --user admin --password <mypassword> login
python3 -m pynetgear_ehnanced --login-v2 login
python3 -m pynetgear_enhanced attached_devices
python3 -m pynetgear_enhanced --no-ssl --user admin --password <mypassword> attached_devices
None work.
So, no joy here on trying to get this to work. The router is an Orbi RBR850 running firmware V4.6.14.3.
Any other suggestions on how to get this working or another option?
Thank you for your help,Randy