I am trying to have LoRa communication between two RFM95W nodes. The first send a packet through LoRa and the second have to receive the packet and send to the gateway (LoRaWAN). Is this possible using RadioHead and LMIC library in the second node?
I don’t think So… LoRaWAN is bidirectional
What you are describing sounds a bit like a repeater, which is challenging in the details but something there’s been some work on which you can find if you research.
If you just want to send other methods locally, it’s typical possible to add to node software (either based on LMiC or not) and get it to also operate the radio in transmit or receive mode for other purposes outside of the narrow times when it is doing so for LoRaWan. That said, if you don’t want to burn battery keeping the receiver on a lot, you’ll need to establish some scheme for time coordination. And frequency coordination is also hard - unlike a gateway radio, a node radio can only receive on one frequency at one spreading factor at any given time.
Its probably possible, if you have an intimate knowledge of both the LMIC library and the RadioHead, and enough time.
I have never tried it but having two seperate libraries accessing the same device, and expecting it all to be reliable does not sound easy.