Hello I try to make turn off and turn on a led with a website thanks to an Arduino wifi developer edition card I connected the card to my router and configured it without problem.
on the other hand this code which is the example of the Arduino_Uno_WiFi_Dev_Ed library (the library of this board) seems to doesn't create any "webserver"
/*
File: WebServerBlink.ino
This example creates a simple web server on your Arduino Uno WiFi. It serves a
simple web page with 2 buttons that can be used to switch on and off on-board led 13.
Please type on your browser http://<IP>/arduino/webserver/ or http://<hostname>.local/arduino/webserver/
Note: works only with Arduino Uno WiFi Developer Edition.
http://www.arduino.org/learning/tutorials/boards-tutorials/webserverblink
*/
#include <Wire.h>
#include <UnoWiFiDevEd.h>
void setup() {
pinMode(4,OUTPUT);
Wifi.begin();
Wifi.println("Web Server is up");
}
void loop() {
while(Wifi.available()){
process(Wifi);
}
delay(50);
}
void process(WifiData client) {
// read the command
String command = client.readStringUntil('/');
// is "digital" command?
if (command == "webserver") {
WebServer(client);
}
if (command == "digital") {
digitalCommand(client);
}
}
void WebServer(WifiData& client) {
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.println("<html>");
client.println("<head> </head>");
client.print("<body>");
client.print("Click<input type=button onClick=\"var w=window.open('/arduino/digital/4/1','_parent');w.close();\"value='ON'>pin13 ON
");
client.print("Click<input type=button onClick=\"var w=window.open('/arduino/digital/4/0','_parent');w.close();\"value='OFF'>pin13 OFF
");
client.print("</body>");
client.println("</html>");
client.print(DELIMITER); // very important to end the communication !!!
}
void digitalCommand(WifiData& client) {
int pin, value = 0;
// Read pin number
pin = client.parseInt();
// If the next character is a '/' it means we have an URL
// with a value like: "/digital/13/1"
if (client.read() == '/') {
value = client.parseInt();
digitalWrite(pin, value);
}
// Send feedback to client
client.println("Status: 200 OK\n");
client.print(F("Pin D"));
client.print(pin);
client.print(F(" set to "));
client.print(value);
client.print(EOL); //char terminator
}
I tried with a simple code to light up the led it's actually working so ( i tried 2/3 different code to be sure ). it was one of my assumption but for me the sketch is well upload like the other
so it simply doesn't work. I tested it and it can handle the /arduino/digital/ requests but can't it return the page. I tested all 3 versions of the factory firmware. this is a work of arduino.org.
I used the Uno WiFi Dev Ed in 2017 a while with the factory firmware, buy I only sent one number to set as PWM.
Then I replaced the firmware for the WiFiLink firmware. I used that a year, then I replaced the Arduino in my project.
After the arduino.org ended, I maintain the WiFiLink firmware. It is not very good (arduino.org work too), but it works. (The other Arduino WiFi libraries including the new WiFiNina are not much better. They are all based on same code written for the old Arduino WiFi library)
Now I use the Uno WiFi Dev Ed as Uno or as esp8266, or with AT firmware to test my WiFiEspAT library.
So I am the guru for Uno WiFi Dev Ed, but I can't help you with the factory firmware.
Your options are WiFiLink firmware with WiFiLink library, or AT firmware with my WiFiEspAT library.
My library is better, but the AT firmware can run only one TCP server.
It is a great board. The only special thing about Uno WiFi Dev Ed compared to Uno with an esp8266 module wired to SoftwareSerial pins is the use of I2C Serial converter to wire the esp8266. I wrote a new driver for it, because the original worked only at 9600 baud.
Thank very much for all of your reply from what i have understand i my code doesn't work and i should use your At firmware to try your Library i started to check how to do that i think i will take several day to understand but i will try that ^^