ESP32-PoE Ethernet automatically disconnects & connects again but not reachable

Started by des, December 07, 2018, 06:57:04 PM

Previous topic - Next topic

des

I programmed the ESP32-PoE board to obtain static IP via Arduino Sketch and to send sensor information to a central point.

The node is powered by PoE and the Ethernet module connects and disconnects on it own. How is that possible?

Output

ETH Disconnected
ETH Disconnected
ETH MAC: 24:0A:C4:9E:EA:63, IPv4: 192.168.3.120, FULL_DUPLEX, 100Mbps
ETH MAC: 24:0A:C4:9E:EA:63, IPv4: 192.168.3.120, FULL_DUPLEX, 100Mbps
ETH MAC: 24:0A:C4:9E:EA:63, IPv4: 192.168.3.120, FULL_DUPLEX, 100Mbps
ETH MAC: 24:0A:C4:9E:EA:63, IPv4: 192.168.3.120, FULL_DUPLEX, 100Mbps
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.13,laY=0.09,laZ=-0.02,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.13,laY=0.09,laZ=0.00,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.12,laY=0.10,laZ=0.00,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.11,laY=0.08,laZ=0.05,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.12,laY=0.10,laZ=0.05,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.12,laY=0.10,laZ=0.06,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.13,laY=0.09,laZ=0.02,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.14,laY=0.10,laZ=0.05,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.13,laY=0.07,laZ=0.11,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.05,roll=-148.76,laX=0.12,laY=0.06,laZ=0.15,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.05,roll=-148.76,laX=0.12,laY=0.06,laZ=0.11,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.05,roll=-148.76,laX=0.11,laY=0.11,laZ=0.04,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.11,laY=0.08,laZ=0.05,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.13,laY=0.13,laZ=0.05,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.11,laY=0.10,laZ=-0.02,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.11,laY=0.09,laZ=-0.03,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.11,laY=0.10,laZ=-0.03,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.10,laY=0.09,laZ=0.02,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.11,laY=0.09,laZ=0.00,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.12,laY=0.09,laZ=0.05,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.11,laY=0.05,laZ=-0.02,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.12,laY=0.10,laZ=0.06,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.11,laY=0.08,laZ=0.05,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.12,laY=0.07,laZ=0.09,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.13,laY=0.04,laZ=0.07,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.11,laY=0.06,laZ=0.10,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.18,pitch=1.05,roll=-148.76,laX=0.13,laY=0.10,laZ=0.00,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.12,laY=0.07,laZ=0.06,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.13,laY=0.12,laZ=0.07,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.09,laY=0.13,laZ=0.05,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.15,laY=0.09,laZ=0.06,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.11,laY=0.10,laZ=-0.05,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.11,laY=0.10,laZ=-0.01,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.13,laY=0.10,laZ=-0.02,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.12,laY=0.08,laZ=0.02,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.12,laY=0.06,laZ=0.02,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.13,laY=0.09,laZ=0.05,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.11,laY=0.08,laZ=0.04,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.11,laY=0.09,laZ=0.01,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.19,pitch=1.06,roll=-148.76,laX=0.14,laY=0.14,laZ=0.09,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.20,pitch=1.06,roll=-148.76,laX=0.13,laY=0.12,laZ=0.05,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.20,pitch=1.06,roll=-148.76,laX=0.13,laY=0.09,laZ=0.07,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.20,pitch=1.06,roll=-148.76,laX=0.12,laY=0.10,laZ=0.09,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.20,pitch=1.06,roll=-148.76,laX=0.12,laY=0.11,laZ=0.05,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.20,pitch=1.06,roll=-148.76,laX=0.12,laY=0.08,laZ=0.02,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.20,pitch=1.06,roll=-148.76,laX=0.14,laY=0.06,laZ=0.09,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.24,pitch=1.11,roll=-148.76,laX=0.10,laY=0.07,laZ=0.00,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.27,pitch=1.12,roll=-148.76,laX=0.13,laY=0.12,laZ=-0.02,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.30,pitch=1.14,roll=-148.76,laX=0.10,laY=0.10,laZ=0.00,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.32,pitch=1.16,roll=-148.77,laX=0.12,laY=0.08,laZ=0.02,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.35,pitch=1.18,roll=-148.77,laX=0.09,laY=0.08,laZ=-0.01,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.37,pitch=1.19,roll=-148.77,laX=0.06,laY=0.07,laZ=0.04,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.39,pitch=1.21,roll=-148.77,laX=0.07,laY=0.03,laZ=0.02,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.41,pitch=1.22,roll=-148.77,laX=0.09,laY=0.05,laZ=0.07,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.24,roll=-148.77,laX=0.08,laY=0.08,laZ=0.09,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.42,pitch=1.23,roll=-148.77,laX=0.05,laY=0.06,laZ=-0.08,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.07,laY=0.07,laZ=0.01,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.06,laY=0.07,laZ=0.16,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.09,laY=0.06,laZ=0.11,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.06,laY=0.08,laZ=0.08,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.10,laY=0.03,laZ=0.07,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.07,laY=0.06,laZ=0.03,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.07,laY=0.07,laZ=0.01,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.08,laY=0.05,laZ=0.08,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.07,laY=0.06,laZ=0.00,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.09,laY=0.08,laZ=0.00,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.06,laY=0.07,laZ=-0.01,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.06,laY=0.04,laZ=0.04,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-148.77,laX=0.08,laY=0.05,laZ=0.03,status=0.00
imu,n=UMGNODE1,plcmt=front yaw=-3.43,pitch=1.23,roll=-
ETH Disconnected
ETH Disconnected
ETH MAC: 24:0A:C4:9E:EA:63, IPv4: 192.168.3.120, FULL_DUPLEX, 100Mbps
ETH MAC: 24:0A:C4:9E:EA:63, IPv4: 192.168.3.120, FULL_DUPLEX, 100Mbps
ETH MAC: 24:0A:C4:9E:EA:63, IPv4: 192.168.3.120, FULL_DUPLEX, 100Mbps



My Code just collects information from IMU sensor and sends it out via UDP. I tried to ping the node via another machine on the same network but it is not reachabale.

Code



#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#define ETH_PHY_POWER 12
#define I2C_SDA 13
#define I2C_SCL 16


/* IP CONF for NODE */
const IPAddress node_static_ip(192, 168, 3, 120);
const IPAddress default_gateway(192, 168, 3, 250);
const IPAddress subnet_mask(255, 255, 255, 0);
const IPAddress dns_add(192, 168, 3, 250);

const IPAddress INFLUX_IP(192, 168, 3, 11);
const uint16_t INFLUX_PORT = 8089;


const String measurement_name = "imu";
const String node_name = "UMGNODE1";
const String  node_placement = "front";

void setup() {
  // put your setup code here, to run once:
  Wire.begin(I2C_SDA, I2C_SCL, 400000); // start i2c
  Serial.begin(115200);
  WiFi.onEvent(EthEvent);
 
  if(!bno.begin()) {
    Serial.println("No BNO055 Detected!");
    while(1);
  }

  if (!rtc.begin()) {
    Serial.println("No RTC Detected!");
    while(1);
  }

  // NTP Client
//  timeClient.begin();
  delay(1000);
 
  //setup BNO
  bno.setMode(Adafruit_BNO055::OPERATION_MODE_NDOF);
  bno.setExtCrystalUse(true);

  delay(1000);
  // RTC Interrupt setting
  pinMode(SQW_PIN, INPUT_PULLUP);
  rtc.writeSqwPinMode(DS3231_SquareWave1Hz);
  attachInterrupt(digitalPinToInterrupt(SQW_PIN), tick, FALLING);
  WiFi.onEvent(EthEvent);

  // Ethernet Enable with static IP Configuration
  ETH.begin();
  ETH.config(node_static_ip, default_gateway, subnet_mask, dns_add);
  delay(1000);
  restoreCalibOffsets();
}

void loop() {
  // put your main code here, to run repeatedly:

  if (eth_connected) {
    quat = bno.getQuat();
    quat.normalize();
    euler = quat.toEuler();
    euler.toDegrees();
    li_ac = bno.getVector(Adafruit_BNO055::VECTOR_LINEARACCEL);

    influxMeasurement row(measurement_name);
    row.addTag("n", node_name);
    row.addTag("plcmt", node_placement);
    if (!isnan(euler[1]) || euler[0] != 0.00 || euler[2] != 0.00) {
        row.addField("yaw", euler.y());
        row.addField("pitch", euler.z());
        row.addField("roll", euler.x());
    }
    row.addField("laX", li_ac.x());
    row.addField("laY", li_ac.y());
    row.addField("laZ", li_ac.z());
    row.addField("status", 0);
//    row.addTimeStamp_ms(millis_since_epoch());
     Serial.println(row.postString()); // DEBUG Serial Print the Line Protocol
    db.udpWrite(INFLUX_IP, INFLUX_PORT, row);
    delay(100);
  }

}

JohnS

Are you asking why does the Arduino code do that?

If so, this forum may not be the best place to ask as I suspect no-one here wrote the code.

John

LubOlimex

Technical support and documentation manager at Olimex