MKR 1010 WiFi - Issues to set up a static IP address

Hi Guys,

Thanks for your time.

I succesfully set up the Arduino MKR 1010 so turn one some lights using Hombridge installed on a Raspberry Pi. Everything works fine if I let the MKR handle the connection but when I set up a static IP address Homebridge is unable to find the MRK 1010.

This is the error message that shows up in Hombridge: "HTTP set power function failed: connect EHOSTUNREACH 192.168.0.201:80".
Note: I changed the IP address in the config.json file before setting up the static IP address in the MKR so this shouldnt cause the issue

If I comment the WiFi.config line an revert the changes in the config.json file everthing works fine again.

I'll parecieate any help on this matter

#include <SPI.h>
#include <WiFiNINA.h>

#include "arduino_secrets.h"
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;    // your network password (use for WPA, or use as key for WEP)
int status = WL_IDLE_STATUS;     // the Wifi radio's status
String readString;

IPAddress ip(192,168,0,201);
IPAddress DNS(100,72,3,101); 
IPAddress gateway(192,168,0,1);    
IPAddress subnet(255,255,255,0); 

WiFiServer server(80);


void setup() {

  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  // attempt to connect to Wifi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);
    WiFi.config(ip, DNS, gateway, subnet);
    // wait 10 seconds for connection:
    delay(10000);
  }

  // you're connected now, so print out the data:
  Serial.print("You're connected to the network");
  printCurrentNet();
  printWifiData();
  server.begin();

}

What IP does the MKR device get if you don't try to force it?

Is there something else using that static address?

What range does your router give out for IPs using DHCP?

If I dont force the IP the MKR gets the IP 192.168.0.72.

No, thast the only device with that IP address.

The IP range is 192.168.0.xxx