Skip to content
Snippets Groups Projects
Commit bfd3e709 authored by Cyril Danilevski's avatar Cyril Danilevski
Browse files

Initialize SNMP

parent 7ad88faa
1 merge request!2Initial MPOD feature
Pipeline #130951 failed
...@@ -44,7 +44,7 @@ void EthernetEvent(WiFiEvent_t event) ...@@ -44,7 +44,7 @@ void EthernetEvent(WiFiEvent_t event)
} }
} }
void connectNetwork() void initializeNetwork()
{ {
WiFi.onEvent(EthernetEvent); WiFi.onEvent(EthernetEvent);
ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE); ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE);
......
...@@ -19,6 +19,6 @@ We use Ethernet, but reuse much of the networking utilities. ...@@ -19,6 +19,6 @@ We use Ethernet, but reuse much of the networking utilities.
extern bool eth_connected; extern bool eth_connected;
void EthernetEvent(WiFiEvent_t event); void EthernetEvent(WiFiEvent_t event);
void connectNetwork(); void initializeNetwork();
#endif #endif
#include "esp32_ethernet.hpp" #include "esp32_ethernet.hpp"
#include "rest.hpp" #include "rest.hpp"
//#include "mpod.hpp" #include "mpod.hpp"
unsigned long start; unsigned long start;
extern bool eth_connected; extern bool eth_connected;
//extern SNMP::Manager snmp; extern SNMP::Manager snmp;
void setup() { void setup() {
Serial.begin(115200); Serial.begin(115200);
connectNetwork(); initializeNetwork();
while (!eth_connected) { while (!eth_connected) {
Serial.print("-"); Serial.print("-");
delay(100); delay(100);
...@@ -18,6 +18,8 @@ void setup() { ...@@ -18,6 +18,8 @@ void setup() {
initializeRoutes(); initializeRoutes();
Serial.println("Started REST server"); Serial.println("Started REST server");
initializeSNMP();
Serial.println("Started SNMP server");
start = millis(); start = millis();
} }
...@@ -47,7 +49,7 @@ void serial_loop() { ...@@ -47,7 +49,7 @@ void serial_loop() {
void loop() { void loop() {
// Manager loop function must be called to process incoming messages // Manager loop function must be called to process incoming messages
//snmp.loop(); snmp.loop();
restServer.handleClient(); restServer.handleClient();
serial_loop(); serial_loop();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment