Hot!SNMP TRAP stop working if IP address was changed

Author
Stri
Super Member
  • Total Posts : 185
  • Reward points : 0
  • Joined: 2008/03/24 04:10:00
  • Location: Russia, Nsk
  • Status: offline
2019/03/19 03:32:22 (permalink)
0

SNMP TRAP stop working if IP address was changed

Hello.  I'm using  {TCPIP_STACK_NetDown(httpNetData.currNet); TCPIP_STACK_NetUp(httpNetData.currNet, &httpNetData.netConfig);}
combo to change IP address of my device, and it's working fine. However, I noticed, SNMP TRAPs are not being sent after I change IP address of my device (i.e. from 192.168.1.100 to 192.168.1.101). Send procedure quits on the following line:
 
// select and set the trap interface
if(!TCPIP_SNMP_SendTrapToSelctedInterface(&netIx,netIf))
{
continue;
}
 
If I power cycle my device traps starting to work again. How I can fix this?

Let's telegram! t.me/microchip_forum
#1

5 Replies Related Threads

    freebsd
    Super Member
    • Total Posts : 151
    • Reward points : 0
    • Joined: 2011/03/07 04:15:29
    • Location: 0
    • Status: offline
    Re: SNMP TRAP stop working if IP address was changed 2019/03/20 05:44:51 (permalink)
    0
    Could you please share the details of the Harmony version?
    I am looking into this issue and let you know.
    #2
    Stri
    Super Member
    • Total Posts : 185
    • Reward points : 0
    • Joined: 2008/03/24 04:10:00
    • Location: Russia, Nsk
    • Status: offline
    Re: SNMP TRAP stop working if IP address was changed 2019/03/20 21:30:23 (permalink)
    0
    hrisikeshsahu
    Could you please share the details of the Harmony version?
    I am looking into this issue and let you know.

    Hello. I'm using harmony v2_06

    Let's telegram! t.me/microchip_forum
    #3
    Stri
    Super Member
    • Total Posts : 185
    • Reward points : 0
    • Joined: 2008/03/24 04:10:00
    • Location: Russia, Nsk
    • Status: offline
    Re: SNMP TRAP stop working if IP address was changed 2019/03/24 23:19:40 (permalink)
    0
    Still struggling with this problem...

    Let's telegram! t.me/microchip_forum
    #4
    Stri
    Super Member
    • Total Posts : 185
    • Reward points : 0
    • Joined: 2008/03/24 04:10:00
    • Location: Russia, Nsk
    • Status: offline
    Re: SNMP TRAP stop working if IP address was changed 2019/03/25 21:54:54 (permalink)
    0
    OK, seems like I solved this. The problem was, TCPIP_STACK_NetDown() set "default net" to zero (tcpipDefIf.defaultNet = 0), and after this  TCPIP_SNMP_SendTrapToSelctedInterface() always fails to send TRAP. So, after TCPIP_STACK_NetUp() I have to call TCPIP_STACK_NetDefaultSet() in non-blocking way, since it set default net only if flag Flags.bInterfaceEnabled is true, which is set somewhere in MAC driver. Now my code looks like this:
     
    TCPIP_STACK_NetDown(httpNetData.currNet);
    TCPIP_STACK_NetUp(httpNetData.currNet, &httpNetData.netConfig);
    //I'm using protothreads here for non-blocking check
    PT_WAIT_WHILE(pt, TCPIP_STACK_NetDefaultSet(httpNetData.currNet) != true);
     
    It's kinda sad what TCPIP_STACK_NetDefaultSet() is never used in any TCP examples provided with Harmony 2_06...
     

    Let's telegram! t.me/microchip_forum
    #5
    rainad
    Super Member
    • Total Posts : 1118
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: SNMP TRAP stop working if IP address was changed 2019/03/26 09:15:35 (permalink)
    0
    The default interface should be set automatically by the NetUp, there shouldn't be any need for the user to set it (unless it needs to be changed) - this will be fixed ASAP. Thank you for identifying this.
     
    You should wait for TCPIP_STACK_NetIsReady() to return true, before starting any operations on that interface, this is the intended usage. After that the TCPIP_STACK_NetDefaultSet will succeed.
     
    #6
    Jump to:
    © 2019 APG vNext Commercial Version 4.5