What is DIO0 used for on LoRa (SX1278) modules

I have been experimenting with LoRa modules usually on already made dev boards, I now have a few LoRa modules that I am connecting to ESP8266/32’s.
Using a Wemos D1 Mini ESP8266 I had problems with D4(GPIO2) when trying to upload firmware. I had to disconnect it each time. ESP GPIO2 is connected to the LoRa module DIO0.
Using the LoRa library by ‘sandeepmistry’ it appeared that DIO0 on the LoRa module was required to receive, if disconnected no data would be recived.
However, using the same library I used a different example code and now I can send and receive without DIO0 connected at all.
So, what is DIO0 used for and do I require it for some reason that I have yet to discover.
Thanks
Martin

Please note that this forum is for the discussion and support of TTN\LoRaWAN, it is not a general purpose ‘LoRa’ forum.

The ‘LoRa library by sandeepmistry’ is nor for use on TTN\LoRaWAN so is not supported here.

You will find the various purposes for which DIO can be used defined in the SX127x datasheet.