1 (edited by Robin 2020-07-19 14:23:01)

Topic: Can I assign static IP address?

Is it possible to set up the wifi with a static IP address?

This is important for me as the connection is made via a range extender which changes the MAC address, making it difficult to reserve an IP address on the router.

Thank you.

Sorry for the repeated posting(s). I got error messages saying the question had not been posted. Clearly, it had!

2 (edited by Guillaume 2020-07-19 17:52:02)

Re: Can I assign static IP address?

Of course, but you should use mdns instead

3

Re: Can I assign static IP address?

Thank you, Guillaume.

Can you point me towards setting up mdns?

I am currently connecting using

#define REMOTEXY_WIFI_SSID "My_SSID"
#define REMOTEXY_WIFI_PASSWORD "My_Password"
#define REMOTEXY_SERVER_PORT 6377

Thank you.

4

Re: Can I assign static IP address?

Which board do you use ? I know how to do it only for ESP8266 and ESP32

5

Re: Can I assign static IP address?

void setup()
{
   Serial.begin(115200); // Start the serial monitor.
  delay(20); // Give it a moment.
  // Connect to WiFi network:
  Serial.println("Connect to WiFi network");
  IPAddress ip(192, 168, 0, 5);
  IPAddress gateway(192, 168, 0, 1);
  IPAddress subnet(255, 255, 255, 0);
  IPAddress dns(192, 168, 0, 1);
  WiFi.config(ip,dns,gateway,subnet);
  Serial.println("wifi Asianet_Broadband@sanoop ");
  Serial.println("ip IPAddress 192.168.0.5 ");
  WiFi.begin(REMOTEXY_WIFI_SSID, REMOTEXY_WIFI_PASSWORD);
  RemoteXY_Init ();