I'm trying to run the example code for hosting a web server on an arduino nano 33 iot, the specific examples include WifiWebServer.ino and AP_SimpleWebServer.ino. I have tested up through connecting to my home network and there don't seem to be any issues there, it generates and ip and gives a rssi strength. However once it hits WiFiClient client = server.available(); it never continues past the if statement that requires a client. Looking into the docs I found the line " If no client has data available for reading client will evaluate to false." I'm unsure as to what this means or what steps to take to actually get a client with data available or precisely what that mean, If anyone could give guidance or explanation that would be greatly appreciated, Thanks.
For clarification I am using arduino ide 2.01 on ubuntu 22.04 and have the latest firmware for my arduino nano 33 iot
Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project
See About the Installation & Troubleshooting category.
You are creating a server. You need a client to connect to the server and send a request. For example, if you have a web (HTTP) server you would connect to it with a web (HTTP) client (browser) and request a page.
So when I try to go the IP address provided by the code that's the browser being a client and making a request to the server? Is there an obvious reason why that client wouldn't have data available for the arduino hosting the server to read?
Yes
The request doesn't have to include any data, other than the name of the resource it is requesting, for example "index.html"
That's the browser trying to connect to A server. The server has a port number and, by default, a web browser connects to the server on port 80. Is that the port your server is using? If not, put a ':' and the port number after the server IP address to specify the port.
Also, your Arduino's IP address is likely non-routable (192.168.x.x or 10.x.x.x). That means your browser has to be on the same LAN as your Arduino to reach it.
The server was opened on port 80 and the arduino should be connected to the same network that my browser is on, it used the same ssid and password as was used on the laptop running the browser, is there anything else I might be missing that is preventing the browser from creating a client that can access the web server? I will likely try different web browsers and ports when I can work on this again but any additional advice on where I might be running into problems is greatly appreciated, Thanks.
Did you accidentally say "https://" instead of "http://" in the URL? That would go to Port 443, I think.
So I eventually ended up figuring this out and just wanted to share in case someone else runs into this issue. I was able to connect to the wifi but not open web servers as a client because the router that i was connected(that i didnt set up personally) blocked those sort of connections, after switching to a router that allowed those connections it works fine. Another thing I've noticed is that it cant connect or see my 5ghz wifi on the new router so if you cant scan or connect to your wifi and its 5ghz that may be your issue, however this is all just what ive personally observed and im definenlty not an expert or even knowledgeable on these topics, so YMMV as my assumptions may be completely off base
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.