From bfd3e7091c6a789e8420622398e4e42ad4e4a197 Mon Sep 17 00:00:00 2001 From: Cyril Danilevski <cydanil@gmail.com> Date: Thu, 8 Feb 2024 21:22:11 +0100 Subject: [PATCH] Initialize SNMP --- esp32_ethernet.cpp | 2 +- esp32_ethernet.hpp | 2 +- icbm.ino | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/esp32_ethernet.cpp b/esp32_ethernet.cpp index 396de40..251dafe 100644 --- a/esp32_ethernet.cpp +++ b/esp32_ethernet.cpp @@ -44,7 +44,7 @@ void EthernetEvent(WiFiEvent_t event) } } -void connectNetwork() +void initializeNetwork() { WiFi.onEvent(EthernetEvent); ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE); diff --git a/esp32_ethernet.hpp b/esp32_ethernet.hpp index 0f87c8a..5d6e27e 100644 --- a/esp32_ethernet.hpp +++ b/esp32_ethernet.hpp @@ -19,6 +19,6 @@ We use Ethernet, but reuse much of the networking utilities. extern bool eth_connected; void EthernetEvent(WiFiEvent_t event); -void connectNetwork(); +void initializeNetwork(); #endif diff --git a/icbm.ino b/icbm.ino index 0bda6e5..e104b73 100644 --- a/icbm.ino +++ b/icbm.ino @@ -1,16 +1,16 @@ #include "esp32_ethernet.hpp" #include "rest.hpp" -//#include "mpod.hpp" +#include "mpod.hpp" unsigned long start; extern bool eth_connected; -//extern SNMP::Manager snmp; +extern SNMP::Manager snmp; void setup() { Serial.begin(115200); - connectNetwork(); + initializeNetwork(); while (!eth_connected) { Serial.print("-"); delay(100); @@ -18,6 +18,8 @@ void setup() { initializeRoutes(); Serial.println("Started REST server"); + initializeSNMP(); + Serial.println("Started SNMP server"); start = millis(); } @@ -47,7 +49,7 @@ void serial_loop() { void loop() { // Manager loop function must be called to process incoming messages - //snmp.loop(); + snmp.loop(); restServer.handleClient(); serial_loop(); -- GitLab