Home  >  Support  >  Support Forum  >  How can I change these SNMP ports where the Rabbit listen and where the traps are sent while the code is running?
Notice! We've recently migrated to using a new forum, we hope you enjoy it. If you are an existing member and this is your first time visiting our new forum, please reset your password to be able to sign in.
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How can I change these SNMP ports where the Rabbit listen and where the traps are sent while the code is running?

0 votes
I need to code a SW which changes while running the value of the SNMP ports which my device listens to SNMP packets and which trap packets are sent to instead of using the macros SNMP_PORT and SNMP_TRAP_PORT.
asked Jan 10 in Rabbit Software by gonperea New to the Community (0 points)

Please log in or register to answer this question.

2 Answers

0 votes
Here is the link to the TCPIP user manual, volume 2 http://www.digi.com/support/productdetail?pid=4978&type=documentation. Chapter 12 has full details on the SNMP library and its functions.

I see of no way to change the ports at runtime, only through the macros.
answered Jan 30 by trooper2 Veteran of the Digi Community (385 points)
0 votes
If you want to do it so that the port numbers are programmable there is a simple way to do it and a complicated way!

Simple way assumes you can reset the Rabbit device either by power cycling it or by doing a watchdog reset. To do this you define the macros to be integer variables instead of constants and set those variables up on power up. This is simple enough but does require a reset before the new values are recognised as the SNMP library does not have a shut down and reinitialise option.

The more complicated way would be to change the macros to variables as above and modify the library to add a shutdown function so that you can shut down SNMP (closing open sockets, resetting state variables etc), modify the variables and restart SNMP. It would not be a huge job to do this.

answered Jan 31 by petermcs Veteran of the Digi Community (430 points)
Contact a Digi expert and get started today! CONTACT US