diff --git a/README.md b/README.md index b1015ae1000ee893334783b1aac116ceb0686459..25a1654a70b49ec1ef1a1e0ef042aada16e9554e 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,12 @@ ESP32 firmware for the IMC, based on Arduino and the `ESP32-Ethernet-Kit_A_V1.2` This project depends on [`Arduino_SNMP`](https://github.com/patricklaf/SNMP). +### Quirks + +Despite communication being over Ethernet, the project makes use of the ESP32 Wifi stack, hence some +references to Wifi here and there (eg. `WiFiUdp`). + + ### Installation Either use the Arduino IDE and use its library manager to find the SNMP library, or use `arduino-cli`: diff --git a/icbm.ino b/icbm.ino index d959ec3e1bfc480c4bee7db2a27774ef7a2dee40..994f17bb2a8ccf118230255a3274b062792b76bf 100644 --- a/icbm.ino +++ b/icbm.ino @@ -1,8 +1,8 @@ -#include <EthernetUdp.h> +#include <WiFiUdp.h> #include <SNMP.h> #include "esp32_ethernet.hpp" -EthernetUDP udp; +WiFiUDP udp; SNMP::Manager snmp; // Use some SNMP classes @@ -238,9 +238,9 @@ void setup() { // Start start = millis(); // MPOD - //SNMP::Message *message = mpod.setup(); - //snmp.send(message, IPAddress(10, 42, 0, 3), SNMP::PORT::SNMP); - //delete message; + SNMP::Message *message = mpod.setup(); + snmp.send(message, IPAddress(10, 42, 0, 1), SNMP::PORT::SNMP); + delete message; } enum { @@ -269,7 +269,7 @@ void loop() { // If ON or OFF, send SETREQUEST to MPOD SNMP::Message *message = mpod.output(output == ON); Serial.print("Sending message "); - snmp.send(message, IPAddress(10, 42, 0, 3), SNMP::PORT::SNMP); + snmp.send(message, IPAddress(10, 42, 0, 1), SNMP::PORT::SNMP); Serial.println("Sent"); delete message; } @@ -279,7 +279,7 @@ void loop() { start = millis(); // Create message to query MPOD and send it SNMP::Message* message = mpod.read(); - snmp.send(message, IPAddress(10, 42, 0, 3), SNMP::PORT::SNMP); + snmp.send(message, IPAddress(10, 42, 0, 1), SNMP::PORT::SNMP); delete message; } }