SNMP over WiFI and Ethernet Arduino_SNMP.h

Hi,

I have this SNMP working over WiFi.
https://github.com/fusionps/Arduino_SNMP/blob/master/examples/SNMP_TRAP/SNMP_TRAP.ino

My question is can this be easily converted to work over Ethernet?

Does anyone have any ideas or code to share?

I have a WIZ 5500 board connected like this:

I added the WIZ code:
////********************************************************************************
void WizReset() {
Serial.println("Starting Wiz W5500 Ethernet...");
pinMode(RESET_P, OUTPUT);
digitalWrite(RESET_P, HIGH);
delay(250);
digitalWrite(RESET_P, LOW);
delay(50);
digitalWrite(RESET_P, HIGH);
delay(350);
}

////*******************************************************************************

////*****************************************************************************
WizReset();

/*

  • Network configuration - all except the MAC are optional.
  • IMPORTANT NOTE - The mass-produced W5500 boards do -not-
  • have a built-in MAC address (depite
  • comments to the contrary elsewhere). You
  • -must- supply a MAC address here.
    */

Ethernet.begin(eth_MAC, eth_IP, eth_DNS, eth_GW, eth_MASK);
delay(200);

Serial.print("Ethernet IP is: ");
Serial.println(eth_IP);
Serial.print("Ethernet local IP is: ");
Serial.println(Ethernet.localIP());
////************************************************************************************

And tried changing this with no luck so far.

WiFiUDP udp; TO ethernetUDP udp;

Thanks

Because SNMP seems to run on top of UDP which runs on IP, I would suspect this could be done.

Did you try to get a very simple example ported first?

I found a few pages you might find useful.

looks like your type is wrong

EthernetUDP Udp;

The warning about the MAC address in your snipped seems serious. Make sure you provide one, otherwise you cannot connect to a network. The reference page example code has one setup. Remember this is made up. You are suposed to have one assigned to you. You can recycle one from an old network card. :slight_smile: