DHCP no response to Discover for some MAC's

jjulicher
Posts: 5
Joined: Fri Aug 30, 2019 7:05 pm

DHCP no response to Discover for some MAC's

Postby jjulicher » Fri Aug 30, 2019 7:32 pm

I have 6 DevKIT1's and as part of some quick/dirty testing I am using the Arduino environment in PlatformIO.
PlatformIO framework is:
{
"name": "framework-arduinoespressif32",
"description": "Arduino Wiring-based Framework (ESP32 Core)",
"version": "2.10002.190628",
"url": "https://github.com/espressif/arduino-esp32"
}

I am seeing an issue where depending upon the MAC address, a board will get an offer or it never gets an offer. If an offer is sent, the system works correctly and I have full IP connectivity. However, without an offer, the DHCP process is stalled.

By simply changing the MAC address on a failing unit to the MAC address of a good unit, the system works.

I don't have extensive testing on multiple DHCP servers and I don't know the pedigree of the current DHCP server as this is a coorporate environment on an existing test network.

Code: Select all

#include <Arduino.h>
#include "WiFi.h"
#include "ntpclient.h"

#include <esp_wifi.h>
#include "wifi_credentials.h"

const uint8_t m1_mac[] = {0xB4,0xE6,0x2D,0xFB,0x02,0x21};      // works.  Taken from ESP32
const uint8_t m2_mac[] = {0xB4,0xE6,0x2D,0xFB,0x02,0x21};      // fails.  Taken from ESP32
const uint8_t n2_mac[] = {0xA4,0xCF,0x12,0x0B,0x1C,0xBC};      // fails.  Taken from ESP32
const uint8_t m3_mac[] = {0xA4,0xCF,0x12,0x0A,0x81,0x20};      // fails.  Taken from ESP32
const uint8_t n4_mac[] = {0x3C,0x71,0xBF,0x64,0x30,0x0C};      // Fails.  Taken from ESP32
const uint8_t lsr_mac[] = {0x00,0x25,0xCA,0x03,0x0B,0x08};     // works.  Taken from LSR TIWI-C device

const uint8_t *original_mac = n4_mac;

void setup() {

  Serial.begin(115200);

  WiFi.disconnect(true);
  WiFi.mode(WIFI_STA);

  Serial.print("Default MAC = : "); Serial.print(WiFi.macAddress());
  esp_wifi_set_mac(ESP_IF_WIFI_STA, lsr_mac); // esp32 code
  Serial.print(" | NEW MAC = : "); Serial.print(WiFi.macAddress());

  WiFi.begin(network_name,network_pswd);
  delay(5000);
  if(WL_CONNECTED == WiFi.status())
  {
    Serial.print(" | IP Address : ");
    Serial.println(WiFi.localIP());
  }
  else
  {
    Serial.println(" | No Connection");
  }
  
}

void loop()
{
  delay(500);
}
Any suggestions?
I do not know of any other devices failing to connect on this network but I will be looking into the DHCP configuration for the network.
If you are on the wrong road... It is never too late to turn back. <Persian Proverb>

Who is online

Users browsing this forum: No registered users and 49 guests