Can't get WiFi Web Server example to work

I'm trying to run the WiFi Web Server example from here:

https://docs.arduino.cc/tutorials/giga-r1-wifi/giga-wifi#web-server

It gets as far as printing:

Attempting to connect to SSID: Manticore
SSID: Manticore
IP Address: 10.0.1.16
signal strength (RSSI):-52 dBm

However, the call:

WiFiClient client = server.available();

always returns zero, so the second part of the example doesn't work. Any suggestions?

PS I'm using core 4.0.2 on Arduino IDE 1.8 19 on MacOS.

Hello, I tried this example and was able to get updates. Can you share the steps you did and screenshots?

Using core 4.0.2 and IDE 2.1.0 on MacOS

Thank you for checking. I'll try it again and give details.

I get the same result as before. It never prints new client.

Menu options:

Program is exactly as in the example, except that I've put my SSID and password as strings in the program.

There were quite a few compiler warnings. Last few lines of the output:

Linking everything together...
/Users/david/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -E -P -x c -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 /Users/david/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.0.2/variants/GIGA/linker_script.ld -o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/linker_script.ld
/Users/david/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -L/var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593 -Wl,--gc-sections -Wl,--as-needed -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 @/Users/david/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.0.2/variants/GIGA/ldflags.txt -T/var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/linker_script.ld -Wl,-Map,/var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/GIGAWiFiWebServer.ino.map --specs=nosys.specs -o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/GIGAWiFiWebServer.ino.elf /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/sketch/GIGAWiFiWebServer.ino.cpp.o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/libraries/SPI/SPI.cpp.o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/libraries/WiFi/WiFi.cpp.o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/libraries/WiFi/WiFiServer.cpp.o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/libraries/SocketWrapper/MbedClient.cpp.o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/libraries/SocketWrapper/MbedSSLClient.cpp.o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/libraries/SocketWrapper/MbedServer.cpp.o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/libraries/SocketWrapper/MbedUdp.cpp.o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/libraries/SocketWrapper/SocketHelpers.cpp.o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/libraries/SocketWrapper/utility/http_parser/http_parser.c.o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/core/pure_analog_pins.cpp.o /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/core/variant.cpp.o -Wl,--whole-archive /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/core/core.a /Users/david/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.0.2/variants/GIGA/libs/libmbed.a -Wl,--no-whole-archive -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group
/Users/david/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-objcopy -O binary /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/GIGAWiFiWebServer.ino.elf /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/GIGAWiFiWebServer.ino.bin
/Users/david/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-objcopy -O ihex -R .eeprom /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/GIGAWiFiWebServer.ino.elf /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/GIGAWiFiWebServer.ino.hex
Multiple libraries were found for "WiFi.h"
 Used: /Users/david/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.0.2/libraries/WiFi
 Not used: /Users/david/Documents/Arduino/libraries/WiFiNINA
 Not used: /Applications/Arduino.app/Contents/Java/libraries/WiFi
Using library SPI in folder: /Users/david/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.0.2/libraries/SPI (legacy)
Using library WiFi at version 1.0 in folder: /Users/david/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.0.2/libraries/WiFi 
Using library SocketWrapper at version 1.0 in folder: /Users/david/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.0.2/libraries/SocketWrapper 
/Users/david/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-size -A /var/folders/fd/7rbn3jxx5j942sk5kn0vhb740000gn/T/arduino_build_914593/GIGAWiFiWebServer.ino.elf
Sketch uses 269436 bytes (13%) of program storage space. Maximum is 1966080 bytes.
Global variables use 63792 bytes (12%) of dynamic memory, leaving 459832 bytes for local variables. Maximum is 523624 bytes.

What happens when you go to the above IP address? And the results in the serial monitor when you open this IP?

When I connect to http://10.0.1.16 from a web browser the Serial Monitor prints the following lines repeatedly:

client disconnected
new client
GET /favicon.ico HTTP/1.1
Host: 10.0.1.16
Connection: keep-alive
Accept: */*
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15
Accept-Language: en-gb
Referer: http://10.0.1.16/
Accept-Encoding: gzip, deflate

OK, I assume I was supposed to do that - sorry!

1 Like

To make it clearer what you have to do perhaps add lines such as:

  // print where to go in a browser:
  Serial.print("To see this page in action, open a browser to http://");
  Serial.println(ip);

like you've got in the Web Server AP Mode example later on.

1 Like