This sketch is aimed at The Things Network, but it should work for other networks as well. It employs personalization, over-the-air activation has not been tested yet.