While LoraWan nodes for ttn Mapper are readily available for Arduino, They are hard to come by for Rasperry Pi. This code here is based on LoRaWAN-device-GPS-Raspberry-Pi specially the part How to configure a RaspBerry Pi Zero and the examples from Ernst de vreede. I used RFM95W and hooked it up with wires just as described in this page.
Please note that you need a file called my_config.h with your DevEUI, NwkSKey, AppSKey, DevAddr