Webread does not work anymore, but urlread still does.

8 views (last 30 days)
I have a small LAN setup, where my computer and the device I want to control is connected to an unmanaged switch and I use static IP addresses. I want to control the device via API and it already worked with a slightly different setup. There I had a router connected to the Internet and to my device and my Laptop was controlling the device over a WLAN connection. Here I also used DHCP.
Now I have established a connection with my device and I can read the data from the API with my browser and with urlread(), but the same url does not work with webread(). There always comes "Error using webread (line 122) Could not access server. URL".
My code:
webread(url)
After that did not work I thought it could be a problem with the certificate, because I have none. So I tried:
options = weboptions('CertificateFilename','');
webread(url, options)
However, this didn't do the trick either, so now I have no idea what to do next.
If someone could help me please it would be greatly appreciated!

Accepted Answer

Victoria Fill
Victoria Fill on 15 Oct 2021
I have found my problem. Apparently webread/-write cannot deal with IP addresses where a 0 is the first digit such as: 192.168.01.xxx
I changed it to 192.168.1.xxx and it worked like a charm.
Does anyone know why this is only the case with webread and not with urlread?

More Answers (0)

Categories

Find more on Manage Products in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!