#include <SPI.h>
#include <WiFiNINA.h>
// the IP address for the shield:
IPAddress ip(192, 168, 0, 177);
char ssid[] = "yourNetwork"; // your network SSID (name)
char pass[] = "secretPassword"; // your network password (use for WPA, or use as key for WEP)
int status = WL_IDLE_STATUS;
void setup()
{
// Initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
WiFi.config(ip);
// attempt to connect to Wifi network:
while ( status != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network. Change this line if using open or WEP network:
status = WiFi.begin(ssid, pass);
// wait 10 seconds for connection:
delay(10000);
}
// print your WiFi's IP address:
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
}
void loop () {}
The code connect to the router, but the ip is not the correct.
If you're going to do that then please be considerate enough to add links to the other places you cross posted. This will let us avoid wasting time due to duplicate effort and also help others who have the same questions and find your post to discover all the relevant information. When you post links please always use the chain links icon on the toolbar to make them clickable.
Also, I suggest you read the "Code" section of this:
and be sure to use code fencing Markdown whenever you post code in a GitHub issue report (or any other page that uses Markdown).
The ip is good for my network, i have others arduino with higher ip and work great.
Yes, i can reserve the ip in the router, but i only want reporting a bug ....
Thanks.