This paper presents automatic key generation for long-range wireless communications in low power wide area networks (LPWANs), employing LoRa as a case study. Differential quantization is adopted to extract a high level of randomness. Experiments conducted both in an outdoor urban environment and in an indoor environment demonstrate that this key generation technique is applicable for LPWANs, and shows that it is able to reliably generate secure keys.