This sample project is based on the official LoRa M5Stack lib but personally I'm not satisfied with that. I found a better sorution with LMIC mechanism and I built a complex project around it, for details please check this: M5StackLora
A very basic sketch that tests the Join/Uplink/Downlink functionalities. The complete solution with the hardware setup and some modding you can found here: RAK811 WisNode LoRa as Shield