Author Topic: Disabling interrupts on RFM69 lib?  (Read 10093 times)

PinGuy

  • NewMember
  • *
  • Posts: 2
Disabling interrupts on RFM69 lib?
« on: October 06, 2019, 08:48:06 PM »
Hi, I am having quite a fight with my project. I am using an ESP8266 as gateway, and Nanos as nodes (only 1 node for now actually). I am currently experimenting with the struct_send and struct_receive examples as a base.
My loop() on the 8266 is connecting to a server every 2 seconds, doing a check for changes, and returning. The time of "blocking" for that check is usually between 2-3 seconds.
The problem is with the data the node is sending during that block time, so I implemented a kind of queue for the unsuccessful sendWithRetry calls. I keep retrying to send that queue that will be increasing in size as readings are made during block time, up to a max of 61 bytes (hardly reached during those 2-3 seconds).
When the 8266 "unblocks", I am getting an "old", small packet which seems to be buffered when it was blocking, not the one currently being sent on queue by the node.
What I want to do is disable the interrupts so no packets are buffered or received when the ESP is blocking. How can I accomplish that? Can I disconnect the DIO pin altogether and still get the messages somehow? Thanks in advance for any clues.

PinGuy

  • NewMember
  • *
  • Posts: 2
Re: Disabling interrupts on RFM69 lib?
« Reply #1 on: October 07, 2019, 10:48:22 AM »
Solved, I disabled interrupts by calling interruptHandler directly in receiveDone, as I saw in another post. I still get some buffering though, but I handled it by letting the node know the data I already got from the queue.