Arduino-SNMP icon indicating copy to clipboard operation
Arduino-SNMP copied to clipboard

Compile SNMP Agent Arduino

Open rodriguescr opened this issue 7 years ago • 12 comments

Hi,

I've tried to compile the example SNMP Agent code, it won't find the module.h included in the SNMPAgent.h file, and if i comment it out, it trows another thousand errors. What module.h file is that?

Could you please help me?

rodriguescr avatar Mar 07 '18 11:03 rodriguescr

Take a look at the Example/Actual_SNMP_Agent project. I just pulled down the latest Arduino IDE and made some tweaks. It will now compile. Unfortunately I don't have an Arduino to test with right now.

rexpark avatar Mar 13 '18 02:03 rexpark

Thank you @rexpark . I will try to compile this new version.

rodriguescr avatar Mar 29 '18 14:03 rodriguescr

I'm still getting some errors, could you please help me?

When i try to compile, i get:

Arduino: 1.8.5 (Linux), Placa:"Arduino/Genuino Uno"

/home/gabriel/Arduino/snmp-v2/Example/Actual_SNMP_Agent/Actual_SNMP_Agent.ino:4:20: fatal error: String.h: No such file or directory
 #include <String.h>
                    ^
compilation terminated.
exit status 1

After renaming "String" to "string" the error go away, but then i get this errors:

/home/gabriel/Arduino/libraries/snmp-v2/SNMPAgent.cpp: In member function 'void SNMPAgent::process_inform_table()':
/home/gabriel/Arduino/libraries/snmp-v2/SNMPAgent.cpp:504:15: error: cannot convert 'SNMP_INFORM_TABLE_ENTRY' to 'SNMP_INFORM_TABLE_ENTRY*' in assignment
     tmp_entry = inform_holding_table.get(i);
               ^
/home/gabriel/Arduino/libraries/snmp-v2/SNMPAgent.cpp: In member function 'boolean SNMPAgent::process_inform_response()':
/home/gabriel/Arduino/libraries/snmp-v2/SNMPAgent.cpp:530:15: error: cannot convert 'SNMP_INFORM_TABLE_ENTRY' to 'SNMP_INFORM_TABLE_ENTRY*' in assignment
     tmp_entry = inform_holding_table.get(i);
               ^
/home/gabriel/Arduino/libraries/snmp-v2/SNMPAgent.cpp: In member function 'boolean SNMPAgent::remove_inform(uint32_t)':
/home/gabriel/Arduino/libraries/snmp-v2/SNMPAgent.cpp:546:15: error: cannot convert 'SNMP_INFORM_TABLE_ENTRY' to 'SNMP_INFORM_TABLE_ENTRY*' in assignment
     tmp_entry = inform_holding_table.get(i);
               ^
exit status 1


rodriguescr avatar Mar 29 '18 17:03 rodriguescr

Getting this error when compiling the actual agent for an uno:

Global variables use 3107 bytes (151%) of dynamic memory, leaving -1059 bytes for local variables. Maximum is 2048 bytes. Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint. Error compiling for board Arduino/Genuino Uno.

Maoie86 avatar Nov 15 '18 01:11 Maoie86

Hi guys! I have a issue: In file included from SNMPAgent.cpp:7:0: SNMPAgent.h:13:56: fatal error: ArduinoSNMP.h: no such file or directory. compilation terminated.

I put the ArduinoSNMP.h in the libraries, but doesn't works.

fvancan avatar Feb 28 '20 18:02 fvancan

Take a look at the Example/Actual_SNMP_Agent project. I just pulled down the latest Arduino IDE and made some tweaks. It will now compile. Unfortunately I don't have an Arduino to test with right now.

I tried to compile Actual_SNMP_Agent in Arduino IDE v 1.8.13. Result is unsuccessful. There is error log in the attachment. Error.log.txt

When LinkedList.h was replaced by actual version (from https://github.com/ivanseidel/LinkedList) there were less errors, but sketch did not compiled. Please look on the second error log.

Error.log.2.txt

Could you help solve this situation?

R1BLH avatar Feb 09 '21 15:02 R1BLH

I have the same problem as @cats-shadow . Was anyone able to resolve this? Thanks.

a4x4kiwi avatar Apr 29 '21 07:04 a4x4kiwi

After fixing a few issues, including replacing LinkedList.h, I get the following error when compiling for an Arduino Nano:

Global variables use 3009 bytes (146%) of dynamic memory, leaving -961 bytes for local variables. Maximum is 2048 bytes. Not enough memory; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing your footprint. Error compiling for board Arduino Nano.

janclod avatar Jul 05 '21 12:07 janclod

Just merged a couple PRs into master that should fix multiple compilation errors. I've removed LinkedList.h from the example app and added comments to the Readme stating the library needs to be installed separately now.

@janclod, you probably won't be able to get this to run on a Nano. The example app was written for convenience, not memory usage. If you remove most of the example OIDs and reduce the SNMP_MAX_VALUE_LEN to something smaller (based on whatever messages you know you'll be using) you might get it to fit.

rexpark avatar Jul 05 '21 15:07 rexpark

Thanks for updating this and the tips on how to possibly run on Nano.

Does it make sense to run a SNMP agent on a Nano? Is there a more sensible approach?

janclod avatar Jul 07 '21 15:07 janclod

What goal are you trying to accomplish with SNMP?

rexpark avatar Jul 07 '21 17:07 rexpark

I would like to send the value coming out from a pin (connected to a temperature sensor) to a SNMP manager

janclod avatar Jul 13 '21 14:07 janclod