Original Question: Data Packets from Node WSN by Ramya
how to stop receiving packets for 30 sec once the 1st packet is received from the node WSN , even though their s activities detected in sensors
Verified Answer: RE: Data Packets from Node WSN by schennu
Hi Ramya, The function Config_Ext_Ints(), configures the external interrupts. And is called just before the device enters hibernate mode. In your application, it is not required to call this every time, but only after the required time elapses. So, you can add a condition to execute this only when needed.
Question: RE: Data Packets from Node WSN by schennu
Hi Ramya, Thank you for posting a query. This seems like a custom implementation you're trying and is not covered within the EDK support terms. But to help you out on this;
I recollect there was similar query from Pixzee a month or two ago; to send data only on ADXL362 events. Is this an extension to that work? If so you can tag that post, so that we can answer quickly.
Coming to the issue, it seems like you wish to disable the interrupt for 30 seconds post the first packet (or every packet?). You can do this by disabling the interrupt pin connected to ADXL362 just before the first packet is sent.
Assuming it is the same system & software we released as part of AD6LoWPAN01_EDK;
Use below function to disable the interrupt after the first (or every) packet is sent.
adi_GPIO_DisableIRQ(EINT1_IRQn);
Once 30 seconds are counted, you can re-enable the interrupt by calling below function.
adi_GPIO_EnableIRQ(EINT1_IRQn, ADI_GPIO_IRQ_RISING_EDGE);
You can use a counter variable to count 30 seconds time and re-enable this interrupt after every packet sent.
clock_seconds() funtion will give you number of seconds since the node is powered up.
Hope this helps.
Note: It would be helpful if you mention the release version being used in your project as there are several releases with different protocols we support.
Question: RE: Data Packets from Node WSN by Ramya
hi schennu
thank you for your reply, coming to the query ,yes it is an extension to the work asked in the post Restrict End Node from pushing packets continuously.
We are working on AD6LoWPAN01 EDKv1.0 Platform: EV-ADRN-WSN-1Z with the Protocol: AD6LoWPAN
i want to restrict the packets once the 1st packet is sent for the desired amount time , you have told to disable adi_GPIO_DisableIRQ(EINT1_IRQn); please can you let me know where i can find the trigger point, and the information about the 1st packet reception(which function?).
since clock_seconds() function gives me the number of seconds since the node is powered up, to obtain the 30 sec count ,extra function is to be written or i can make use of any inbuilt counter in the program.
thanks
Ramya
Question: RE: Data Packets from Node WSN by schennu
Hi, You can call that API at the end of send_packet() in udp_client.c file.
And to get the count you could read the current_seconds into a local variable in the main() and write a condition to check for +30 (or whatever the time you wish to disable event) and then re-enable the interrupt by calling adi_GPIO_EnableIRQ(EINT1_IRQn, ADI_GPIO_IRQ_RISING_EDGE);
Hope you find this helpful.
Question: RE: Data Packets from Node WSN by schennu
Hi,
Can you make sure the interrupt is not re-enabled in anywhere else? Also, when do you see the packets get transmitted? Are these transmitted periodically? Then you need to set larger sleep period as we mentioned in the answer for the previous post.
First, make sure the packets are sent only on the external interrupt from ADXL362 and NOT periodically. Then try to disable the interrupt after the first packet.
Question: RE: Data Packets from Node WSN by Ramya
hi, thanks for your suggestion, i called adi_GPIO_DisableIRQ(EINT1_IRQn); at the end of send_packet(), and after some delay i re enabled the interrupt,but no luck their was a continuous transmission of packets ,
and i tried with one more test case where i just disabled the interrupt and didn't re-enabled it , i was expecting no packet reception but their is a reception packets even though the interrupt is been disabled,
Question: RE: Data Packets from Node WSN by Ramya
Hi,
The Sleep time is set to 5000, and i have no where re- enabled the interrupt, and the packets are sent only on the external interrupt from ADXL362, it doesn't send packets periodically.
The API adi_GPIO_EnableIRQ(EINT1_IRQn, ADI_GPIO_IRQ_RISING_EDGE) is called by function Config_Ext_Ints(), in lpm_hal.c